From 835b51c1de0d49e652fe9c9a60f0974275de070c Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Wed, 27 Feb 2013 10:34:47 +1100 Subject: Rename ALL THE TEMPLATES!!1!!!one!!1!! .rhtml is deprecated in favour of .erb in Rails 3 --- .../_incoming_message_actions.html.erb | 26 +++ .../admin_request/_incoming_message_actions.rhtml | 26 --- app/views/admin_request/_some_requests.html.erb | 31 +++ app/views/admin_request/_some_requests.rhtml | 31 --- app/views/admin_request/_tags.html.erb | 8 + app/views/admin_request/_tags.rhtml | 8 - app/views/admin_request/edit.html.erb | 63 ++++++ app/views/admin_request/edit.rhtml | 63 ------ app/views/admin_request/edit_comment.html.erb | 22 ++ app/views/admin_request/edit_comment.rhtml | 22 -- app/views/admin_request/edit_outgoing.html.erb | 33 +++ app/views/admin_request/edit_outgoing.rhtml | 33 --- .../admin_request/hidden_user_explanation.html.erb | 9 + .../admin_request/hidden_user_explanation.rhtml | 9 - app/views/admin_request/list.html.erb | 15 ++ app/views/admin_request/list.rhtml | 15 -- .../admin_request/list_old_unclassified.html.erb | 16 ++ .../admin_request/list_old_unclassified.rhtml | 16 -- app/views/admin_request/show.html.erb | 230 +++++++++++++++++++++ app/views/admin_request/show.rhtml | 230 --------------------- app/views/admin_request/show_raw_email.html.erb | 37 ++++ app/views/admin_request/show_raw_email.rhtml | 37 ---- 22 files changed, 490 insertions(+), 490 deletions(-) create mode 100644 app/views/admin_request/_incoming_message_actions.html.erb delete mode 100644 app/views/admin_request/_incoming_message_actions.rhtml create mode 100644 app/views/admin_request/_some_requests.html.erb delete mode 100644 app/views/admin_request/_some_requests.rhtml create mode 100644 app/views/admin_request/_tags.html.erb delete mode 100644 app/views/admin_request/_tags.rhtml create mode 100644 app/views/admin_request/edit.html.erb delete mode 100644 app/views/admin_request/edit.rhtml create mode 100644 app/views/admin_request/edit_comment.html.erb delete mode 100644 app/views/admin_request/edit_comment.rhtml create mode 100644 app/views/admin_request/edit_outgoing.html.erb delete mode 100644 app/views/admin_request/edit_outgoing.rhtml create mode 100644 app/views/admin_request/hidden_user_explanation.html.erb delete mode 100644 app/views/admin_request/hidden_user_explanation.rhtml create mode 100644 app/views/admin_request/list.html.erb delete mode 100644 app/views/admin_request/list.rhtml create mode 100644 app/views/admin_request/list_old_unclassified.html.erb delete mode 100644 app/views/admin_request/list_old_unclassified.rhtml create mode 100644 app/views/admin_request/show.html.erb delete mode 100644 app/views/admin_request/show.rhtml create mode 100644 app/views/admin_request/show_raw_email.html.erb delete mode 100644 app/views/admin_request/show_raw_email.rhtml (limited to 'app/views/admin_request') diff --git a/app/views/admin_request/_incoming_message_actions.html.erb b/app/views/admin_request/_incoming_message_actions.html.erb new file mode 100644 index 000000000..3090185e2 --- /dev/null +++ b/app/views/admin_request/_incoming_message_actions.html.erb @@ -0,0 +1,26 @@ +<%= form_tag '../redeliver_incoming' do %> +
+ id or url_title of request (or a list of requests, comma-separated): + <% if @info_requests && @info_requests.size == 1 %> + <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %> + <% else %> + <%= text_field_tag 'url_title', "", { :size => 20 } %> + <% end %> + <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %> + <%= submit_tag "Redeliver to another request" %> +
+<% end %> + +

+<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + incoming_message.info_request.id.to_s + "?incoming_message_id=" + incoming_message.id.to_s %> +

