orbit-basic/app/views/admin/pages/index.html.erb

39 lines
1.0 KiB
Plaintext

<h1>Listing pages</h1>
<table>
<tr>
<th>Name</th>
<th>Children</th>
<th>Layout</th>
<th>Parent</th>
<th>Position</th>
<th>Published?</th>
<th>Action</th>
</tr>
<% @pages.each do |page| %>
<tr>
<td><%= link_to page.name, admin_page_path(page) %></td>
<td><ul>
<% page.children.each do |child| %>
<li><%= child.name %></li>
<% end -%>
</td>
<td><%= page.layout_name %></th>
<td><%= page.parent_page_id %></td>
<td><%= page.position %></td>
<td><%= page.is_published.to_s %></td>
<td>
<%= link_to 'Edit', edit_admin_page_path(page) %> |
<%= link_to 'Add Child', new_admin_page_path( :parent_page_id => page.id ) %> |
<%= link_to 'Destroy', admin_page_path(page), :confirm => 'Are you sure?', :method => :delete %>
</td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New pages', new_admin_page_path, :class => 'button positive' %>
<%= link_to 'New root menu snippets', new_admin_snippet_path( :menu => 'root' ), :class => 'button positive' %>