From 170cc45a2031371f33c746baac3933fa7bc42127 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 20 Jun 2018 14:37:56 +0200 Subject: [PATCH] Shows message on index if officer has no shifts --- app/helpers/officers_helper.rb | 4 ++++ app/views/officing/dashboard/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/officers_helper.rb b/app/helpers/officers_helper.rb index 06dd041ed..1218af80e 100644 --- a/app/helpers/officers_helper.rb +++ b/app/helpers/officers_helper.rb @@ -12,4 +12,8 @@ module OfficersHelper current_user.poll_officer.officer_assignments.final.where(date: Time.current.to_date).any? end + def no_shifts? + current_user.poll_officer.officer_assignments.where(date: Time.current.to_date).blank? + end + end diff --git a/app/views/officing/dashboard/index.html.erb b/app/views/officing/dashboard/index.html.erb index 87ee59926..792786434 100644 --- a/app/views/officing/dashboard/index.html.erb +++ b/app/views/officing/dashboard/index.html.erb @@ -3,7 +3,7 @@

<%= t("officing.dashboard.index.info") %>

- <% unless final_recount_shift? && vote_collection_shift? %> + <% if no_shifts? %>
<%= t("officing.dashboard.index.no_shifts") %>