<commit_before><% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %>

<% if flash[:search_params] %>
  <div class="back-to-results">
    <div class="message">
      <%= link_to select_authority_path(flash[:search_params]) do %>
        <%= _('« Back to search results') %>
      <% end %>
    </div>
  </div>
<% end %>

<div class="authority__header">
    <h1><%=h(@public_body.name)%></h1>
    <p class="authority__header__subtitle">
        <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>,
        <%= _('also called {{public_body_short_name}}', :public_body_short_name =>  h(@public_body.short_name))%><% end %>
        <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to _("admin"), admin_body_path(@public_body) %>)
        <% end %>
    </p>

    <div id="stepwise_make_request">
      <% if @public_body.has_notes? %>
        <p class="authority__header__notes">
          <%= @public_body.notes_as_html.html_safe %>
        </p>
      <% end %>

      <% if @public_body.is_requestable? %>
        <% if @public_body.eir_only? %>
          <p class="authority__header__notes">
            <%= _('You can only request information about the environment from this authority.')%>
          </p>
        <% end %>

        <%= link_to _("Make a request to this authority"),
                    new_request_to_body_path(:url_name => @public_body.url_name),
                    :class => "link_button_green" %>
      <% else %>
        <p class="authority__header__notes">
          <%= public_body_not_requestable_reasons(@public_body).first %>
        </p>
      <% end %>
    </div>

    <% if @public_body.info_requests.size > 0 %>
        <div class="authority__header__stats">
            <%= n_('{{count}} request',
                '{{count}} requests',
                @public_body.info_requests.size,
                :count => @public_body.info_requests.size) %>
        </div>
    <% end %>
    <div class="authority__header__action-bar">
        <div class="action-bar__make-request">
            <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
                <%= link_to _("Make a request to this authority"), new_request_to_body_path(:url_name => @public_body.url_name), :class => "link_button_green" %>
            <% elsif @public_body.has_notes? %>
                <%= @public_body.notes_as_html.html_safe %>
            <% end %>

        <div class="action-bar__follow">
            <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %>
            <div class="action-bar__follow-button">
              <% if @existing_track %>
                  <%= @track_thing.params[:verb_on_page_already] %>
                <%= (link_to _("(unsubscribe)"), {:controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath}) %>
              <% else %>
                  <div class="feed_link">
                      <%= link_to _("Follow"), do_track_path(@track_thing), :class => "link_button_green" %>
                  </div>
              <% end %>

            </div>
            <div class="action-bar__follower-count">
                <%= n_("{{count}} follower",
                    "{{count}} followers",
                    follower_count,
                    :count => content_tag(:span, follower_count, :id => "follow_count")) %>
            </div>
        </div>
    </div>
</div>






<div class="authority__body">
    <div class="authority__body__foi-results">
        <% if @public_body.info_requests.size == 0 %>
            <% if @public_body.is_requestable? or @public_body.not_requestable_reason != 'defunct' %>
                <% if @public_body.eir_only? %>
                    <h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
                    <p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p>
                <% else %>
                    <h2><%= _('Freedom of Information requests made using this site')%></h2>
                    <p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p>
                <% end %>
            <% end %>
        <% else %>
            <h2 class="foi_results">
            <% if @public_body.eir_only? %>
                <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %>
            <% end %>
            <%= @page_desc %>
            </h2>
            <a name="results"></a>

            <% if  @public_body.info_requests.size > 4 %>
                <%= render :partial => 'request/request_filter_form' %>
            <% end %>
        <% end %>

        <% if !@xapian_requests.nil? %>

            <% for result in @xapian_requests.results %>
                <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %>
            <% end %>

            <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %>

            <% if @xapian_requests.results.empty? %>
                <p><% _('There were no requests matching your query.') %></p>
            <% else %>
                  <p>
                    <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %>
                    <%= link_to _('?'), help_about_path %>
                  </p><commit_msg>Remove eir header, only display h2 if it has contents.<commit_after><% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %>

<% if flash[:search_params] %>
  <div class="back-to-results">
    <div class="message">
      <%= link_to select_authority_path(flash[:search_params]) do %>
        <%= _('« Back to search results') %>
      <% end %>
    </div>
  </div>
