aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-03-14 12:08:00 +0000
committerfrancis <francis>2008-03-14 12:08:00 +0000
commit5725f62e768130b323dc24d1cb8a086bb50ad1bf (patch)
treec64171dee33ff90c5bfb1ba18c3d5b559acac813
parent3b846c4414aa0e7bf3638b92fe0c6928a8b4c6f6 (diff)
Fix links
-rw-r--r--app/views/admin/index.rhtml79
1 files changed, 43 insertions, 36 deletions
diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml
index 01ab163be..e6710c047 100644
--- a/app/views/admin/index.rhtml
+++ b/app/views/admin/index.rhtml
@@ -16,50 +16,57 @@
<% last_date = nil %>
<% for event in @events %>
<% if last_date != event.created_at.to_date %>
- <h2><%= simple_date(event.created_at) %></h2>
+ <% if last_date.nil? %>
+ <p>
+ <% end %>
+ <h2><%= simple_date(event.created_at) %></h2>
+ <p>
+ <% else %>
+ <br>
<% end %>
<% last_date = event.created_at.to_date %>
- <p>
- '<%= link_to h(event.info_request.title), 'request/show/' + event.info_request.id.to_s %>'
- <% if event.event_type == 'edit' %>
- was edited by administrator <%=h event.params[:editor] %>.
- <% for p in ['title', 'prominence', 'described_state', 'awaiting_description']
+
+ '<%= link_to h(event.info_request.title), main_url(request_url(event.info_request)) %>'
+ <% if event.event_type == 'edit' %>
+ was edited by administrator <%=h event.params[:editor] %>.
+ <% for p in ['title', 'prominence', 'described_state', 'awaiting_description']
+ if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
+ %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
+ end
+ end
+ %>
+ <% elsif event.event_type == 'edit_outgoing' %>
+ <% outgoing_messages = OutgoingMessage.find(:all, event.params[:outgoing_message_id].to_i) %>
+ had outgoing message edited by administrator <%=h event.params[:editor] %>.
+ <% if outgoing_messages.size > 0 %>
+ <% outgoing_message = outgoing_messages[0] %>
+ <% for p in ['body']
if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
%> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
end
end
%>
- <% elsif event.event_type == 'edit_outgoing' %>
- <% outgoing_messages = OutgoingMessage.find(:all, event.params[:outgoing_message_id].to_i) %>
- had outgoing message edited by administrator <%=h event.params[:editor] %>.
- <% if outgoing_messages.size > 0 %>
- <% outgoing_message = outgoing_messages[0] %>
- <% for p in ['body']
- if event.params[p.to_sym] != event.params[('old_'+p).to_sym]
- %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <%
- end
- end
- %>
- <% else %>
- Missing outgoing message, internal error.
- <% end %>
- <% elsif event.event_type == 'response' %>
- <% incoming_message = IncomingMessage.find(event.params[:incoming_message_id]) %>
- received
- <%= link_to 'a response',
- main_url(show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id)) %>
-
- from <%=h event.info_request.public_body.name %>.
- <% elsif event.event_type == 'sent' %>
- was initially sent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
- <% elsif event.event_type == 'resent' %>
- had the request resent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
- <% elsif event.event_type == 'followup_sent' %>
- <% outgoing_messages = OutgoingMessage.find(:all, event.params[:outgoing_message_id].to_i) %>
- had a follow up message sent to <%=h event.info_request.public_body.name %>.
<% else %>
- had '<%=event.event_type%>' done to it, parameters <%=h event.params_yaml%>.
+ Missing outgoing message, internal error.
<% end %>
- </p>
+ <% elsif event.event_type == 'response' %>
+ <% incoming_message = IncomingMessage.find(event.params[:incoming_message_id]) %>
+ received
+ <%= link_to 'a response',
+ main_url(show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id, :only_path => true)) %>
+
+ from <%=h event.info_request.public_body.name %>.
+ <% elsif event.event_type == 'sent' %>
+ was initially sent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
+ <% elsif event.event_type == 'resent' %>
+ had the request resent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
+ <% elsif event.event_type == 'followup_sent' %>
+ <% outgoing_messages = OutgoingMessage.find(:all, event.params[:outgoing_message_id].to_i) %>
+ had a follow up message sent to <%=h event.info_request.public_body.name %>.
+ <% else %>
+ had '<%=event.event_type%>' done to it, parameters <%=h event.params_yaml%>.
+ <% end %>
<% end %>
+</p>
+