2010-01-14 10:30:53 +00:00
|
|
|
<% content_for :secondary do %>
|
2011-04-13 10:19:51 +00:00
|
|
|
<ul class="list">
|
|
|
|
<% if (@items.empty? && !@parent_item ) || (!@items.empty? && @items[0].is_home?) %>
|
|
|
|
<li><%= t('admin.new_page') %></li>
|
|
|
|
<li><%= t('admin.new_link') %></li>
|
|
|
|
<li><%= t('admin.new_snippet') %></li>
|
|
|
|
<% else %>
|
|
|
|
<li><%= link_to t('admin.new_page'), new_admin_page_path( :parent_id => @parent_item.id ), :class => 'button positive' %></li>
|
|
|
|
<li><%= link_to t('admin.new_link'), new_admin_link_path( :parent_id => @parent_item.id ) %>
|
|
|
|
<li><%= link_to t('admin.new_snippet'), new_admin_snippet_path( :parent_id => @parent_item.id ), :class => 'button positive' %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2010-01-14 10:30:53 +00:00
|
|
|
<% end -%>
|
|
|
|
|
2011-02-08 02:07:40 +00:00
|
|
|
<%= flash_messages %>
|
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
<h1><%= t('admin.list_items') %>: <%= show_parent_items_link unless @parent_item.nil? %></h1>
|
2010-01-14 10:30:53 +00:00
|
|
|
|
2011-04-13 10:19:51 +00:00
|
|
|
<% if !Layout.exist_one? %>
|
|
|
|
<div style='color:red'><%= t('admin.no_layout') %>: <%= link_to t('create').downcase, new_admin_layout_path %></div>
|
|
|
|
<br/>
|
|
|
|
<% elsif (@items.empty? && !@parent_item ) %>
|
|
|
|
<div style='color:red'><%= t('admin.no_home_page') %>: <%= link_to t('create').downcase, new_admin_home_path(:parent_id => nil) %></div>
|
|
|
|
<br/>
|
|
|
|
<% else %>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th><%= t('admin.class') %></th>
|
|
|
|
<th><%= t('admin.name') %></th>
|
|
|
|
<th><%= t('admin.title') %></th>
|
|
|
|
<th><%= t('admin.position') %></th>
|
|
|
|
<th><%= t('admin.published?') %></th>
|
|
|
|
<th><%= t('admin.action') %></th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
<% @items.each do |item| %>
|
|
|
|
<tr>
|
|
|
|
<%= render :partial => item.class.to_s.downcase, :locals => { :item => item } %>
|
|
|
|
<!--<td><%= link_to t(:move_up, :scope => :admin), up_admin_item_path(item), :method => :put %> |
|
|
|
|
<%= link_to t(:move_down, :scope => :admin), down_admin_item_path(item), :method => :put %></td>-->
|
|
|
|
</tr>
|
|
|
|
<% end if @items %>
|
|
|
|
</table>
|
2010-01-14 10:30:53 +00:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= render :partial => "snippets", :locals => { :snippets => @snippets } %>
|