aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/request/_followup.rhtml
blob: 045bcd9ba8654974c191288f402376e69bf3bb0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<div id="followup">
  <% if (incoming_message.nil? || !incoming_message.valid_to_reply_to?)
        # TRANSLATORS: This phrase completes the following sentences:
        # Request an internal review from...
        # Send a public follow up message to...
        # Send a public reply to...
        # Don't want to address your message to... ?
        name_for_followup = _("the main FOI contact at {{public_body}}", :public_body => h(OutgoingMailer.name_for_followup(@info_request, nil)))
     else
        name_for_followup = h(OutgoingMailer.name_for_followup(@info_request, incoming_message))
     end %>
    <% if @internal_review %>
        <h1><%= _('Request an internal review from {{person_or_body}}', :person_or_body => name_for_followup) %>
        </h1>
    <% elsif incoming_message.nil? || !incoming_message.valid_to_reply_to? %>
        <h2><%= _('Send a public follow up message to {{person_or_body}}', :person_or_body => name_for_followup) %>
        </h2>
    <% else %>
        <h2><%= _('Send a public reply to {{person_or_body}}', :person_or_body => name_for_followup) %>
        </h2>
    <% end %>
<% if @info_request.who_can_followup_to(incoming_message).count > 0 %>
<div id="other_recipients">
  <%= _("Don't want to address your message to {{person_or_body}}?  You can also write to:", :person_or_body => name_for_followup) %>
  <ul>
<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id|  %>
   <% if id.nil? && !incoming_message.nil? && incoming_message.valid_to_reply_to? %>
     <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
   <% else %>
     <% if !id.nil? %>
      <% if @info_request.public_body.request_email == email %>
       <% if !incoming_message.nil? %>
        <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
       <% end %>
      <% else %>
        <li><%= link_to name, show_response_url(:id => @info_request.id, :incoming_message_id => id)%></li>
      <% end %>
     <% else %>
       <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
     <% end %>
   <% end %>

<% end %>
</ul>
</div>
<% end %>
    <% if @info_request.allow_new_responses_from == 'nobody' %>
        <p><%= _('Follow ups and new responses to this request have been stopped to prevent spam. Please <a href="{{url}}">contact us</a> if you are {{user_link}} and need to send a follow up.',:user_link=>user_link(@info_request.user), :url=>help_contact_path) %></p>
    <% else %>
        <% if @internal_review %>
            <p>
            <%= raw(_('If you are dissatisfied by the response you got from
            the public authority, you have the right to
            complain (<a href="%s">details</a>).') % "http://foiwiki.com/foiwiki/index.php/Internal_reviews") %>
            </p>
        <% end %>

        <p>
    <%= _('Please <strong>only</strong> write messages directly relating to your request {{request_link}}. If you would like to ask for information that was not in your original request, then <a href="{{new_request_link}}">file a new request</a>.', :request_link=>request_link(@info_request), :new_request_link => new_request_to_body_url(:url_name => @info_request.public_body.url_name)) %>
        </p>

        <% status = @info_request.calculate_status %>
        <% if status == 'waiting_response_overdue' %>
            <p><%= _('The response to your request has been <strong>delayed</strong>.  You can say that, 
            by law, the authority should normally have responded
            <strong>promptly</strong> and') %>
            <% if @info_request.public_body.is_school? %>
            <%= _('in term time') %>
            <% end %>
            <%= _('by <strong>{{date}}</strong>',:date=>simple_date(@info_request.date_response_required_by)) %>
            (<%= raw(_('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"]) %>).

            </p>
        <% elsif status == 'waiting_response_very_overdue' %>
            <p>
            <%= _('The response to your request is <strong>long overdue</strong>.   You can say that, by 
            law, under all circumstances, the authority should have responded
            by now') %> (<%= raw(_('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"]) %>).
            </p>
        <% end %>

        <% form_for(:outgoing_message, @outgoing_message, :html => { :id => 'followup_form' }, :url => incoming_message.nil? ? show_response_no_followup_url(:id => @info_request.id) : show_response_url(:id => @info_request.id, :incoming_message_id => incoming_message.id)) do |o| %>
            <p>
                <%= o.text_area :body, :rows => 15, :cols => 55 %>
            </p>

            <% if @internal_review %>
                <%= hidden_field_tag "outgoing_message[what_doing]", "internal_review" %>
            <% else %>
                <h3><%= _('What are you doing?') %></h3>

                <% if !@outgoing_message.errors[:what_doing_dummy].nil? %>
                    <div class="fieldWithErrors">
                <% else %>
                    <div>
                <% end %>
                    <!--
                    <div>
                        <%= radio_button "outgoing_message", "what_doing", "new_information", :id => "new_information" %>
                        <label for="new_information"><%= _('I am asking for <strong>new information</strong>') %> </label>
                    </div>
                    -->
                    <div>
                        <%= radio_button "outgoing_message", "what_doing", "internal_review", :id => "internal_review" %>
                        <label for="internal_review"><%= _('I am requesting an <strong>internal review</strong>') %>
            <%= raw(_('<a href="%s">what\'s that?</a>') % ["/help/unhappy"]) %>
                        </label>
                    </div>
                    <div>
                        <%= radio_button "outgoing_message", "what_doing", "normal_sort", :id => "sort_normal" %>
                        <label for="sort_normal"><%= _('<strong>Anything else</strong>, such as clarifying, prompting, thanking') %></label>
                    </div>
                </div>
            <% end %>

            <% if @internal_review %>
                <p><%= _('Edit and add <strong>more details</strong> to the message above,
                explaining why you are dissatisfied with their response.') %>
                </p>
            <% end %>

            <p>
                <%= hidden_field_tag 'submitted_followup', 1 %>
                <%= hidden_field_tag(:preview, 1 ) %>
                <% if @internal_review_pass_on %>
                    <%= hidden_field_tag(:internal_review, 1 ) %>
                <% end %>
                <%= submit_tag _("Preview your message") %>
            </p>
        <% end %>

        <p>
            <% if not @is_owning_user %>
            (You will be asked to sign in as <%= user_link(@info_request.user) %>)
            <% end %>
        </p>
    <% end %>

</div>