diff options
-rw-r--r-- | app/controllers/user_controller.rb | 11 | ||||
-rw-r--r-- | app/views/request/frontpage.rhtml | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 79311753e..75f78c97f 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_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: user_controller.rb,v 1.14 2007-11-07 10:26:29 francis Exp $ +# $Id: user_controller.rb,v 1.15 2007-11-07 10:45:44 francis Exp $ class UserController < ApplicationController # XXX See controllers/application.rb simplify_url_part for reverse of expression in SQL below @@ -14,7 +14,11 @@ class UserController < ApplicationController # Login form def signin - # The explict signin link uses this to store where it is to go back to + # Redirect to front page later if nothing else specified + if not params[:r] and not params[:token] + params[:r] = "/" + end + # The explicit "signin" link uses this to specify where to go back to if params[:r] @post_redirect = PostRedirect.new(:uri => params[:r], :post_params => {}, :reason_params => { @@ -24,7 +28,8 @@ class UserController < ApplicationController }) @post_redirect.save! params[:token] = @post_redirect.token - else + elsif params[:token] + # Otherwise we have a token (which represents a saved POST request0 @post_redirect = PostRedirect.find_by_token(params[:token]) end diff --git a/app/views/request/frontpage.rhtml b/app/views/request/frontpage.rhtml index b98b27e30..e73842303 100644 --- a/app/views/request/frontpage.rhtml +++ b/app/views/request/frontpage.rhtml @@ -3,9 +3,11 @@ <% form_for(:info_request, @info_request, :url => new_request_url, :html => { :id => 'public_body_form', :class => 'plaque' } ) do |f| %> <p>Choose which public body you would like information from.</p> + <p> <%= @public_bodies = PublicBody.find(:all, :order => "name") f.collection_select(:public_body_id, @public_bodies, :id, :name) %> - <p><%= submit_tag "Submit >>" %></p> + </p> + <p><%= submit_tag "Submit >>" %></p> <% end %> </div> |