Display 'validate document' menu item only when applicable

We are trying to avoid Officers from forgetting to click the “Confirm
vote” button, which is necessary to keep track of who has voted a Poll

To do that, we are not displaying the menu item to go back to the next
person that wants to vote, until the Officer clicks the “Confirm Vote”
button or the “The user has decided not to vote” button

Note: Due to mobile version we have duplicate ids, so using classes for
the menu items to hide them without errors

Note2: We are only hidding the menu item, if there are votable polls,
otherwise the “Confirm vote” button does not appear, and there is no
way of going back to help the next person that wants to vote
This commit is contained in:
rgarcia
2018-06-21 15:36:39 +02:00
committed by Javi Martín
parent 8125d470de
commit 151239924b
3 changed files with 48 additions and 3 deletions

View File

@@ -1,7 +1,9 @@
<div class="admin-sidebar" data-equalizer-watch>
<ul id="officing_menu">
<% if vote_collection_shift? %>
<li <%= "class=is-active" if controller_name == "voters" %>>
<li class="<%= "js-vote-collection" %>
<%= " is-active" if controller_name == "voters" %>
<%= " is-hidden" if controller_name == "voters" && Poll.votable_by(@user).any? %>">
<%= link_to new_officing_residence_path do %>
<span class="icon-user"></span>
<%= t("officing.menu.voters") %>