Commit ee80381ab7b70b1ef09889b2fa0d74c202e0a349
Exists in
master
and in
29 other branches
Merge branch 'ai2982' into 'master'
Add column last update in the CMS file listings http://noosfero.org/Development/ActionItem2982 See merge request !105
Showing
2 changed files
with
31 additions
and
26 deletions
Show diff stats
... | ... | @@ -0,0 +1,29 @@ |
1 | +<% @articles.each do |article| article = FilePresenter.for article %> | |
2 | + <tr title="<%= article.title%>" > | |
3 | + <td class="article-name"> | |
4 | + <%= link_to_article(article) %> | |
5 | + </td> | |
6 | + <% short_description = article.respond_to?(:short_description) ? | |
7 | + article.short_description : | |
8 | + article.class.short_description %> | |
9 | + <td class="article-mime" title=<%= short_description.to_json %>> | |
10 | + <%= short_description %> | |
11 | + </td> | |
12 | + <td class="last-update"> | |
13 | + <%= time_ago_in_words article.updated_at %> | |
14 | + </td> | |
15 | + <td class="article-controls"> | |
16 | + <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit, article) %> | |
17 | + <%= button_without_text :eyes, _('Public view'), article.view_url %> | |
18 | + <%= display_spread_button(article) unless remove_content_button(:spread, article) %> | |
19 | + <% if user.can_change_homepage? && !remove_content_button(:home, article) %> | |
20 | + <% if profile.home_page != article %> | |
21 | + <%= expirable_button article, :home, _('Use as homepage'), { :action => 'set_home_page', :id => article.id }, :method => :post %> | |
22 | + <% else %> | |
23 | + <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %> | |
24 | + <% end %> | |
25 | + <% end %> | |
26 | + <%= display_delete_button(article) if !remove_content_button(:delete, article) %> | |
27 | + </td> | |
28 | + </tr> | |
29 | +<% end %> | ... | ... |
app/views/cms/view.html.erb
... | ... | @@ -37,6 +37,7 @@ |
37 | 37 | <tr> |
38 | 38 | <th><%= _('Name') %></th> |
39 | 39 | <th><%= _('Type') %></th> |
40 | + <th><%= _('Last update') %></th> | |
40 | 41 | <th><%= _('Actions') %></th> |
41 | 42 | </tr> |
42 | 43 | |
... | ... | @@ -54,32 +55,7 @@ |
54 | 55 | </tr> |
55 | 56 | <% end %> |
56 | 57 | |
57 | - <% @articles.each do |article| article = FilePresenter.for article %> | |
58 | - <tr title="<%= article.title%>" > | |
59 | - <td class="article-name"> | |
60 | - <%= link_to_article(article) %> | |
61 | - </td> | |
62 | - <% short_description = article.respond_to?(:short_description) ? | |
63 | - article.short_description : | |
64 | - article.class.short_description %> | |
65 | - <td class="article-mime" title=<%= short_description.to_json %>> | |
66 | - <%= short_description %> | |
67 | - </td> | |
68 | - <td class="article-controls"> | |
69 | - <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit, article) %> | |
70 | - <%= button_without_text :eyes, _('Public view'), article.view_url %> | |
71 | - <%= display_spread_button(article) unless remove_content_button(:spread, article) %> | |
72 | - <% if user.can_change_homepage? && !remove_content_button(:home, article) %> | |
73 | - <% if profile.home_page != article %> | |
74 | - <%= expirable_button article, :home, _('Use as homepage'), { :action => 'set_home_page', :id => article.id }, :method => :post %> | |
75 | - <% else %> | |
76 | - <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %> | |
77 | - <% end %> | |
78 | - <% end %> | |
79 | - <%= display_delete_button(article) if !remove_content_button(:delete, article) %> | |
80 | - </td> | |
81 | - </tr> | |
82 | - <% end %> | |
58 | + <%= render 'view_items' %> | |
83 | 59 | |
84 | 60 | </table> |
85 | 61 | ... | ... |