app/views/manifest/pages/show.html.erb in manifest-rails-0.0.4 vs app/views/manifest/pages/show.html.erb in manifest-rails-0.1.0

- old
+ new

@@ -1,7 +1,30 @@ -<h2>Page: <%= @page.title %></h2> +<h2>Pages: &ldquo;<%= @page.title %>&rdquo;</h2> -<ul> - <% @page.content_blocks.each do |c| %> - <li><%= link_to c.title, edit_manifest_content_block_path(c) %></li> - <% end %> -</ul> +<h3>Content Blocks</h3> + +<% if @page.content_blocks.count > 0 %> + <table> + <thead> + <th>Title</th> + <th>Created</th> + <th>Updated</th> + </thead> + + <tbody> + <% @page.content_blocks.each do |c| %> + <tr> + <td><%= link_to c.title, edit_manifest_content_block_path(c) %></td> + <td><%= c.created_at.to_s(:short) %></td> + <td><%= c.updated_at.to_s(:short) %></td> + </tr> + <% end %> + </tbody> + </table> +<% else %> + <p>This page has no content blocks of its own. <%= link_to('Add one!', new_manifest_content_block_path(content_block: { page_id: @page.id })) if current_editor.admin? %></p> +<% end %> + +<% if current_editor.admin? %> + <%= link_to 'Edit Page', edit_manifest_page_path(@page) %> + <%= link_to 'Delete Page', manifest_page_path(@page), method: :delete, confirm: "Are you sure you want to delete page \"#{@page.title}\"?" %> +<% end %>