<% @title = "FOI request - " + h(@info_request.title) %> <%= javascript_include_tag :defaults %>

<%=@title%>

<% for column in InfoRequest.content_columns %> <%= column.human_name %>: <%=h @info_request.send(column.name) %>
<% end %> Created by: <%= user_both_links(@info_request.user) %>
Public authority: <%= public_body_both_links(@info_request.public_body) %>
Incoming email address: <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %>

<%= 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 %>
<%=h info_request_event.id %> <% if column.name == 'params_yaml' %>
<%= info_request_event.params_yaml %>
<% elsif column.text? %> <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %> <% else %> <%=h info_request_event.send(column.name) %> <% 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, 400, link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") )) %>
<%= simple_format( outgoing_message.body ) %>
<%= simple_format( outgoing_message.send(column) ) %> <% 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_.*?_text$/ %> <% else %> <% end %> <% end %> <% end %>
Id<%= column.human_name %>Actions
<%=h incoming_message.id %>
<%= simple_format( truncate(incoming_message.send(column), 400, link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") )) %>
<%= simple_format( incoming_message.send(column) ) %>
<%= simple_format( incoming_message.send(column) ) %> <% 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 %>
Id Posted 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 %>

Exim delivery logs

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

<% for exim_log_done_id, exim_logs in @info_request.exim_logs.group_by(&:exim_log_done_id) %>
<% for exim_log in exim_logs %><%=h exim_log.line%><% end %>
<% end %> <% if @info_request.exim_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 } %>