diff options
author | francis <francis> | 2009-08-26 23:13:28 +0000 |
---|---|---|
committer | francis <francis> | 2009-08-26 23:13:28 +0000 |
commit | 2b06475801c55ecce628f3e05b05b31fd21d6470 (patch) | |
tree | 495947c414308cdc5d7a04019e0b5df657a0b8d6 /app/controllers/request_game_controller.rb | |
parent | 566da1621db32170a7ea3549d63e8943f00f9b29 (diff) |
Add help about not putting allegations in requests.
Add help about not impersonating.
Link to game from help.
Require login to play request game (probably should show some stuff
without login, but is nice to have login before they get to individual
request pages)
Cope with the game finishing (all being classified).
Make action links in game into buttons.
Margin at bottom of login page.
Diffstat (limited to 'app/controllers/request_game_controller.rb')
-rw-r--r-- | app/controllers/request_game_controller.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/app/controllers/request_game_controller.rb b/app/controllers/request_game_controller.rb index 0cedc2f94..3abb9adf6 100644 --- a/app/controllers/request_game_controller.rb +++ b/app/controllers/request_game_controller.rb @@ -4,17 +4,30 @@ # Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: request_game_controller.rb,v 1.2 2009-06-23 13:52:25 francis Exp $ +# $Id: request_game_controller.rb,v 1.3 2009-08-26 23:13:28 francis Exp $ class RequestGameController < ApplicationController def play - # XXX make sure they're logged in + if !authenticated?( + :web => "To play the request categorisation game", + :email => "Then you can play the request categorisation game.", + :email_subject => "Play the request categorisation game" + ) + # do nothing - as "authenticated?" has done the redirect to signin page for us + return + end + session[:request_game] = Time.now old = InfoRequest.find_old_unclassified(:conditions => ["prominence = 'normal'"], :age_in_days => 10) @missing = old.size @requests = old.sort_by{ rand }.slice(0..2) + + if @missing == 0 + flash[:notice] = 'All done! Thank you very much for your help.' + redirect_to frontpage_url + end end # Requests similar to this one |