aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/admin_request/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/admin_request/show.html.erb')
-rw-r--r--app/views/admin_request/show.html.erb230
1 files changed, 230 insertions, 0 deletions
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 %>
+
+<h1><%=@title%></h1>
+
+<%= form_tag '../move_request', { :class => "inline" } do %>
+<p>
+<%= hidden_field_tag 'info_request_id', @info_request.id %>
+<% for column in InfoRequest.content_columns %>
+ <strong><%= column.human_name %>:</strong> <%=h @info_request.send(column.name) %>
+ <% if column.name == 'described_state' %>
+ <strong>Calculated status:</strong> <%= @info_request.calculate_status %>
+ <br/><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %>
+ <strong>Date response required by:</strong> <%= @info_request.date_response_required_by %>
+ <strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %>
+ <% end %>
+ <% if ![ 'allow_new_responses_from' ].include?(column.name) %>
+ <br/>
+ <% end %>
+<% end %>
+ <strong>Created by:</strong>
+ <% 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 %>
+
+ <span>
+ <span>
+ (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>)
+ </span>
+ <span style="display:none;">
+ <strong>url_name of new user:</strong>
+ <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
+ <%= submit_tag "Move request to user" %>
+ </span>
+ </span>
+ <br>
+<strong>Public authority:</strong> <%= public_body_both_links(@info_request.public_body) %>
+ <span>
+ <span>
+ (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>)
+ </span>
+ <span style="display:none;">
+ <strong>url_name of new authority:</strong>
+ <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
+ <%= submit_tag "Move request to authority" %>
+ </span>
+ </span>
+ <br>
+<strong>Incoming email address:</strong> <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %> <br>
+<b>Tags:</b> <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> <br>
+</p>
+<% end %>
+
+<p>
+ <%= 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)
+</p>
+
+<h2>Events</h2>
+
+<table>
+ <tr>
+ <th>Id</th>
+ <% for column in InfoRequestEvent.content_columns %>
+ <th><%= column.human_name %></th>
+ <% end %>
+ <th>Actions</th>
+ </tr>
+
+<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h info_request_event.id %></td>
+ <% for column in InfoRequestEvent.content_columns %>
+ <td>
+ <% 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 %>
+ </td>
+ <% end %>
+ <td>
+ <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
+ <%= form_tag '../mark_event_as_clarification' do %>
+ <div>
+ <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
+ <%= submit_tag "Was clarification request" %>
+ </div>
+ <% end %>
+ <% end %>
+ </td>
+ </tr>
+<% end %>
+</table>
+
+<h2>Outgoing messages</h2>
+
+<table>
+ <tr>
+ <th>Id</th>
+ <% for column in OutgoingMessage.content_columns %>
+ <th><%= column.human_name %></th>
+ <% end %>
+ <th>Actions</th>
+ </tr>
+
+<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h outgoing_message.id %></td>
+ <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
+
+ <% if column == 'body' %>
+ <td>
+ <div><%= simple_format( truncate(outgoing_message.body, :length => 400,
+ :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
+ )) %></div>
+ <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div>
+ </td>
+ <% else %>
+ <td><%= simple_format( outgoing_message.send(column).to_s ) %></td>
+ <% end %>
+
+ <% end %>
+ <td>
+ <%= form_tag '../resend' do %>
+ <div>
+ <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
+ <%= submit_tag "Resend" %>
+ </div>
+ <% end %>
+ <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>
+ </td>
+ </tr>
+<% end %>
+</table>
+
+<h2>Incoming messages</h2>
+
+<table>
+ <tr>
+ <th>Id</th>
+ <% for column in IncomingMessage.content_columns %>
+ <th><%= column.human_name %></th>
+ <% end %>
+ <th>Actions</th>
+ </tr>
+
+<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
+ <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
+ <td><%=h incoming_message.id %></td>
+ <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
+ <% if column =~ /^cached_.*?$/ %>
+ <td>
+ <div><%= simple_format( truncate(incoming_message.send(column), :length => 400,
+ :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
+ )) %></div>
+ <div style="display:none;"><%= simple_format( incoming_message.send(column) ) %></div>
+ </td>
+ <% else %>
+ <td><%= simple_format( incoming_message.send(column).to_s ) %></td>
+ <% end %>
+ <% end %>
+ <td>
+ <% if !incoming_message.raw_email_id.nil? %>
+ <p>
+ <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>
+ </p>
+ <% end %>
+ <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
+ </td>
+ </tr>
+<% end %>
+</table>
+
+<h2>Annotations</h2>
+
+<% if @info_request.comments.size > 0 %>
+ <table>
+ <tr>
+ <th>Id</th>
+ <th>Posted by</th>
+ <% for column in Comment.content_columns %>
+ <th><%= column.human_name %></th>
+ <% end %>
+ <th>Actions</th>
+ </tr>
+
+ <% for comment in @info_request.comments %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h comment.id %></td>
+ <td><%= user_both_links(comment.user) %></td>
+ <% for column in Comment.content_columns.map { |c| c.name } %>
+ <% if column == 'body' && !comment.visible %>
+ <td><s><%=h comment.send(column) %></s></td>
+ <% else %>
+ <td><%=h comment.send(column) %></td>
+ <% end %>
+ <% end %>
+ <td>
+ <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>
+ </td>
+ </tr>
+ <% end %>
+ </table>
+<% else %>
+ <p>None yet.</p>
+<% end %>
+
+
+
+<h2>Mail server delivery logs</h2>
+
+<p><i>(Lines containing the request incoming email address, updated hourly.)</i></p>
+
+<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %>
+ <!-- <h3><%=h mail_server_logs[0].mail_server_log_done.filename %></h3> -->
+ <pre><% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %></pre>
+<% end %>
+<% if @info_request.mail_server_logs.size == 0 %>
+ <p>None (perhaps this is an old or a very new request)</p>
+<% end %>
+
+<h2>Censor rules</h2>
+<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>
+