diff options
author | francis <francis> | 2008-06-10 10:18:57 +0000 |
---|---|---|
committer | francis <francis> | 2008-06-10 10:18:57 +0000 |
commit | fe1f1f98a677ca3642d17c55c64246adce2ac1c4 (patch) | |
tree | 8e6e42e2f56b1c3eb05f64b0172dc05e1dbd6d97 | |
parent | 212122491740069e150bb6f93d6247f67ebc0a09 (diff) |
Date and order for things needing classification.
-rw-r--r-- | app/controllers/admin_controller.rb | 9 | ||||
-rw-r--r-- | app/views/admin/index.rhtml | 27 |
2 files changed, 23 insertions, 13 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index f00ee2c1e..a40225a75 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.15 2008-05-21 23:34:23 francis Exp $ +# $Id: admin_controller.rb,v 1.16 2008-06-10 10:18:57 francis Exp $ class AdminController < ApplicationController layout "admin" @@ -18,9 +18,10 @@ class AdminController < ApplicationController @track_thing_count = TrackThing.count # Tasks to do - @requires_admin_requests = InfoRequest.find(:all, :conditions => ["described_state = 'requires_admin'"]) - @blank_contacts = PublicBody.find(:all, :conditions => ["request_email = ''"]) - @one_week_old_unclassified = InfoRequest.find(:all, :conditions => [ "awaiting_description and (select created_at from info_request_events where info_request_events.info_request_id = info_requests.id order by created_at desc limit 1) < ? and prominence != 'backpage'", Time.now() - 1.weeks ]) + last_event_time_clause = '(select created_at from info_request_events where info_request_events.info_request_id = info_requests.id order by created_at desc limit 1)' + @requires_admin_requests = InfoRequest.find(:all, :select => '*, ' + last_event_time_clause + ' as last_event_time', :conditions => ["described_state = 'requires_admin'"], :order => "last_event_time") + @blank_contacts = PublicBody.find(:all, :conditions => ["request_email = ''"], :order => "updated_at") + @one_week_old_unclassified = InfoRequest.find(:all, :select => '*, ' + last_event_time_clause + ' as last_event_time', :conditions => [ "awaiting_description and " + last_event_time_clause + " < ? and prominence != 'backpage'", Time.now() - 1.weeks ], :order => "last_event_time") end def timeline diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml index 88b5cb644..b41ca78c4 100644 --- a/app/views/admin/index.rhtml +++ b/app/views/admin/index.rhtml @@ -13,22 +13,28 @@ <h1>Things to do</h1> -<% if @requires_admin_requests.size > 0 %> - <h3>Work out what to do with these unusual responses (a new category?)</h3> +<% if @one_week_old_unclassified.size > 0 %> + <h3>Classify responses that are still unclassified one week after response</h3> <ul> - <% for @request in @requires_admin_requests %> - <li><%= link_to h(@request.title), "request/show/" + @request.id.to_s %></li> + <% for @request in @one_week_old_unclassified %> + <li> + <%= link_to h(@request.title), "request/show/" + @request.id.to_s %> + (<%=simple_date(@request.get_last_event.created_at)%>) + </li> <% end %> </ul> <% end %> -<% if @one_week_old_unclassified.size > 0 %> - <h3>Classify responses that are still unclassified one week after response</h3> +<% if @requires_admin_requests.size > 0 %> + <h3>Work out what to do with these unusual responses (a new category?)</h3> <ul> - <% for @request in @one_week_old_unclassified %> - <li><%= link_to h(@request.title), "request/show/" + @request.id.to_s %></li> + <% for @request in @requires_admin_requests %> + <li> + <%= link_to h(@request.title), "request/show/" + @request.id.to_s %> + (<%=simple_date(@request.get_last_event.created_at)%>) + </li> <% end %> </ul> <% end %> @@ -37,7 +43,10 @@ <h3>Find missing FOI email for these public authorities (try phoning!)</h3> <ul> <% for @blank_contact in @blank_contacts %> - <li><%= link_to h(@blank_contact.name), "body/show/" + @blank_contact.id.to_s %></li> + <li> + <%= link_to h(@blank_contact.name), "body/show/" + @blank_contact.id.to_s %> + (<%=simple_date(@blank_contact.updated_at)%>) + </li> <% end %> </ul> <% end %> |