aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_controller.rb4
-rw-r--r--app/views/admin/index.rhtml66
-rw-r--r--app/views/layouts/admin.rhtml1
3 files changed, 4 insertions, 67 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 2844bde29..12c88f84f 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: admin_controller.rb,v 1.6 2008-03-24 10:40:26 francis Exp $
+# $Id: admin_controller.rb,v 1.7 2008-04-03 15:38:51 francis Exp $
class AdminController < ApplicationController
layout "admin"
@@ -19,7 +19,9 @@ class AdminController < ApplicationController
@requires_admin_requests = InfoRequest.find(:all, :conditions => ["described_state = 'requires_admin'"])
@blank_contacts = PublicBody.find(:all, :conditions => ["request_email = ''"])
@two_week_old_unclassified = InfoRequest.find(:all, :conditions => [ "awaiting_description and info_requests.updated_at < ?", Time.now() - 2.weeks ])
+ end
+ def timeline
# Recent events
@events_title = "Events in last week"
date_back_to = Time.now - 1.week
diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml
index cf5e9aff4..a31abf7fe 100644
--- a/app/views/admin/index.rhtml
+++ b/app/views/admin/index.rhtml
@@ -43,70 +43,4 @@
No pending administration required.
<% end %>
-<hr>
-
-<h2><%=h @events_title%></h2>
-
-<p><a href="?">Week</a>
-| <a href="?month=1">Month</a>
-| <a href="?all=1">All time</a></p>
-
-<% last_date = nil %>
-<% for event in @events %>
- <% if last_date != event.created_at.to_date %>
- <% if last_date.nil? %>
- <p>
- <% end %>
- <h3><%= simple_date(event.created_at) %></h3>
- <p>
- <% else %>
- <br>
- <% end %>
- <% last_date = event.created_at.to_date %>
-
-
- '<%= 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
- %>
- <% else %>
- Missing outgoing message, internal error.
- <% end %>
- <% elsif event.event_type == 'response' %>
- <% incoming_message = event.incoming_message %>
- 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' %>
- 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 %>
-<% if not @events.empty? %>
-</p>
-<% end %>
-
diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml
index 1e6424b0f..6972f6300 100644
--- a/app/views/layouts/admin.rhtml
+++ b/app/views/layouts/admin.rhtml
@@ -12,6 +12,7 @@
<p><b>FOIFA admin interface:</b>
<%= link_to 'Overview', admin_url('') %>
+ | <%= link_to 'Timeline', admin_url('timeline') %>
| <%= link_to 'Public bodies', admin_url('body/list') %>
| <%= link_to 'Requests', admin_url('request/list') %>
| <%= link_to 'Users', admin_url('user/list') %>