diff options
-rw-r--r-- | app/controllers/request_controller.rb | 9 | ||||
-rw-r--r-- | app/views/info_request_batch/_batch_sent.html.erb | 18 | ||||
-rw-r--r-- | app/views/info_request_batch/show.html.erb | 5 | ||||
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 5 |
4 files changed, 27 insertions, 10 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 56ac396d8..9e156cfb9 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -244,13 +244,8 @@ class RequestController < ApplicationController :body => params[:outgoing_message][:body], :public_bodies => @public_bodies, :user => authenticated_user) - flash[:notice] = _("<p>Your {{law_used_full}} requests will be <strong>sent</strong> shortly!</p> - <p><strong>We will email you</strong> when they have been sent. - We will also email you when there is a response to any of them, or after {{late_number_of_days}} working days if the authorities still haven't - replied by then.</p> - <p>If you write about these requests (for example in a forum or a blog) please link to this page.</p>", - :law_used_full=>@info_request.law_used_full, - :late_number_of_days => AlaveteliConfiguration::reply_late_after_days) + + flash[:batch_sent] = true redirect_to info_request_batch_path(@info_request_batch) end diff --git a/app/views/info_request_batch/_batch_sent.html.erb b/app/views/info_request_batch/_batch_sent.html.erb new file mode 100644 index 000000000..1bf51962f --- /dev/null +++ b/app/views/info_request_batch/_batch_sent.html.erb @@ -0,0 +1,18 @@ +<div id="notice"> + <p> + <%= _("Your requests will be <strong>sent</strong> shortly!") %> + </p> + + <p> + <%= _("<strong>We will email you</strong> when they have been sent. " \ + "We will also email you when there is a response to any of them, or " \ + "after {{late_number_of_days}} working days if the authorities still" \ + "haven't replied by then.", + :late_number_of_days => AlaveteliConfiguration::reply_late_after_days) %> + </p> + + <p> + <%= _("If you write about these requests (for example in a forum or a blog) " \ + "please link to this page.") %> + </p> +</div> diff --git a/app/views/info_request_batch/show.html.erb b/app/views/info_request_batch/show.html.erb index 8bb834b3c..b5db4ac52 100644 --- a/app/views/info_request_batch/show.html.erb +++ b/app/views/info_request_batch/show.html.erb @@ -1,4 +1,9 @@ <% @title = _("{{title}} - a batch request", :title => @info_request_batch.title) %> + +<% if flash[:batch_sent] %> + <%= render :partial => 'batch_sent' } %> +<% end %> + <div class="info_request_batch_intro"> <h1><%= @title %></h1> <% if @info_request_batch.sent_at %> diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index dc28f6dab..aeb27f918 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -2564,10 +2564,9 @@ describe RequestController, "#new_batch" do assigns[:existing_batch].should_not be_nil end - it 'should display a success notice' do + it 'sets the batch_sent flash to true' do make_request - notice_text = "<p>Your Freedom of Information requests will be <strong>sent</strong> shortly!" - flash[:notice].should match notice_text + expect(flash[:batch_sent]).to be_true end end |