+ +<%= form_tag '../destroy_incoming' do %> +
+ <%= hidden_field_tag 'incoming_message_id', incoming_message.id %> + Warning, this is permanent! ---> + <%= submit_tag "Destroy message" %> +
+<% end %> + + diff --git a/app/views/admin_request/_incoming_message_actions.rhtml b/app/views/admin_request/_incoming_message_actions.rhtml deleted file mode 100644 index 3090185e2..000000000 --- a/app/views/admin_request/_incoming_message_actions.rhtml +++ /dev/null @@ -1,26 +0,0 @@ -<%= form_tag '../redeliver_incoming' do %> -
- id or url_title of request (or a list of requests, comma-separated): - <% if @info_requests && @info_requests.size == 1 %> - <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %> - <% else %> - <%= text_field_tag 'url_title', "", { :size => 20 } %> - <% end %> - <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %> - <%= submit_tag "Redeliver to another request" %> -
-<% end %> - -

-<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + incoming_message.info_request.id.to_s + "?incoming_message_id=" + incoming_message.id.to_s %> -

- -<%= form_tag '../destroy_incoming' do %> -
- <%= hidden_field_tag 'incoming_message_id', incoming_message.id %> - Warning, this is permanent! ---> - <%= submit_tag "Destroy message" %> -
-<% end %> - - diff --git a/app/views/admin_request/_some_requests.html.erb b/app/views/admin_request/_some_requests.html.erb new file mode 100644 index 000000000..dc11e0f55 --- /dev/null +++ b/app/views/admin_request/_some_requests.html.erb @@ -0,0 +1,31 @@ + + + + + + <% for column in InfoRequest.content_columns.map { |c| c.human_name } - [ "Url title", "Title" ] %> + + <% end %> + + +<% for info_request in info_requests %> + + + + <% if info_request.is_external? %> + <% if info_request.external_user_name.nil? %> + + <% else %> + + <% end %> + <% else %> + + <% end %> + <% for column in InfoRequest.content_columns.map { |c| c.name } - [ "title", "url_title" ] %> + + <% end %> + +<% end %> +
TitleAuthorityUser<%= column %>
<%= request_both_links(info_request) %><%= public_body_both_links(info_request.public_body) %><%= _("Anonymous user") %><%= h(info_request.external_user_name) %><%= user_both_links(info_request.user) %><%=h info_request.send(column) %>
+ + diff --git a/app/views/admin_request/_some_requests.rhtml b/app/views/admin_request/_some_requests.rhtml deleted file mode 100644 index dc11e0f55..000000000 --- a/app/views/admin_request/_some_requests.rhtml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - <% for column in InfoRequest.content_columns.map { |c| c.human_name } - [ "Url title", "Title" ] %> - - <% end %> - - -<% for info_request in info_requests %> - - - - <% if info_request.is_external? %> - <% if info_request.external_user_name.nil? %> - - <% else %> - - <% end %> - <% else %> - - <% end %> - <% for column in InfoRequest.content_columns.map { |c| c.name } - [ "title", "url_title" ] %> - - <% end %> - -<% end %> -
TitleAuthorityUser<%= column %>
<%= request_both_links(info_request) %><%= public_body_both_links(info_request.public_body) %><%= _("Anonymous user") %><%= h(info_request.external_user_name) %><%= user_both_links(info_request.user) %><%=h info_request.send(column) %>
- - diff --git a/app/views/admin_request/_tags.html.erb b/app/views/admin_request/_tags.html.erb new file mode 100644 index 000000000..22fbf13c8 --- /dev/null +++ b/app/views/admin_request/_tags.html.erb @@ -0,0 +1,8 @@ +<% for t in info_request.tags %> + <% if t.value %> + <%=h t.name %>:<%=h t.value %> + <% else %> + <%=h t.name %> + <% end %> +<% end %> + diff --git a/app/views/admin_request/_tags.rhtml b/app/views/admin_request/_tags.rhtml deleted file mode 100644 index 22fbf13c8..000000000 --- a/app/views/admin_request/_tags.rhtml +++ /dev/null @@ -1,8 +0,0 @@ -<% for t in info_request.tags %> - <% if t.value %> - <%=h t.name %>:<%=h t.value %> - <% else %> - <%=h t.name %> - <% end %> -<% end %> - diff --git a/app/views/admin_request/edit.html.erb b/app/views/admin_request/edit.html.erb new file mode 100644 index 000000000..900947321 --- /dev/null +++ b/app/views/admin_request/edit.html.erb @@ -0,0 +1,63 @@ +

