app/views/admin/articles/index.html.erb in beef-articles-0.4.14 vs app/views/admin/articles/index.html.erb in beef-articles-0.4.15
- old
+ new
@@ -1,18 +1,19 @@
<h1>Listing Articles</h1>
<ul class="choices">
- <li><%= link_to 'New article', new_admin_article_path, :title => 'Create a new article' %></li>
+ <li><%= link_to 'New article', { :action => 'new' }, :title => 'Create a new article' %></li>
</ul>
-<%= will_paginate %>
+<%= will_paginate @articles %>
<table>
<thead>
<tr>
<%= sortable_table_header :name => "Title", :sort => "title" %>
<%= sortable_table_header :name => "Status", :sort => "published_at" %>
+ <%= sortable_table_header :name => "Category", :sort => "category" if Category.all.any? %>
<%= sortable_table_header :name => "Author", :sort => "created" %>
<%= sortable_table_header :name => "Editor", :sort => "updated" %>
<%= sortable_table_header :name => "Updated", :sort => "updated_at" %>
<%= sortable_table_header :name => "Created", :sort => "created_at" %>
<%= sortable_table_header :name => "Published At", :sort => "published_at" %>
@@ -24,10 +25,13 @@
<tbody>
<% @articles.each do |article| %>
<tr id="article-<%= article.id %>">
<td><%= link_to h( article.title ), admin_article_path(article), :title => 'Edit this article' %></td>
<td><%= content_status(article) %></td>
+<% if Category.all.any? -%>
+ <td><%=h article.category.title unless article.category.nil? %></td>
+<% end -%>
<td><%= article.author %></td>
<td><%= article.editor %></td>
<td><%= article.updated_at.to_formatted_s(:short) %></td>
<td><%= article.created_at.to_formatted_s(:short) %></td>
<td><%= article.published_at.to_formatted_s(:short) unless article.published_at.nil? %></td>
@@ -41,10 +45,11 @@
</tbody>
<tfoot>
<tr>
<%= sortable_table_header :name => "Title", :sort => "title" %>
<%= sortable_table_header :name => "Status", :sort => "published_at" %>
+ <%= sortable_table_header :name => "Category", :sort => "category" if Category.all.any? %>
<%= sortable_table_header :name => "Author", :sort => "created_by" %>
<%= sortable_table_header :name => "Editor", :sort => "updated_by" %>
<%= sortable_table_header :name => "Updated", :sort => "updated_at" %>
<%= sortable_table_header :name => "Created", :sort => "created_at" %>
<%= sortable_table_header :name => "Published At", :sort => "published_at" %>
@@ -53,7 +58,7 @@
<th colspan="3">Actions</th>
</tr>
</tfoot>
</table>
-<%= will_paginate %>
+<%= will_paginate @articles %>