blob: f9fb4ce4504c7697ecf8c9607592151e9e07824b (
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
|
<% @title = "FOI request - " + h(@info_request.title) %>
<h1><%=@title%></h1>
<p>
<% for column in InfoRequest.content_columns %>
<strong><%= column.human_name %>:</strong> <%=h @info_request.send(column.name) %>
<br/>
<% end %>
<strong>Created by:</strong> <%= user_admin_link(@info_request.user) %> <br>
<strong>Public body:</strong> <%= public_body_admin_link(@info_request.public_body) %> <br>
<strong>Incoming email address:</strong> <%=h @info_request.incoming_email %> <br>
</p>
<p>
<%= link_to 'Public page', main_url(request_url(@info_request)) %>
| <%= link_to "Edit", '../edit/' + @info_request.id.to_s %>
</p>
<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 } %>
<td><%=h outgoing_message.send(column) %></td>
<% 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 %>
</tr>
<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%=h incoming_message.id %></td>
<% for column in IncomingMessage.content_columns.map { |c| c.name } %>
<td><%=h incoming_message.send(column) %></td>
<% end %>
</tr>
<% end %>
</table>
<h2>Events</h2>
<table>
<tr>
<th>Id</th>
<% for column in InfoRequestEvent.content_columns %>
<th><%= column.human_name %></th>
<% end %>
</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.map { |c| c.name } %>
<td><%=h info_request_event.send(column) %></td>
<% end %>
</tr>
<% end %>
</table>
|