<commit_before><h1>
  <%= _('Content management') %>
</h1>

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

  <%= colorbox_button('new', _('New content'), :action => 'new', :parent_id => parent_id, :cms => true) %>
  <%= 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.map {|item| " / " + ((item == @article) ? item.name : link_to(item.slug, :id => item.id)) } %>
  </div>
<% end %>

<table class='cms-articles'>

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

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

  <% @articles.each do |article| article = FilePresenter.for article %>
    <tr>
      <td class="article-name">
        <%= link_to_article(article) %>
      </td>
      <td class="article-mime">
        <%= article.respond_to?(:short_description) ?
                      article.short_description :
                      article.class.short_description %>
      </td>
      <td class="article-controls">
        <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit) %>
        <%= button_without_text :eyes, _('Public view'), article.view_url %>
        <%= display_spread_button(profile, article) unless article.folder? || remove_content_button(:spread)%>
        <% if !environment.enabled?('cant_change_homepage') && !remove_content_button(:home) %>
          <%= expirable_button article, :home, _('Use as homepage'), { :action => 'set_home_page', :id => article.id }, :method => :post %>
        <% end %>
        <%= display_delete_button(article) if !remove_content_button(:delete) %><commit_msg>Adding title to cms article mime-type<commit_after><h1>
  <%= _('Content management') %>
</h1>

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

  <%= colorbox_button('new', _('New content'), :action => 'new', :parent_id => parent_id, :cms => true) %>
  <%= 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.map {|item| " / " + ((item == @article) ? item.name : link_to(item.slug, :id => item.id)) } %>
  </div>
<% end %>

<table class='cms-articles'>

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

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

  <% @articles.each do |article| article = FilePresenter.for article %>
    <tr>
      <td class="article-name">
        <%= link_to_article(article) %>
      </td>
      <% short_description =  article.respond_to?(:short_description) ?
            article.short_description :
            article.class.short_description %>
      <td class="article-mime" title=<%= short_description.to_json %>>
        <%= short_description %>
      </td>
      <td class="article-controls">
        <%= expirable_button article, :edit, _('Edit'), {:action => 'edit', :id => article.id} if !remove_content_button(:edit) %>
        <%= button_without_text :eyes, _('Public view'), article.view_url %>
        <%= display_spread_button(profile, article) unless article.folder? || remove_content_button(:spread)%>
        <% if !environment.enabled?('cant_change_homepage') && !remove_content_button(:home) %>
          <%= expirable_button article, :home, _('Use as homepage'), { :action => 'set_home_page', :id => article.id }, :method => :post %>
        <% end %>
        <%= display_delete_button(article) if !remove_content_button(:delete) %>
{'fraction_non_alphanumeric': 0.2261953412341643, 'fraction_numerical': 0.0012259910093992644, 'mean_word_length': 3.1099916036943744, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4405638', 'n_tokens_mistral': 1759, 'n_tokens_neox': 1604, 'n_words': 325}