Shows message on index if officer has no shifts

This commit is contained in:
decabeza
2018-06-20 14:37:56 +02:00
committed by Javi Martín
parent 18e57b9662
commit 170cc45a20
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -3,7 +3,7 @@
<p><%= t("officing.dashboard.index.info") %></p>
<% unless final_recount_shift? && vote_collection_shift? %>
<% if no_shifts? %>
<div class="callout warning">
<%= t("officing.dashboard.index.no_shifts") %>
</div>