OSDN Git Service

t#31223:add them contents list for author and artist
[pettanr/pettanr.git] / app / views / authors / comics.html.erb
diff --git a/app/views/authors/comics.html.erb b/app/views/authors/comics.html.erb
new file mode 100644 (file)
index 0000000..b132d0b
--- /dev/null
@@ -0,0 +1,27 @@
+<h1><%= t '.title' -%></h1>
+
+<table>
+  <% @comics.each do |comic| %>
+    <tr>
+      <td>
+        <%= link_to comic_icon(:object => comic, :size => 25), comic_path(comic) %>
+        <%= link_to h(truncate(comic.title, :length => 40)), :controller => 'stories', :action => :comic, :id => comic.id %>
+        (<%= comic.stories.size -%>)
+      </td>
+      <td>
+        <%= distance_of_time_in_words_to_now comic.updated_at %>
+      </td>
+      <td>
+        <%= link_to author_icon(:object => comic.author, :size => 25), comic_path(comic.author) %>
+        <%= link_to h(truncate(comic.author.name, :length => 12)), author_path(comic.author) %>
+      </td>
+      <td>
+        <% if comic.own? @author %>
+          <%= link_to t('link.edit'), edit_comic_path(comic) %>
+          <%= link_to t('link.destroy'), comic_path(comic), :method => :delete %>
+        <% end %>
+      </td>
+    </tr>
+  <% end %>
+</table>
+<%= link_to t('comics.new.title'), new_comic_path %>