%h1
  = @author.name
  = @author.active ? "" : " (inactive)"
.author
  %aside= image_tag @author.image, class: "avatar"
%p
  = @author.email_tag
  %br Created #{@author.articles.count} articles and edited #{@author.edits.count}.


= simple_form_for @author.source, url: author_path(@author), method: :patch do |f|
  = f.input :shtick, as: :text, required: false, placeholder: "What's this author's shtick? What do they do? "
  = f.submit "Update That Shtick", class: "btn-a"


%h2 Articles created (#{@author.articles.count})
%ul
  - @author.articles.each do |article|
    %li= link_to article, article

%h2 Articles edited (#{@author.edits.count})
%ul
  - @author.edits.each do |edit|
    %li= link_to edit, edit

= simple_form_for :user, url: author_path(@author), method: :patch do |f|
  = f.input :avatar, as: :file, required: false, label: "Photo"
  = f.submit "Upload Avatar", class: "btn-a"

= link_to "Toggle Status", author_toggle_status_path(@author), method: :put

%h1
  = @author.name
  = @author.active ? "" : " (inactive)"
.author
  %aside= image_tag @author.image, class: "avatar"
%p
  = @author.email_tag
  %br Created #{@author.articles.count} articles and edited #{@author.edits.count}.


= simple_form_for @author.source, url: author_path(@author), method: :patch do |f|
  = f.input :shtick, as: :text, required: false, placeholder: "What's this author's shtick? What do they do? "
  = f.submit "Update That Shtick", class: "btn-a"


%h2 Articles created (#{@author.articles.count})
%ul
  - @author.articles.each do |article|
    %li= link_to article, article

%h2 Articles edited (#{@author.edits.count})
%ul
  - @author.edits.each do |edit|
    %li= link_to edit, edit

- if Rails.env.development? or current_user.id == 1
  = simple_form_for :user, url: author_path(@author), method: :patch do |f|
    = f.input :avatar, as: :file, required: false, label: "Photo"
    = f.submit "Upload Avatar", class: "btn-a"

= link_to "Toggle Status", author_toggle_status_path(@author), method: :put

Put a stop to avatar shenanigans.
Put a stop to avatar shenanigans.