<% end %>

<div class="authority__header">
    <h1><%=h(@public_body.name)%></h1>
    <p class="authority__header__subtitle">
        <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>,
        <%= _('also called {{public_body_short_name}}', :public_body_short_name =>  h(@public_body.short_name))%><% end %>
        <% if !@user.nil? && @user.admin_page_links? %>
        (<%= link_to _("admin"), admin_body_path(@public_body) %>)
        <% end %>
    </p>

    <div id="stepwise_make_request">
      <% if @public_body.has_notes? %>
        <p class="authority__header__notes">
          <%= @public_body.notes_as_html.html_safe %>
        </p>
      <% end %>

      <% if @public_body.is_requestable? %>
        <% if @public_body.eir_only? %>
          <p class="authority__header__notes">
            <%= _('You can only request information about the environment from this authority.')%>
          </p>
        <% end %>

        <%= link_to _("Make a request to this authority"),
                    new_request_to_body_path(:url_name => @public_body.url_name),
                    :class => "link_button_green" %>
      <% else %>
        <p class="authority__header__notes">
          <%= public_body_not_requestable_reasons(@public_body).first %>
        </p>
      <% end %>
    </div>

    <% if @public_body.info_requests.size > 0 %>
        <div class="authority__header__stats">
            <%= n_('{{count}} request',
                '{{count}} requests',
                @public_body.info_requests.size,
                :count => @public_body.info_requests.size) %>
        </div>
    <% end %>
    <div class="authority__header__action-bar">
        <div class="action-bar__make-request">
            <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
                <%= link_to _("Make a request to this authority"), new_request_to_body_path(:url_name => @public_body.url_name), :class => "link_button_green" %>
            <% elsif @public_body.has_notes? %>
                <%= @public_body.notes_as_html.html_safe %>
            <% end %>

        <div class="action-bar__follow">
            <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %>
            <div class="action-bar__follow-button">
              <% if @existing_track %>
                  <%= @track_thing.params[:verb_on_page_already] %>
                <%= (link_to _("(unsubscribe)"), {:controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath}) %>
              <% else %>
                  <div class="feed_link">
                      <%= link_to _("Follow"), do_track_path(@track_thing), :class => "link_button_green" %>
                  </div>
              <% end %>

            </div>
            <div class="action-bar__follower-count">
                <%= n_("{{count}} follower",
                    "{{count}} followers",
                    follower_count,
                    :count => content_tag(:span, follower_count, :id => "follow_count")) %>
            </div>
        </div>
    </div>
</div>






<div class="authority__body">
    <div class="authority__body__foi-results">
        <% if @public_body.info_requests.size == 0 %>
            <% if @public_body.is_requestable? or @public_body.not_requestable_reason != 'defunct' %>
                <% if @public_body.eir_only? %>
                    <h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
                    <p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p>
                <% else %>
                    <h2><%= _('Freedom of Information requests made using this site')%></h2>
                    <p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p>
                <% end %>
            <% end %>
        <% else %>
            <% unless @page_desc.blank? %>
              <h2 class="foi_results">
                <%= @page_desc %>
              </h2>
            <% end %>
            <a name="results"></a>

            <% if  @public_body.info_requests.size > 4 %>
                <%= render :partial => 'request/request_filter_form' %>
            <% end %>
        <% end %>

        <% if !@xapian_requests.nil? %>

            <% for result in @xapian_requests.results %>
                <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %>
            <% end %>

            <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %>

            <% if @xapian_requests.results.empty? %>
                <p><% _('There were no requests matching your query.') %></p>
            <% else %>
                  <p>
                    <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %>
                    <%= link_to _('?'), help_about_path %>
                  </p>
{'fraction_non_alphanumeric': 0.16146479872317787, 'fraction_numerical': 0.002039368682390495, 'mean_word_length': 2.141782729805014, 'pattern_counts': {'":': 0, '<': 240, '<?xml version=': 0, '>': 286, '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': '7372673', 'n_tokens_mistral': 3675, 'n_tokens_neox': 3293, 'n_words': 641}