view.html.erb 2.01 KB
<h1>
  <%= _('Content management') %>
</h1>

<% if user.can_change_homepage? && !remove_content_button(:home, profile.home_page) %>
  <div class="cms-homepage">
    <%= _('Profile homepage:') %>
    <% if profile.home_page %>
      <%= link_to_article(profile.home_page) %>
      <%= button_without_text(:'home-not', _('Reset homepage'),  { :action => 'set_home_page', :id => nil }, :method => :post) %>
    <% else %>
      <span class="cms-homepage-default"><%= _('Profile Information') %></span>
    <% end %>
  </div>
<% end %>

<% button_bar(:style => 'margin-bottom: 1em;') do %>
  <% parent_id = ((@article && @article.allow_children?) ? @article : nil) %>

  <%= modal_button('new', _('New content'), url_for({:action => 'new', :parent_id => parent_id, :cms => true}).html_safe) %>
  <%= button(:back, _('Back to control panel'), :controller => 'profile_editor', :action => "index") %>
<% end %>

<% if @article %>
  <div id='article-full-path'>
    <strong><%= _('Current folder: ') %></strong>
    <%= link_to profile.identifier, :action => 'index' %>
    <% @article.hierarchy.each do |item| %>
      <%= " / ".html_safe + ((item == @article) ? item.name.html_safe : link_to(item.slug, :id => item.id).html_safe) %>
    <% end %>
  </div>
<% end %>

<table class='cms-articles'>

  <%# header %>
  <tr>
    <th><%= _('Name') %></th>
    <th><%= _('Type') %></th>
    <th><%= _('Last update') %></th>
    <th><%= _('Actions') %></th>
  </tr>

  <% if @article %>
    <tr>
      <td>
        <% if @article.parent %>
          <%= link_to '.. ('.html_safe + _('parent folder') + ')', {:action => 'view', :id => @article.parent.id}, :class => 'icon-parent-folder' %>
        <% else %>
          <%= link_to '.. ('.html_safe + _('parent folder') + ')', {:action => 'index'}, :class => 'icon-parent-folder' %>
        <% end %>
      </td>
      <td><%= Folder.short_description %></td>
      <td> </td>
    </tr>
  <% end %>

  <%= render 'view_items' %>

</table>

<%= pagination_links @articles, {:param_name => 'npage', :page_links => true} %>