denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyPages/app/views/shiny_pages/admin/pages/index.html.erb

Summary

Maintainability
Test Coverage
<% if @top_level_items.present? %>
<table class="table table-responsive-sm table-striped">
  <thead>
    <tr>
      <% if current_user.can? :edit, :page_sections %>
      <th></th>
      <% end %>
      <th class="width25pc page">
        Page / Section
      </th>
      <th>
      </th>
      <th class="width25pc">
      </th>
    </tr>
  </thead>

  <tbody id="live-sortable" data-url="<%= shiny_pages.sort_pages_path %>">
  <% @top_level_items.each do |top_level_item| %>
    <%= render partial: 'page_item', locals: {
      page_item: top_level_item,
      view_path: '',
      indent: 0.5
    } %>
  <% end %>
  </tbody>
</table>

<% else %>
<p>
  <%= t( 'shinycms.empty_list', items: ShinyPages::Page.readable_name ) %>
</p>
<% end %>