diff --git a/app/controllers/admin/poll/shifts_controller.rb b/app/controllers/admin/poll/shifts_controller.rb index 89bb68999..1261f2951 100644 --- a/app/controllers/admin/poll/shifts_controller.rb +++ b/app/controllers/admin/poll/shifts_controller.rb @@ -6,6 +6,8 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController def new load_shifts @shift = ::Poll::Shift.new + @voting_polls = @booth.polls.current_or_incoming + @recount_polls = @booth.polls.current_or_recounting_or_incoming end def create diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb index 3a55feb4f..7ea17baf2 100644 --- a/app/helpers/shifts_helper.rb +++ b/app/helpers/shifts_helper.rb @@ -1,10 +1,12 @@ module ShiftsHelper def shift_vote_collection_dates(booth, polls) + return [] if polls.blank? date_options((start_date(polls)..end_date(polls)), Poll::Shift.tasks[:vote_collection], booth) end def shift_recount_scrutiny_dates(booth, polls) + return [] if polls.blank? dates = polls.map(&:ends_at).map(&:to_date).sort.inject([]) do |total, date| initial_date = date < Date.current ? Date.current : date total << (initial_date..date + Poll::RECOUNT_DURATION).to_a diff --git a/app/views/admin/poll/shifts/_form.html.erb b/app/views/admin/poll/shifts/_form.html.erb index 07e07381f..230864218 100644 --- a/app/views/admin/poll/shifts/_form.html.erb +++ b/app/views/admin/poll/shifts/_form.html.erb @@ -3,7 +3,7 @@