<commit_before><% @title = h(@info_request.title) %>

<% if @info_request.awaiting_description %>
    <div class="describe_state_form">
    <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>
    </div>
<% end %>

<div id="request_main">
    <h1><%=@title%></h1>

    <p class="subtitle">A Freedom of Information request to 
    <%= public_body_link(@info_request.public_body) %>
    by 
    <%= user_link(@info_request.user) %>
    </p>

    <p id="request_status">
    <% if @info_request.awaiting_description %>
        <% if @is_owning_user %>
            Please <strong>answer the question above</strong> so we know whether the 
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
        <% else %>
            This request has an <strong>unknown status</strong>. We're waiting for
            <%= user_link(@info_request.user) %> to read 
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> 
            and update the status.
        <% end %>
    <% elsif @status == 'waiting_response' %>
        Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>,
        due by <strong><%= simple_date(@info_request.date_response_required_by) %></strong>.
    <% elsif @status == 'waiting_response_overdue' %>
        Currently <strong>overdue a response</strong> from <%=
        public_body_link(@info_request.public_body) %>. The 
        <%= link_to "response was due", about_url + "#quickly_response" %>
        on <strong><%= simple_date(@info_request.date_response_required_by) %></strong>.
    <% elsif @status == 'not_held' %>
        <%= public_body_link(@info_request.public_body) %> <strong>did not have</strong> the information requested.
    <% elsif @status == 'rejected' %>
        The request was <strong>rejected</strong> by <%= public_body_link(@info_request.public_body) %>.
    <% elsif @status == 'successful' %>
        The request was <strong>successful</strong>.
    <% elsif @status == 'partially_successful' %>
        The request was <strong>partially successful</strong>.
    <% elsif @status == 'waiting_clarification' %>
        <% if @is_owning_user %>
            <%=h @info_request.public_body.name %> is <strong>waiting for your clarification</strong>. 
            Please
            <%= link_to "send a follow up message", show_response_url(:id => @info_request.id, :incoming_message_id => @info_request.get_last_response.id) + "#show_response_followup" %>.
        <% else %>
            The request is <strong>waiting for clarification</strong>. 
            If you are
            <%= user_link(@info_request.user) %>, please
            <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
        <% end %>
    <% elsif @status == 'requires_admin' %>
        This request has had an unusual response, and <strong>requires attention</strong> from the WhatDoTheyKnow team.
    <% else %>
        <% raise "unknown status " + @status %>
    <% end %>
    </p>

    <% for info_request_event in @info_request_events %>
        <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %>
    <% end %>
</div>

