<commit_before><% page_title @organisation.name %>

<%= content_tag_for :div, @organisation, class: "hcard group" do %>
  <div class="g3f">
    <%= render 'header', organisation: @organisation %>
  </div>

  <div class="g3f">
    <div class="g2f">
      <% if @featured_news_articles.any? %>
        <section class="org_news">
          <h1>News from our office</h1>
          <section class="featured_carousel" id="featured-news-articles">
            <% @featured_news_articles.each do |news_article| %>
              <%= content_tag_for(:article, news_article) do %>
                <h2><%= link_to news_article.title, public_document_path(news_article), class: "title" %></h2>
                <p class="summary"><%= news_article.summary %></p>
                <div class="meta">
                  <span class="published_at">Posted <%= time_ago(news_article.published_at, class: 'published_at') %> ago</span>
                  <% news_article.policy_areas.uniq.each do |pa| %>
                    <%= link_to pa.name, policy_area_path(pa), class: "policy_area tag" %>
                  <% end %>
                </div>
              <% end %>
            <% end %>
          </section>
          <p class="readmore"><%= organisation_view_all_tag(@organisation, :announcements) %></p>
        </section>
      <% end %>

      <% if @policies.any? %>
        <%= article_section("Our policies", @policies, {id: 'policies', more: organisation_view_all_tag(@organisation, :policies)}) do |policy| %>
          <h2 class="article_title"><%= link_to policy.title, public_document_path(policy), title: "View #{policy.title}", class: "title" %></h2>
          <span class="metadata">
            Updated <%= time_ago(policy.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if @publications.any? %>
        <%= article_section("Publications", @publications, {id: 'publications', more: organisation_view_all_tag(@organisation, :publications)}) do |publication| %>
          <h2 class="article_title"><%= link_to publication.title, public_document_path(publication), title: "View #{publication.title}" %></h2>
          <span class="metadata">
            Updated <%= time_ago(publication.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if @consultations.any? %>
        <%= article_section("Consultations", @consultations, {id: 'consultations', more: organisation_view_all_tag(@organisation, :consultations)}) do |consultation| %>
          <h2 class="article_title"><%= link_to consultation.title, public_document_path(consultation), title: "View #{consultation.title}" %></h2>
          <span class="metadata">
            Updated <%= time_ago(consultation.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if @speeches.any? %>
        <%= article_section("Speeches", @speeches, {id: 'speeches', more: organisation_view_all_tag(@organisation, :announcements)}) do |speech| %>
          <h2 class="article_title"><%= link_to speech.title, public_document_path(speech), title: "View #{speech.title}", class: 'title' %></h2>
          <span class="metadata">
            Updated <%= time_ago(speech.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if [@featured_news_articles, @speeches, @consultations, @publications, @policies].select(&:any?).blank? %>
        <div class="g3f">
          <section class="no_content article_section">
            <h1>Content needed</h1>
            <p>At present there isn't any content to fill this page.
            <% if @organisation.url.present? %>
            Please visit <%= link_to @organisation.url, @organisation.url %> instead.
            <% end %>
            </p>
          </section>
        </div>
      <% end %>
    </div>

    <div class="g1f sidebar">
      <section id="about_us" class="info">
        <p class="about">
          <span class="description"><%= format_with_html_line_breaks(@organisation.description) %></span>
          <a href="<%= about_organisation_path(@organisation) %>" title='<%= "Further information about #{@organisation.name}" %>'>Read more<span class="visuallyhidden"> about <%= @organisation.name %></span>.</a>
        </p>
      </section>

      <% roles = [@organisation.top_ministerial_role, @organisation.top_civil_servant].compact %>
      <% if roles.any? %>
          <section id="ministers" class="info">
            <% roles.each do |role| %>
              <%= content_tag_for(:article, role) do %>
                <div class="image_holder">
                  <%= image_for_ministerial_role(role) %>
                </div>
                <h3>
                  <% if role.is_a?(MinisterialRole) %>
                    <%= link_to role.name, role %>
                  <% else %>
                    <%= role.name %>
                  <% end %>
                </h3>
                <p class="current_appointee"><%= role.current_person_name %></p>
              <% end %>
              <p class="readmore">
                <% if role.is_a?(MinisterialRole) %>
                  View all <span class="visuallyhidden"><%= @organisation.name %></span> <%= link_to 'ministers', ministers_organisation_path(@organisation) %>
                <% else %>
                  View <span class="visuallyhidden"><%= @organisation.name %></span> <%= link_to 'management team', management_team_organisation_path(@organisation) %>
                <% end %>
              </p>
            <% end %>

          </section>
      <% end %>

      <% if @organisation.child_organisations.any? %>
        <section id="child_organisations" class="info">
          <h1>Associated organisations</h1>
          <%= render partial: "organisations/list", locals: {organisations: @organisation.child_organisations} %>
        </section>
      <% end %>

      <%= render partial: "documents/policy_areas", object: @organisation.policy_areas, title: "Our policy areas" %>
    </div>
  </div>
<% end %>
<commit_msg>Org home page WIP<commit_after><% page_title @organisation.name %>

<%= content_tag_for :div, @organisation, class: "hcard group" do %>
  <div class="g3">
    <%= render 'header', organisation: @organisation %>
  </div>

  <div class="g3">
    <div class="g2">
      <% if @featured_news_articles.any? %>
        <section class="org_news">
          <h1>Top stories</h1>
          <section class="featured_carousel" id="featured-news-articles">
            <% @featured_news_articles.each do |news_article| %>
              <%= content_tag_for(:article, news_article) do %>
                <h2><%= link_to news_article.title, public_document_path(news_article), class: "title" %></h2>
                <p class="summary"><%= news_article.summary %></p>
                <div class="meta">
                  <span class="published_at">Posted <%= time_ago(news_article.published_at, class: 'published_at') %> ago</span>
                  <% news_article.policy_areas.uniq.each do |pa| %>
                    <%= link_to pa.name, policy_area_path(pa), class: "policy_area tag" %>
                  <% end %>
                </div>
              <% end %>
            <% end %>
          </section>
        </section>
      <% end %>
      
      <% roles = [@organisation.top_ministerial_role, @organisation.top_civil_servant].compact %>
      
      <% if ministerial_role = @organisation.top_ministerial_role %>
        <section id="ministers" class="g-half info">
          <h1><%= link_to 'Ministers', ministers_organisation_path(@organisation) %></h1>
          <%= content_tag_for(:article, ministerial_role) do %>
            <div class="image_holder">
              <%= image_for_ministerial_role(ministerial_role) %>
            </div>
            <h3><%= link_to ministerial_role.name, ministerial_role %></h3>
            <p class="current_appointee"><%= ministerial_role.current_person_name %></p>
          <% end %>
        </section>
      <% end %>
      <% if management_role = @organisation.top_civil_servant %>
        <section id="management" class="g-half info">
          <h1><%= link_to 'Management', management_team_organisation_path(@organisation) %></h1>
          <%= content_tag_for(:article, management_role) do %>
            <div class="image_holder">
              <%= image_for_ministerial_role(management_role) %>
            </div>
            <h3><%= management_role.name %></h3>
            <p class="current_appointee"><%= management_role.current_person_name %></p>
          <% end %>
        </section>
      <% end %>
      
      <div class="g2">
        <%= render partial: "documents/policy_areas", object: @organisation.policy_areas, title: "Our policy areas" %>
      </div>
    </div>
    <div class="g1f sidebar">
      <section id="about_us" class="info">
        <p class="about">
          <span class="description"><%= format_with_html_line_breaks(@organisation.description) %></span>
          <a href="<%= about_organisation_path(@organisation) %>" title='<%= "Further information about #{@organisation.name}" %>'>Read more<span class="visuallyhidden"> about <%= @organisation.name %></span>.</a>
        </p>
      </section>
    </div>
  </div>
    
  <div class="g3">
    <div class="g2f">
      <% if @policies.any? %>
        <%= article_section("Our policies", @policies, {id: 'policies', more: organisation_view_all_tag(@organisation, :policies)}) do |policy| %>
          <h2 class="article_title"><%= link_to policy.title, public_document_path(policy), title: "View #{policy.title}", class: "title" %></h2>
          <span class="metadata">
            Updated <%= time_ago(policy.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if @publications.any? %>
        <%= article_section("Publications", @publications, {id: 'publications', more: organisation_view_all_tag(@organisation, :publications)}) do |publication| %>
          <h2 class="article_title"><%= link_to publication.title, public_document_path(publication), title: "View #{publication.title}" %></h2>
          <span class="metadata">
            Updated <%= time_ago(publication.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if @consultations.any? %>
        <%= article_section("Consultations", @consultations, {id: 'consultations', more: organisation_view_all_tag(@organisation, :consultations)}) do |consultation| %>
          <h2 class="article_title"><%= link_to consultation.title, public_document_path(consultation), title: "View #{consultation.title}" %></h2>
          <span class="metadata">
            Updated <%= time_ago(consultation.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if @speeches.any? %>
        <%= article_section("Speeches", @speeches, {id: 'speeches', more: organisation_view_all_tag(@organisation, :announcements)}) do |speech| %>
          <h2 class="article_title"><%= link_to speech.title, public_document_path(speech), title: "View #{speech.title}", class: 'title' %></h2>
          <span class="metadata">
            Updated <%= time_ago(speech.updated_at, class: 'updated_at') %>
          </span>
        <% end %>
      <% end %>

      <% if [@featured_news_articles, @speeches, @consultations, @publications, @policies].select(&:any?).blank? %>
        <div class="g3f">
          <section class="no_content article_section">
            <h1>Content needed</h1>
            <p>At present there isn't any content to fill this page.
            <% if @organisation.url.present? %>
            Please visit <%= link_to @organisation.url, @organisation.url %> instead.
            <% end %>
            </p>
          </section>
        </div>
      <% end %>
    </div>

    <div class="g3f">
      <% if @organisation.child_organisations.any? %>
        <section id="child_organisations" class="info">
          <h1>Associated organisations</h1>
          <%= render partial: "organisations/list", locals: {organisations: @organisation.child_organisations} %>
        </section>
      <% end %>
    </div>

  </div>
<% end %>

{'fraction_non_alphanumeric': 0.16568386568386567, 'fraction_numerical': 0.004586404586404586, 'mean_word_length': 2.555911473500291, 'pattern_counts': {'":': 0, '<': 312, '<?xml version=': 0, '>': 312, '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': '7374968', 'n_tokens_mistral': 3980, 'n_tokens_neox': 3601, 'n_words': 714}