anyone-oslo/pages

View on GitHub
app/views/admin/pages/deleted.html.erb

Summary

Maintainability
Test Coverage
<% content_for :page_title, "Deleted pages" %>

<% content_for :page_description do %>
  <%= link_to("All pages", admin_pages_path(content_locale)) %> /
  Deleted pages
<% end %>

<% content_for :page_description_links do %>
  <%= locale_links { |l| deleted_admin_pages_path(l) } %>
<% end %>

<% if @pages.any? %>
  <table class="deleted-pages list">
    <tr>
      <th>Name</th>
      <th>Last updated</th>
      <th>Author</th>
      <th>Location</th>
    </tr>
    <% @pages.each do |page| %>
      <tr>
        <td class="name">
          <%= link_to_if(policy(page).edit?,
                         page_name(page),
                         edit_admin_page_url(content_locale, page),
                         class: 'name_link') %>
        </td>
        <td>
          <%= l(page.updated_at, format: :short) %>
        </td>
        <td>
          <%= link_to(page.author.name, admin_user_path(page.author)) %>
        </td>
        <td>
          <% if page.parent %>
            <%= page_name(page.parent, include_parents: true) %>
          <% else %>
            Top level
          <% end %>
        </td>
      </tr>
    <% end %>
  </table>
<% end %>