<div id="request_sidebar">
    <h2>People tracking this request</h2>
    <% if @info_request.track_things.size > 0 %>
        <ul>
        <% for track_thing in @info_request.track_things %>
            <li><%=user_link(track_thing.tracking_user)%></li>
        <% end %>
        </ul>
        <p>
            <% if @existing_track %>
                You are already tracking this request
                (<%= link_to "alter your subscriptions", user_url(@user) %>).
            <% else %>
                <% if @info_request.user == @user %> 
                    <p>You will be emailed when there are updates to your own request.</p>
                    <p>You may also <%= link_to "get an RSS feed", track_request_url(:url_title => @info_request.url_title) %>
                    <img src="/images/feed-14.png" alt="" class="rss"></p>
                <% else %>
                    <%= link_to "Track updates to this request", track_request_url(:url_title => @info_request.url_title) %>
                    (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)
                <% end %>
            <% end %>
        </p>
    <% else %>
        <% if @info_request.user == @user %> 
            <p>You will be emailed when there are updates to your own request.</p>
            <p>You may also get an <%= link_to 'RSS feed', track_request_url(:url_title => @info_request.url_title) %>
            <img src="/images/feed-14.png" alt="" class="rss"></p>
        <% else %>
            <p>Be the first to <%= link_to "track updates to this request", track_request_url(:url_title => @info_request.url_title) %>
            (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)</p>
        <% end %>
    <% end %>

    <% if @info_requests_same_user_same_body.size > 0 %>
        <h2>Requests from same user to same authority</h2>
        <!-- <h2>Some other requests made by <%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2> -->
        <%= render :partial => 'sidebar_request_listing', :locals => { :info_requests => @info_requests_same_user_same_body } %>
        <% if @info_requests_same_user_same_body_more %>
            <p><%= link_to "More such requests", search_url(:query => "variety:sent requested_from:" + @info_request.public_body.url_name + " requested_by:" + @info_request.user.url_name + " -request:" + @info_request.url_title, :sortby => "newest") %></p>
        <% end %>
    <% end %>

    <h2>Things to do about this request</h2>

    <!-- WriteToThem envelope box, start -->
    <script type="text/javascript">
        function clearDefault(el) {
          if (el.defaultValue==el.value) el.value = "";
        }
        function fillDefault(el) {
          if (el.value=="") el.value = "Your Postcode";
        }
    </script>
    <div style="width:167px;height:120px;
        background: url(http://www.writetothem.com/envelope_bg.gif) no-repeat 0 0; 
        font:9pt/11pt arial,helvetica,sans-serif;position:relative;">
        <form method="get" action="http://www.writetothem.com/">
            <div style="padding:55px 0 0 20px;">
                <label for="pc" style="display:none;">
                    Contact Your Politician
                </label>
                <input type="text" value="Your Postcode" name="pc" size="13"
                    style="width:90px;vertical-align:bottom;
                        font:8pt/11pt arial,helvetica,sans-serif;color:#666;" 
                    onfocus="clearDefault(this)" onblur="fillDefault(this)" />
                <input type="image" value="Go" style="vertical-align:bottom;" 
                    src="http://www.writetothem.com/envelope_arrow.gif" />
            </div>
        </form>
        <a href="http://www.writetothem.com/" title="Visit writetothem.com" 
        style="display:block;position:absolute;bottom:0;width:100%;overflow:hidden;
        text-indent:-1234em;height:30px;bottom:0;">writetothem.com</a>
    </div>
    <!-- WriteToThem envelope box, end-->

    <!--<h2>Blog posts about this request</h2>
    <p>...
    <h2>Wikipedia articles</h2>
    <p>...-->
</div>

<% if @info_request.awaiting_description %>
    <div class="describe_state_form">
    <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>
    </div>
<% end %>

<commit_msg>Hmm, tried Share This, but it is worrying proprietary now.<commit_after><% @title = h(@info_request.title) %>

<% if @info_request.awaiting_description %>
    <div class="describe_state_form">
    <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>
    </div>
<% end %>

<div id="request_main">
    <h1><%=@title%></h1>

    <p class="subtitle">A Freedom of Information request to 
    <%= public_body_link(@info_request.public_body) %>
    by 
    <%= user_link(@info_request.user) %>
    </p>

    <p id="request_status">
    <% if @info_request.awaiting_description %>
        <% if @is_owning_user %>
            Please <strong>answer the question above</strong> so we know whether the 
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> useful information.
        <% else %>
            This request has an <strong>unknown status</strong>. We're waiting for
            <%= user_link(@info_request.user) %> to read 
            <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> 
            and update the status.
        <% end %>
    <% elsif @status == 'waiting_response' %>
        Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>,
        due by <strong><%= simple_date(@info_request.date_response_required_by) %></strong>.
    <% elsif @status == 'waiting_response_overdue' %>
        Currently <strong>overdue a response</strong> from <%=
        public_body_link(@info_request.public_body) %>. The 
        <%= link_to "response was due", about_url + "#quickly_response" %>
        on <strong><%= simple_date(@info_request.date_response_required_by) %></strong>.
    <% elsif @status == 'not_held' %>
        <%= public_body_link(@info_request.public_body) %> <strong>did not have</strong> the information requested.
    <% elsif @status == 'rejected' %>
        The request was <strong>rejected</strong> by <%= public_body_link(@info_request.public_body) %>.
    <% elsif @status == 'successful' %>
        The request was <strong>successful</strong>.
    <% elsif @status == 'partially_successful' %>
        The request was <strong>partially successful</strong>.
    <% elsif @status == 'waiting_clarification' %>
        <% if @is_owning_user %>
            <%=h @info_request.public_body.name %> is <strong>waiting for your clarification</strong>. 
            Please
            <%= link_to "send a follow up message", show_response_url(:id => @info_request.id, :incoming_message_id => @info_request.get_last_response.id) + "#show_response_followup" %>.
        <% else %>
            The request is <strong>waiting for clarification</strong>. 
            If you are
            <%= user_link(@info_request.user) %>, please
            <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message.
        <% end %>
    <% elsif @status == 'requires_admin' %>
        This request has had an unusual response, and <strong>requires attention</strong> from the WhatDoTheyKnow team.
    <% else %>
        <% raise "unknown status " + @status %>
    <% end %>
    </p>

    <% for info_request_event in @info_request_events %>
        <%= render :partial => 'correspondence', :locals => { :info_request_event => info_request_event } %>
    <% end %>
</div>

<div id="request_sidebar">
    <h2>People tracking this request</h2>
    <% if @info_request.track_things.size > 0 %>
        <ul>
        <% for track_thing in @info_request.track_things %>
            <li><%=user_link(track_thing.tracking_user)%></li>
        <% end %>
        </ul>
        <p>
            <% if @existing_track %>
                You are already tracking this request
                (<%= link_to "alter your subscriptions", user_url(@user) %>).
            <% else %>
                <% if @info_request.user == @user %> 
                    <p>You will be emailed when there are updates to your own request.</p>
                    <p>You may also <%= link_to "get an RSS feed", track_request_url(:url_title => @info_request.url_title) %>
                    <img src="/images/feed-14.png" alt="" class="rss"></p>
                <% else %>
                    <%= link_to "Track updates to this request", track_request_url(:url_title => @info_request.url_title) %>
                    (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)
                <% end %>
            <% end %>
        </p>
    <% else %>
        <% if @info_request.user == @user %> 
            <p>You will be emailed when there are updates to your own request.</p>
            <p>You may also get an <%= link_to 'RSS feed', track_request_url(:url_title => @info_request.url_title) %>
            <img src="/images/feed-14.png" alt="" class="rss"></p>
        <% else %>
            <p>Be the first to <%= link_to "track updates to this request", track_request_url(:url_title => @info_request.url_title) %>
            (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)</p>
        <% end %>
    <% end %>

    <h2>Act on this request</h2>
    <p>
    <img src="/images/writetothem.png"> <a href="http://www.writetothem.com">Write to your politician</a> about it
    <br><img src="/images/pledgebank.png"> <a href="http://www.pledgebank.com">Pledge with others</a>
    </p>

    <% if @info_requests_same_user_same_body.size > 0 %>
        <h2>Requests from same user to same authority</h2>
        <!-- <h2>Some other requests made by <%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2> -->
        <%= render :partial => 'sidebar_request_listing', :locals => { :info_requests => @info_requests_same_user_same_body } %>
        <% if @info_requests_same_user_same_body_more %>
            <p><%= link_to "More such requests", search_url(:query => "variety:sent requested_from:" + @info_request.public_body.url_name + " requested_by:" + @info_request.user.url_name + " -request:" + @info_request.url_title, :sortby => "newest") %></p>
        <% end %>
    <% end %>

    <!--<h2>Blog posts about this request</h2>
    <p>...
    <h2>Wikipedia articles</h2>
    <p>...-->
</div>

<% if @info_request.awaiting_description %>
    <div class="describe_state_form">
    <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>
    </div>
<% end %>


{'fraction_non_alphanumeric': 0.15715292459478505, 'fraction_numerical': 0.006342494714587738, 'mean_word_length': 2.717841236573225, 'pattern_counts': {'":': 0, '<': 330, '<?xml version=': 0, '>': 376, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '5188757', 'n_tokens_mistral': 4713, 'n_tokens_neox': 4285, 'n_words': 976}