<commit_before><%
  if @page.parent && @page.parent.has_posts? && @page.parent.feed
    add_rss_feed_to_head(@page.parent.name, @page.parent.feed.url)
  end
%>

<div id="article" class="<%= @page.css_class_name %>">


<div<%= " class='logged-in'" if user %>>
  <div id="article-actions">
  <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %>
      <% if @page.allow_post_content?(user) %>
        <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
            profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
            :class => 'button with-text icon-edit' %>
        <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
          <% if @page != profile.home_page && !@page.has_posts? %>
            <%= link_to content_tag( 'span', _('Delete') ),
              profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page }),
              :class => 'button with-text icon-delete' %>
          <% end %>
          <% if !environment.enabled?('disable_cms') && !@page.folder? %>
            <% if profile.kind_of?(Person) %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% elsif profile.kind_of?(Community) && environment.portal_community %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% end %>
          <% end %>
        <% end %>
      <% end %>
      <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
        <% if !@page.gallery? %>
          <%= link_to _('Add translation'),
              profile.admin_url.merge(:controller => 'cms', :action => 'new',
                                      :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)),
                                      :type => @page.type, :article => { :translation_of_id => @page.native_translation.id }),
              :class => 'button with-text icon-locale' if @page.translatable? && !@page.native_translation.language.blank? %>
          <%= lightbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %>
        <% end %>
        <% if (@page.folder? && !@page.has_posts?) || (@page.parent && @page.parent.folder? && !@page.parent.has_posts?) %>
          <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) %>
        <% end %>
      <% end %>
      <% if profile.kind_of?(Enterprise) && @page.gallery? %>
        <%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %>
      <% end %>
  <% elsif profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %>
      <%= link_to content_tag( 'span', _('Suggest an article') ), profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}), :id => 'suggest-article-link', :class => 'button with-text icon-new' %>
  <% end %>
  </div>
  <div id="article-header">
    <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
    <%= article_title(@page, :no_link => true) %>
    <%= article_translations(@page) %>
  </div>
</div>


<% if !@page.tags.empty? %>
  <div id="article-tags">
    <%= _("This article's tags:") %>
    <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tags', :id => t.name ) }.join("\n") %>
  </div>
<% end %>

<% if @page.display_hits? %>
  <div id="article-hits">
    <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %>
  </div>
<% end %>

<% if @page.parent && !@page.parent.path.blank? %><commit_msg>Duplicating article-actions to avoid empty div<commit_after><%
  if @page.parent && @page.parent.has_posts? && @page.parent.feed
    add_rss_feed_to_head(@page.parent.name, @page.parent.feed.url)
  end
%>

<div id="article" class="<%= @page.css_class_name %>">


<div<%= " class='logged-in'" if user %>>
  <% if @page.allow_post_content?(user) || @page.allow_publish_content?(user) %>
    <div id="article-actions">
      <% if @page.allow_post_content?(user) %>
        <%= link_to content_tag( 'span', label_for_edit_article(@page) ),
            profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
            :class => 'button with-text icon-edit' %>
        <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
          <% if @page != profile.home_page && !@page.has_posts? %>
            <%= link_to content_tag( 'span', _('Delete') ),
              profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page }),
              :class => 'button with-text icon-delete' %>
          <% end %>
          <% if !environment.enabled?('disable_cms') && !@page.folder? %>
            <% if profile.kind_of?(Person) %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% elsif profile.kind_of?(Community) && environment.portal_community %>
              <%= link_to content_tag( 'span', _('Spread this') ),
                  profile.admin_url.merge({ :controller => 'cms', :action => 'publish_on_portal_community', :id => @page }),
                  :class => 'button with-text icon-spread' %>
            <% end %>
          <% end %>
        <% end %>
      <% end %>
      <% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
        <% if !@page.gallery? %>
          <%= link_to _('Add translation'),
              profile.admin_url.merge(:controller => 'cms', :action => 'new',
                                      :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)),
                                      :type => @page.type, :article => { :translation_of_id => @page.native_translation.id }),
              :class => 'button with-text icon-locale' if @page.translatable? && !@page.native_translation.language.blank? %>
          <%= lightbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %>
        <% end %>
        <% if (@page.folder? && !@page.has_posts?) || (@page.parent && @page.parent.folder? && !@page.parent.has_posts?) %>
          <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) %>
        <% end %>
      <% end %>
      <% if profile.kind_of?(Enterprise) && @page.gallery? %>
        <%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %>
      <% end %>
    </div>
  <% elsif profile.community? && (@page.blog? || @page.parent && @page.parent.blog?) %>
    <div id="article-actions">
      <%= link_to content_tag( 'span', _('Suggest an article') ), profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}), :id => 'suggest-article-link', :class => 'button with-text icon-new' %>
    </div>
  <% end %>
  <div id="article-header">
    <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %>
    <%= article_title(@page, :no_link => true) %>
    <%= article_translations(@page) %>
  </div>
</div>


<% if !@page.tags.empty? %>
  <div id="article-tags">
    <%= _("This article's tags:") %>
    <%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tags', :id => t.name ) }.join("\n") %>
  </div>
<% end %>

<% if @page.display_hits? %>
  <div id="article-hits">
    <%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %>
  </div>
<% end %>

<% if @page.parent && !@page.parent.path.blank? %>
{'fraction_non_alphanumeric': 0.21835261771107803, 'fraction_numerical': 0.0, 'mean_word_length': 2.9042933810375673, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 203, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5817924', 'n_tokens_mistral': 3024, 'n_tokens_neox': 2818, 'n_words': 528}