diff --git a/app/views/cms/_view_items.html.erb b/app/views/cms/_view_items.html.erb new file mode 100644 index 0000000..38f0077 --- /dev/null +++ b/app/views/cms/_view_items.html.erb @@ -0,0 +1,29 @@ +<% @articles.each do |article| article = FilePresenter.for article %> + + + <%= link_to_article(article) %> + + <% short_description = article.respond_to?(:short_description) ? + article.short_description : + article.class.short_description %> + > + <%= short_description %> + + + <%= time_ago_in_words article.updated_at %> + + + <%= 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) %> + + +<% end %> diff --git a/app/views/cms/view.html.erb b/app/views/cms/view.html.erb index b9a2b0c..3dd78a3 100644 --- a/app/views/cms/view.html.erb +++ b/app/views/cms/view.html.erb @@ -37,6 +37,7 @@ <%= _('Name') %> <%= _('Type') %> + <%= _('Last update') %> <%= _('Actions') %> @@ -54,32 +55,7 @@ <% end %> - <% @articles.each do |article| article = FilePresenter.for article %> - - - <%= link_to_article(article) %> - - <% short_description = article.respond_to?(:short_description) ? - article.short_description : - article.class.short_description %> - > - <%= short_description %> - - - <%= 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) %> - - - <% end %> + <%= render 'view_items' %> -- libgit2 0.21.2