Edit basic details of request

+ +<%= error_messages_for 'info_request' %> + +<%= form_tag '../update/' + @info_request.id.to_s do %> + +

(warning: editing this will break URLs right now)
+ <%= text_field 'info_request', 'title', :size => 50 %>

+ +

+ <%= select( 'info_request', "prominence", [ "normal", "backpage", "requester_only", "hidden" ]) %> + (backpage means hidden from lists/search; hidden means completely hidden; super users can see anything) +

+ +

+ + <%= select( 'info_request', "allow_new_responses_from", [ "anybody", "authority_only", "nobody" ] ) %>; + + <%= select( 'info_request', "handle_rejected_responses", [ "bounce", "holding_pen", "blackhole" ] ) %> +
+ ('authority_only' means email From: domain of authority request email or any domain that has previously sent a response; 'nobody' also stops requester making followups; take care when using 'blackhole' which just drops mail) +

+ +

+ <%= select( 'info_request', "described_state", InfoRequest.enumerate_states ) %>; + + <%= select('info_request', "awaiting_description", [["Yes - needs state updating",true],["No - state is up to date",false]]) %> +
(don't forget to change 'awaiting description' when you set described state)
+

+ +

+ <%= select('info_request', "comments_allowed", [["Yes – comments allowed", true], ["No – comments disabled", false]]) %> +

+ +


+ <%= text_field 'info_request', 'tag_string', :size => 60 %>

+ +

<%= submit_tag 'Save changes', :accesskey => 's' %> +

+ +

Note: To edit the actual request body text, click edit + next to the specific outgoing message. +

+ +<% end %> + +

+<%= link_to 'Show', '../show/' + @info_request.id.to_s %> | +<%= link_to 'List all', '../list' %> +

+ +
+ +<%= form_tag '../destroy/' + @info_request.id.to_s do %> +

+ This is permanent and irreversible! <%= submit_tag 'Destroy request entirely' %> +
Use it mainly if someone posts private information, e.g. made a Data Protection request. It + destroys all responses and tracks as well. +

+ +<% end %> + +
diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml deleted file mode 100644 index 900947321..000000000 --- a/app/views/admin_request/edit.rhtml +++ /dev/null @@ -1,63 +0,0 @@ -

Edit basic details of request

- -<%= error_messages_for 'info_request' %> - -<%= form_tag '../update/' + @info_request.id.to_s do %> - -

(warning: editing this will break URLs right now)
- <%= text_field 'info_request', 'title', :size => 50 %>

- -

- <%= select( 'info_request', "prominence", [ "normal", "backpage", "requester_only", "hidden" ]) %> - (backpage means hidden from lists/search; hidden means completely hidden; super users can see anything) -

- -

- - <%= select( 'info_request', "allow_new_responses_from", [ "anybody", "authority_only", "nobody" ] ) %>; - - <%= select( 'info_request', "handle_rejected_responses", [ "bounce", "holding_pen", "blackhole" ] ) %> -
- ('authority_only' means email From: domain of authority request email or any domain that has previously sent a response; 'nobody' also stops requester making followups; take care when using 'blackhole' which just drops mail) -

- -

- <%= select( 'info_request', "described_state", InfoRequest.enumerate_states ) %>; - - <%= select('info_request', "awaiting_description", [["Yes - needs state updating",true],["No - state is up to date",false]]) %> -
(don't forget to change 'awaiting description' when you set described state)
-

- -

- <%= select('info_request', "comments_allowed", [["Yes – comments allowed", true], ["No – comments disabled", false]]) %> -

- -


- <%= text_field 'info_request', 'tag_string', :size => 60 %>

- -

<%= submit_tag 'Save changes', :accesskey => 's' %> -

- -

Note: To edit the actual request body text, click edit - next to the specific outgoing message. -

- -<% end %> - -

-<%= link_to 'Show', '../show/' + @info_request.id.to_s %> | -<%= link_to 'List all', '../list' %> -

- -
- -<%= form_tag '../destroy/' + @info_request.id.to_s do %> -

- This is permanent and irreversible! <%= submit_tag 'Destroy request entirely' %> -
Use it mainly if someone posts private information, e.g. made a Data Protection request. It - destroys all responses and tracks as well. -

- -<% end %> - -
diff --git a/app/views/admin_request/edit_comment.html.erb b/app/views/admin_request/edit_comment.html.erb new file mode 100644 index 000000000..2152ee72f --- /dev/null +++ b/app/views/admin_request/edit_comment.html.erb @@ -0,0 +1,22 @@ +

Edit annotation

+ +<%= error_messages_for 'comment' %> + +<%= form_tag '../update_comment/' + @comment.id.to_s do %> + +


+ <%= text_area 'comment', 'body', :rows => 10, :cols => 60 %>

+ +

+ <%= select('comment', "visible", [["Yes - show comment",true],["No - hide comment",false]]) %> +

+ + +

<%= submit_tag 'Save', :accesskey => 's' %>

+<% end %> + +

+<%= link_to 'Show', '../show/' + @comment.info_request.id.to_s %> | +<%= link_to 'List all', '../list' %> +

+ diff --git a/app/views/admin_request/edit_comment.rhtml b/app/views/admin_request/edit_comment.rhtml deleted file mode 100644 index 2152ee72f..000000000 --- a/app/views/admin_request/edit_comment.rhtml +++ /dev/null @@ -1,22 +0,0 @@ -

Edit annotation

- -<%= error_messages_for 'comment' %> - -<%= form_tag '../update_comment/' + @comment.id.to_s do %> - -


- <%= text_area 'comment', 'body', :rows => 10, :cols => 60 %>

- -

- <%= select('comment', "visible", [["Yes - show comment",true],["No - hide comment",false]]) %> -

- - -

<%= submit_tag 'Save', :accesskey => 's' %>

-<% end %> - -

-<%= link_to 'Show', '../show/' + @comment.info_request.id.to_s %> | -<%= link_to 'List all', '../list' %> -

- diff --git a/app/views/admin_request/edit_outgoing.html.erb b/app/views/admin_request/edit_outgoing.html.erb new file mode 100644 index 000000000..f749eac7b --- /dev/null +++ b/app/views/admin_request/edit_outgoing.html.erb @@ -0,0 +1,33 @@ +

Edit outgoing message

+ +<%= error_messages_for 'outgoing_message' %> + +<%= form_tag '../update_outgoing/' + @outgoing_message.id.to_s do %> + +


+ <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %>

+ +

Note: This is mainly to be used to excise information + that users inadvertently put in their messages, not realising it would be + public. It will already have been sent to the public authority, and their + reply may also include that information and be automatically published on + this site. You could also use this to edit a message before resending it, but + only the edited version will be shown on the public page if you do that.

+ +

<%= submit_tag 'Save', :accesskey => 's' %>

+<% end %> + +

+<%= link_to 'Show', '../show/' + @outgoing_message.info_request.id.to_s %> | +<%= link_to 'List all', '../list' %> +

+ +<%= form_tag '../destroy_outgoing' do %> +
+ <%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %> + Warning, this is permanent! ---> + <%= submit_tag "Destroy outgoing message" %> +
+<% end %> + + diff --git a/app/views/admin_request/edit_outgoing.rhtml b/app/views/admin_request/edit_outgoing.rhtml deleted file mode 100644 index f749eac7b..000000000 --- a/app/views/admin_request/edit_outgoing.rhtml +++ /dev/null @@ -1,33 +0,0 @@ -

Edit outgoing message

- -<%= error_messages_for 'outgoing_message' %> - -<%= form_tag '../update_outgoing/' + @outgoing_message.id.to_s do %> - -


- <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %>

- -

Note: This is mainly to be used to excise information - that users inadvertently put in their messages, not realising it would be - public. It will already have been sent to the public authority, and their - reply may also include that information and be automatically published on - this site. You could also use this to edit a message before resending it, but - only the edited version will be shown on the public page if you do that.

- -

<%= submit_tag 'Save', :accesskey => 's' %>

-<% end %> - -

-<%= link_to 'Show', '../show/' + @outgoing_message.info_request.id.to_s %> | -<%= link_to 'List all', '../list' %> -

- -<%= form_tag '../destroy_outgoing' do %> -
- <%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %> - Warning, this is permanent! ---> - <%= submit_tag "Destroy outgoing message" %> -
-<% end %> - - diff --git a/app/views/admin_request/hidden_user_explanation.html.erb b/app/views/admin_request/hidden_user_explanation.html.erb new file mode 100644 index 000000000..64387ffee --- /dev/null +++ b/app/views/admin_request/hidden_user_explanation.html.erb @@ -0,0 +1,9 @@ +Dear <%= name_to %>, + +Your request '<%= info_request.title %>' at <%= info_request_url %> has been reviewed by moderators. + +We consider it <% if reason == 'not_foi' %>is not a valid FOI request<% else %>to be vexatious<% end%>, and have therefore hidden it from other users. You will still be able to view it while logged in to the site. Please reply to this email if you would like to discuss this decision further. + +Yours, + +The <%= site_name %> team. diff --git a/app/views/admin_request/hidden_user_explanation.rhtml b/app/views/admin_request/hidden_user_explanation.rhtml deleted file mode 100644 index 64387ffee..000000000 --- a/app/views/admin_request/hidden_user_explanation.rhtml +++ /dev/null @@ -1,9 +0,0 @@ -Dear <%= name_to %>, - -Your request '<%= info_request.title %>' at <%= info_request_url %> has been reviewed by moderators. - -We consider it <% if reason == 'not_foi' %>is not a valid FOI request<% else %>to be vexatious<% end%>, and have therefore hidden it from other users. You will still be able to view it while logged in to the site. Please reply to this email if you would like to discuss this decision further. - -Yours, - -The <%= site_name %> team. diff --git a/app/views/admin_request/list.html.erb b/app/views/admin_request/list.html.erb new file mode 100644 index 000000000..ae95cb5ad --- /dev/null +++ b/app/views/admin_request/list.html.erb @@ -0,0 +1,15 @@ +<% @title = 'Listing FOI/EIR requests' %> + +

<%=@title%>

+ +<%= form_tag("", :method => "get") do %> +

+ <%= text_field_tag 'query', params[:query], { :size => 30 } %> + <%= submit_tag "Search" %> (substring search, titles only) +

+<% end %> + +<%= render :partial => 'some_requests', :locals => { :info_requests => @info_requests } %> + +<%= will_paginate(@info_requests) %> + diff --git a/app/views/admin_request/list.rhtml b/app/views/admin_request/list.rhtml deleted file mode 100644 index ae95cb5ad..000000000 --- a/app/views/admin_request/list.rhtml +++ /dev/null @@ -1,15 +0,0 @@ -<% @title = 'Listing FOI/EIR requests' %> - -

<%=@title%>

- -<%= form_tag("", :method => "get") do %> -

- <%= text_field_tag 'query', params[:query], { :size => 30 } %> - <%= submit_tag "Search" %> (substring search, titles only) -

-<% end %> - -<%= render :partial => 'some_requests', :locals => { :info_requests => @info_requests } %> - -<%= will_paginate(@info_requests) %> - diff --git a/app/views/admin_request/list_old_unclassified.html.erb b/app/views/admin_request/list_old_unclassified.html.erb new file mode 100644 index 000000000..2e75c2174 --- /dev/null +++ b/app/views/admin_request/list_old_unclassified.html.erb @@ -0,0 +1,16 @@ +<% @title = "Unclassified responses" %> + +

<%=@title%>

+ +

Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response:

+ +<%= will_paginate(@info_requests) %> + + diff --git a/app/views/admin_request/list_old_unclassified.rhtml b/app/views/admin_request/list_old_unclassified.rhtml deleted file mode 100644 index 2e75c2174..000000000 --- a/app/views/admin_request/list_old_unclassified.rhtml +++ /dev/null @@ -1,16 +0,0 @@ -<% @title = "Unclassified responses" %> - -

<%=@title%>

- -

Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response:

- -<%= will_paginate(@info_requests) %> - - diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb new file mode 100644 index 000000000..3dd39347b --- /dev/null +++ b/app/views/admin_request/show.html.erb @@ -0,0 +1,230 @@ +<% @title = "FOI request - " + h(@info_request.title) %> +<%= javascript_include_tag :defaults %> + +

<%=@title%>

+ +<%= form_tag '../move_request', { :class => "inline" } do %> +

+<%= hidden_field_tag 'info_request_id', @info_request.id %> +<% for column in InfoRequest.content_columns %> + <%= column.human_name %>: <%=h @info_request.send(column.name) %> + <% if column.name == 'described_state' %> + Calculated status: <%= @info_request.calculate_status %> +
Initial request last sent at: <%=@info_request.date_initial_request_last_sent_at.to_date %> + Date response required by: <%= @info_request.date_response_required_by %> + Very overdue after: <%= @info_request.date_very_overdue_after %> + <% end %> + <% if ![ 'allow_new_responses_from' ].include?(column.name) %> +
+ <% end %> +<% end %> + Created by: + <% if @info_request.is_external? %> + <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API) + <% else %> + <%= user_both_links(@info_request.user) %> + <% end %> + + + + (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>) + + + url_name of new user: + <%= text_field_tag 'user_url_name', "", { :size => 20 } %> + <%= submit_tag "Move request to user" %> + + +
+Public authority: <%= public_body_both_links(@info_request.public_body) %> + + + (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>) + + + url_name of new authority: + <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %> + <%= submit_tag "Move request to authority" %> + + +
+Incoming email address: <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %>
+Tags: <%= render :partial => 'tags', :locals => { :info_request => @info_request} %>
+

+<% end %> + +

+ <%= link_to 'Public page', main_url(request_url(@info_request)) %> + | <%= link_to 'Edit', '../edit/' + @info_request.id.to_s %> + | <%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s %> (see also links on incoming messages below) +

+ +

Events

+ + + + + <% for column in InfoRequestEvent.content_columns %> + + <% end %> + + + +<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %> + + + <% for column in InfoRequestEvent.content_columns %> + + <% end %> + + +<% end %> +
Id<%= column.human_name %>Actions
<%=h info_request_event.id %> + <% if column.name == 'params_yaml' %> + <%= info_request_event.params_yaml_as_html %> + <% elsif column.text? %> + <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %> + <% else %> + <%=h info_request_event.send(column.name) %> + <% end %> + + <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %> + <%= form_tag '../mark_event_as_clarification' do %> +
+ <%= hidden_field_tag 'info_request_event_id', info_request_event.id %> + <%= submit_tag "Was clarification request" %> +
+ <% end %> + <% end %> +
+ +

Outgoing messages

+ + + + + <% for column in OutgoingMessage.content_columns %> + + <% end %> + + + +<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %> + + + <% for column in OutgoingMessage.content_columns.map { |c| c.name } %> + + <% if column == 'body' %> + + <% else %> + + <% end %> + + <% end %> + + +<% end %> +
Id<%= column.human_name %>Actions
<%=h outgoing_message.id %> +
<%= simple_format( truncate(outgoing_message.body, :length => 400, + :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") + )) %>
+
<%= simple_format( outgoing_message.body ) %>
+
<%= simple_format( outgoing_message.send(column).to_s ) %> + <%= form_tag '../resend' do %> +
+ <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %> + <%= submit_tag "Resend" %> +
+ <% end %> + <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %> +
+ +

Incoming messages

+ + + + + <% for column in IncomingMessage.content_columns %> + + <% end %> + + + +<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %> + + + <% for column in IncomingMessage.content_columns.map { |c| c.name } %> + <% if column =~ /^cached_.*?$/ %> + + <% else %> + + <% end %> + <% end %> + + +<% end %> +
Id<%= column.human_name %>Actions
<%=h incoming_message.id %> +
<%= simple_format( truncate(incoming_message.send(column), :length => 400, + :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") + )) %>
+
<%= simple_format( incoming_message.send(column) ) %>
+
<%= simple_format( incoming_message.send(column).to_s ) %> + <% if !incoming_message.raw_email_id.nil? %> +

+ <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %> +

+ <% end %> + <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %> +
+ +

Annotations

+ +<% if @info_request.comments.size > 0 %> + + + + + <% for column in Comment.content_columns %> + + <% end %> + + + + <% for comment in @info_request.comments %> + + + + <% for column in Comment.content_columns.map { |c| c.name } %> + <% if column == 'body' && !comment.visible %> + + <% else %> + + <% end %> + <% end %> + + + <% end %> +
IdPosted by<%= column.human_name %>Actions
<%=h comment.id %><%= user_both_links(comment.user) %><%=h comment.send(column) %><%=h comment.send(column) %> + <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %> +
+<% else %> +

None yet.

+<% end %> + + + +

Mail server delivery logs

+ +

(Lines containing the request incoming email address, updated hourly.)

+ +<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %> + +
<% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %>
+<% end %> +<% if @info_request.mail_server_logs.size == 0 %> +

None (perhaps this is an old or a very new request)

+<% end %> + +

Censor rules

+<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %> + diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml deleted file mode 100644 index 3dd39347b..000000000 --- a/app/views/admin_request/show.rhtml +++ /dev/null @@ -1,230 +0,0 @@ -<% @title = "FOI request - " + h(@info_request.title) %> -<%= javascript_include_tag :defaults %> - -

<%=@title%>

- -<%= form_tag '../move_request', { :class => "inline" } do %> -

-<%= hidden_field_tag 'info_request_id', @info_request.id %> -<% for column in InfoRequest.content_columns %> - <%= column.human_name %>: <%=h @info_request.send(column.name) %> - <% if column.name == 'described_state' %> - Calculated status: <%= @info_request.calculate_status %> -
Initial request last sent at: <%=@info_request.date_initial_request_last_sent_at.to_date %> - Date response required by: <%= @info_request.date_response_required_by %> - Very overdue after: <%= @info_request.date_very_overdue_after %> - <% end %> - <% if ![ 'allow_new_responses_from' ].include?(column.name) %> -
- <% end %> -<% end %> - Created by: - <% if @info_request.is_external? %> - <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API) - <% else %> - <%= user_both_links(@info_request.user) %> - <% end %> - - - - (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>) - - - url_name of new user: - <%= text_field_tag 'user_url_name', "", { :size => 20 } %> - <%= submit_tag "Move request to user" %> - - -
-Public authority: <%= public_body_both_links(@info_request.public_body) %> - - - (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>) - - - url_name of new authority: - <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %> - <%= submit_tag "Move request to authority" %> - - -
-Incoming email address: <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %>
-Tags: <%= render :partial => 'tags', :locals => { :info_request => @info_request} %>
-

-<% end %> - -

- <%= link_to 'Public page', main_url(request_url(@info_request)) %> - | <%= link_to 'Edit', '../edit/' + @info_request.id.to_s %> - | <%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s %> (see also links on incoming messages below) -

- -

Events

- - - - - <% for column in InfoRequestEvent.content_columns %> - - <% end %> - - - -<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %> - - - <% for column in InfoRequestEvent.content_columns %> - - <% end %> - - -<% end %> -
Id<%= column.human_name %>Actions
<%=h info_request_event.id %> - <% if column.name == 'params_yaml' %> - <%= info_request_event.params_yaml_as_html %> - <% elsif column.text? %> - <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %> - <% else %> - <%=h info_request_event.send(column.name) %> - <% end %> - - <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %> - <%= form_tag '../mark_event_as_clarification' do %> -
- <%= hidden_field_tag 'info_request_event_id', info_request_event.id %> - <%= submit_tag "Was clarification request" %> -
- <% end %> - <% end %> -
- -

Outgoing messages

- - - - - <% for column in OutgoingMessage.content_columns %> - - <% end %> - - - -<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %> - - - <% for column in OutgoingMessage.content_columns.map { |c| c.name } %> - - <% if column == 'body' %> - - <% else %> - - <% end %> - - <% end %> - - -<% end %> -
Id<%= column.human_name %>Actions
<%=h outgoing_message.id %> -
<%= simple_format( truncate(outgoing_message.body, :length => 400, - :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") - )) %>
-
<%= simple_format( outgoing_message.body ) %>
-
<%= simple_format( outgoing_message.send(column).to_s ) %> - <%= form_tag '../resend' do %> -
- <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %> - <%= submit_tag "Resend" %> -
- <% end %> - <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %> -
- -

Incoming messages

- - - - - <% for column in IncomingMessage.content_columns %> - - <% end %> - - - -<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %> - - - <% for column in IncomingMessage.content_columns.map { |c| c.name } %> - <% if column =~ /^cached_.*?$/ %> - - <% else %> - - <% end %> - <% end %> - - -<% end %> -
Id<%= column.human_name %>Actions
<%=h incoming_message.id %> -
<%= simple_format( truncate(incoming_message.send(column), :length => 400, - :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") - )) %>
-
<%= simple_format( incoming_message.send(column) ) %>
-
<%= simple_format( incoming_message.send(column).to_s ) %> - <% if !incoming_message.raw_email_id.nil? %> -

- <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %> -

- <% end %> - <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %> -
- -

Annotations

- -<% if @info_request.comments.size > 0 %> - - - - - <% for column in Comment.content_columns %> - - <% end %> - - - - <% for comment in @info_request.comments %> - - - - <% for column in Comment.content_columns.map { |c| c.name } %> - <% if column == 'body' && !comment.visible %> - - <% else %> - - <% end %> - <% end %> - - - <% end %> -
IdPosted by<%= column.human_name %>Actions
<%=h comment.id %><%= user_both_links(comment.user) %><%=h comment.send(column) %><%=h comment.send(column) %> - <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %> -
-<% else %> -

None yet.

-<% end %> - - - -

Mail server delivery logs

- -

(Lines containing the request incoming email address, updated hourly.)

- -<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %> - -
<% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %>
-<% end %> -<% if @info_request.mail_server_logs.size == 0 %> -

None (perhaps this is an old or a very new request)

-<% end %> - -

Censor rules

-<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %> - diff --git a/app/views/admin_request/show_raw_email.html.erb b/app/views/admin_request/show_raw_email.html.erb new file mode 100644 index 000000000..ea0d6017e --- /dev/null +++ b/app/views/admin_request/show_raw_email.html.erb @@ -0,0 +1,37 @@ +<% @title = 'Incoming message ' + @raw_email.incoming_message.id.to_s + ' of FOI request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %> + +

Incoming message <%=@raw_email.incoming_message.id.to_s %>

+ +

+ FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %> + <% if @holding_pen %> +
This is in the holding pen because: <%= @rejected_reason %> + <% if @public_bodies.size > 0 %> +
Guessed authority: + <% for public_body in @public_bodies %> + <%=public_body_both_links(public_body)%> + <% end %> + (based on From: email domain) + <% end %> + <% if @info_requests.size > 0 %> +
Guessed request: + <% for info_request in @info_requests %> + <%=request_both_links(info_request)%> + <% end %> + (based on id, not hash, in To/Cc email) + <% end %> + <% end %> +

+ +

Actions

+ +
+ <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %> +
+ +

Raw email

+ +

<%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %>

+ +
<%= h(@raw_email.data).gsub(/\n/, '
').html_safe %>
+ diff --git a/app/views/admin_request/show_raw_email.rhtml b/app/views/admin_request/show_raw_email.rhtml deleted file mode 100644 index ea0d6017e..000000000 --- a/app/views/admin_request/show_raw_email.rhtml +++ /dev/null @@ -1,37 +0,0 @@ -<% @title = 'Incoming message ' + @raw_email.incoming_message.id.to_s + ' of FOI request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %> - -

Incoming message <%=@raw_email.incoming_message.id.to_s %>

- -

- FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %> - <% if @holding_pen %> -
This is in the holding pen because: <%= @rejected_reason %> - <% if @public_bodies.size > 0 %> -
Guessed authority: - <% for public_body in @public_bodies %> - <%=public_body_both_links(public_body)%> - <% end %> - (based on From: email domain) - <% end %> - <% if @info_requests.size > 0 %> -
Guessed request: - <% for info_request in @info_requests %> - <%=request_both_links(info_request)%> - <% end %> - (based on id, not hash, in To/Cc email) - <% end %> - <% end %> -

- -

Actions

- -
- <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %> -
- -

Raw email

- -

<%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %>

- -
<%= h(@raw_email.data).gsub(/\n/, '
').html_safe %>
- -- cgit v1.2.3