anyone-oslo/pages

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

Summary

Maintainability
Test Coverage
<%
  author ||= false
  date ||= false
  section ||= false
  sections ||= []
%>
<%= page_list_row(page) do %>
  <td class="name">
    <%= link_to_if(policy(page).edit?,
                   page_name(page),
                   edit_admin_page_url(content_locale, page),
                   class: 'name_link') %>
    <%= autopublish_notice(page) %>
  </td>
  <% if date %>
    <td class="date">
      <%= page_date_range(page) %>
    </td>
  <% end %>
  <td>
    <%= page_published_status(page) %>
  </td>
  <% if author %>
    <td>
      <%= link_to(page.author.name, admin_user_path(page.author)) %>
    </td>
  <% end %>
  <% if section %>
    <td>
      <%= news_section_name(page.parent, sections) %>
    </td>
  <% end %>
<% end %>