_view_items.html.erb 1.41 KB
<% @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 %>