From cf11b959899d54cf3c7f4e018f11c2c89c83d4af Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 24 Oct 2013 16:00:10 +0100 Subject: Simple code for the happy path Create the batch and associate new requests with it, send the outgoing messages, and redirect to a page for the new batch. --- app/controllers/info_request_batch_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/controllers/info_request_batch_controller.rb (limited to 'app/controllers/info_request_batch_controller.rb') diff --git a/app/controllers/info_request_batch_controller.rb b/app/controllers/info_request_batch_controller.rb new file mode 100644 index 000000000..1e1030b53 --- /dev/null +++ b/app/controllers/info_request_batch_controller.rb @@ -0,0 +1,7 @@ +class InfoRequestBatchController < ApplicationController + + def show + @info_request_batch = InfoRequestBatch.find(params[:id]) + end + +end -- cgit v1.2.3 From b68c23074b7849b30e8f96ea024ec14ec4b8f324 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 28 Oct 2013 11:41:43 +0000 Subject: Add a rudimentary view for an info request batch. --- app/controllers/info_request_batch_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/controllers/info_request_batch_controller.rb') diff --git a/app/controllers/info_request_batch_controller.rb b/app/controllers/info_request_batch_controller.rb index 1e1030b53..f76f7abc2 100644 --- a/app/controllers/info_request_batch_controller.rb +++ b/app/controllers/info_request_batch_controller.rb @@ -2,6 +2,10 @@ class InfoRequestBatchController < ApplicationController def show @info_request_batch = InfoRequestBatch.find(params[:id]) + @per_page = 25 + @page = get_search_page_from_params + @info_requests = @info_request_batch.info_requests.all(:offset => (@page - 1) * @per_page, + :limit => @per_page) end end -- cgit v1.2.3 From e95b95e78891e2c0e7e0307464637b38ed8b5a4d Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 27 Nov 2013 17:44:35 +0000 Subject: Update notices for offline sending. --- app/controllers/info_request_batch_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/controllers/info_request_batch_controller.rb') diff --git a/app/controllers/info_request_batch_controller.rb b/app/controllers/info_request_batch_controller.rb index f76f7abc2..b66658757 100644 --- a/app/controllers/info_request_batch_controller.rb +++ b/app/controllers/info_request_batch_controller.rb @@ -4,8 +4,13 @@ class InfoRequestBatchController < ApplicationController @info_request_batch = InfoRequestBatch.find(params[:id]) @per_page = 25 @page = get_search_page_from_params - @info_requests = @info_request_batch.info_requests.all(:offset => (@page - 1) * @per_page, - :limit => @per_page) + if @info_request_batch.sent_at + @info_requests = @info_request_batch.info_requests.visible.all(:offset => (@page - 1) * @per_page, + :limit => @per_page) + else + @public_bodies = @info_request_batch.public_bodies.all(:offset => (@page - 1) * @per_page, + :limit => @per_page) + end end end -- cgit v1.2.3