diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-10-23 11:51:04 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-12-04 09:32:41 +0000 |
commit | d9c42b52789743b6687c49d8457ec5ed1a8b21e3 (patch) | |
tree | 691a05f12544398962ce3c49d743f0bd2d9e8c96 | |
parent | 0aba4dcbcb19be2c2c66e40f051ae9c4e0283b6e (diff) |
Pass public bodies list through forms.
-rw-r--r-- | app/controllers/request_controller.rb | 1 | ||||
-rw-r--r-- | app/views/request/new.html.erb | 8 | ||||
-rw-r--r-- | app/views/request/preview.html.erb | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 5a4ec58a0..d56b5d245 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -187,7 +187,6 @@ class RequestController < ApplicationController if params[:public_body_ids].blank? redirect_to select_authorities_path and return end - # TODO: Pass public bodies list through new and preview template forms # TODO: I don't think batch requesters should be subject to rate limits, # but I do think we should probably check for double submission of batch diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index cce6c1397..91171da3e 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -144,7 +144,13 @@ </p> <div class="form_button"> - <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <% if @batch %> + <% params[:public_body_ids].each do |public_body_id| %> + <%= hidden_field_tag("public_body_ids[]", public_body_id)%> + <% end %> + <% else %> + <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <% end %> <%= hidden_field_tag(:submitted_new_request, 1 ) %> <%= hidden_field_tag(:preview, 1 ) %> <%= submit_tag _("Preview your public request") %> diff --git a/app/views/request/preview.html.erb b/app/views/request/preview.html.erb index a5c9a8a60..0265d0328 100644 --- a/app/views/request/preview.html.erb +++ b/app/views/request/preview.html.erb @@ -41,7 +41,13 @@ <p> <%= f.hidden_field(:title) %> - <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <% if @batch %> + <% params[:public_body_ids].each do |public_body_id| %> + <%= hidden_field_tag("public_body_ids[]", public_body_id)%> + <% end %> + <% else %> + <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <% end %> <%= f.hidden_field(:tag_string) %> <%= hidden_field_tag(:submitted_new_request, 1) %> <%= hidden_field_tag(:preview, 0 ) %> |