[Git][noosfero/noosfero][master] 2 commits: Add last update column on cms listing
Bráulio Bhavamitra
gitlab at gitlab.com
Tue Jun 16 11:45:50 BRT 2015
Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero
Commits:
97c7bad1 by Braulio Bhavamitra at 2015-06-16T11:42:46Z
Add last update column on cms listing
Conflicts:
app/views/cms/_view_items.html.erb
config/locales/en.yml
- - - - -
ee80381a by Bráulio Bhavamitra at 2015-06-16T14:45:41Z
Merge branch 'ai2982' into 'master'
Add column last update in the CMS file listings
http://noosfero.org/Development/ActionItem2982
See merge request !105
- - - - -
2 changed files:
- + app/views/cms/_view_items.html.erb
- app/views/cms/view.html.erb
Changes:
=====================================
app/views/cms/_view_items.html.erb
=====================================
--- /dev/null
+++ b/app/views/cms/_view_items.html.erb
@@ -0,0 +1,29 @@
+<% @articles.each do |article| article = FilePresenter.for article %>
+ <tr title="<%= article.title%>" >
+ <td class="article-name">
+ <%= link_to_article(article) %>
+ </td>
+ <% short_description = article.respond_to?(:short_description) ?
+ article.short_description :
+ article.class.short_description %>
+ <td class="article-mime" title=<%= short_description.to_json %>>
+ <%= short_description %>
+ </td>
+ <td class="last-update">
+ <%= time_ago_in_words article.updated_at %>
+ </td>
+ <td class="article-controls">
+ <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit, article) %>
+ <%= button_without_text :eyes, _('Public view'), article.view_url %>
+ <%= display_spread_button(article) unless remove_content_button(:spread, article) %>
+ <% if user.can_change_homepage? && !remove_content_button(:home, article) %>
+ <% if profile.home_page != article %>
+ <%= expirable_button article, :home, _('Use as homepage'), { :action => 'set_home_page', :id => article.id }, :method => :post %>
+ <% else %>
+ <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %>
+ <% end %>
+ <% end %>
+ <%= display_delete_button(article) if !remove_content_button(:delete, article) %>
+ </td>
+ </tr>
+<% end %>
=====================================
app/views/cms/view.html.erb
=====================================
--- a/app/views/cms/view.html.erb
+++ b/app/views/cms/view.html.erb
@@ -37,6 +37,7 @@
<tr>
<th><%= _('Name') %></th>
<th><%= _('Type') %></th>
+ <th><%= _('Last update') %></th>
<th><%= _('Actions') %></th>
</tr>
@@ -54,32 +55,7 @@
</tr>
<% end %>
- <% @articles.each do |article| article = FilePresenter.for article %>
- <tr title="<%= article.title%>" >
- <td class="article-name">
- <%= link_to_article(article) %>
- </td>
- <% short_description = article.respond_to?(:short_description) ?
- article.short_description :
- article.class.short_description %>
- <td class="article-mime" title=<%= short_description.to_json %>>
- <%= short_description %>
- </td>
- <td class="article-controls">
- <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit, article) %>
- <%= button_without_text :eyes, _('Public view'), article.view_url %>
- <%= display_spread_button(article) unless remove_content_button(:spread, article) %>
- <% if user.can_change_homepage? && !remove_content_button(:home, article) %>
- <% if profile.home_page != article %>
- <%= expirable_button article, :home, _('Use as homepage'), { :action => 'set_home_page', :id => article.id }, :method => :post %>
- <% else %>
- <%= button_without_text(:'home-not', _('Reset homepage'), { :action => 'set_home_page', :id => nil }, :method => :post) %>
- <% end %>
- <% end %>
- <%= display_delete_button(article) if !remove_content_button(:delete, article) %>
- </td>
- </tr>
- <% end %>
+ <%= render 'view_items' %>
</table>
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/1c721a96be2bf4f93ad0458dc219f63a9ffca722...ee80381ab7b70b1ef09889b2fa0d74c202e0a349
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150616/b3caf01e/attachment.html>
More information about the Noosfero-dev
mailing list