lock voting when interview status not pending
This commit is contained in:
@ -3,12 +3,21 @@
|
||||
<% if current_user.acts_as_reviewer? %>
|
||||
<div class="review_meta__votes" data-id="vote-count">
|
||||
<strong>Votes: </strong>
|
||||
<%= link_to admin_up_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Yea (<span data-id="up-votes"><%= @candidate.votes.yea.count %></span>)
|
||||
<% end %>
|
||||
<%= link_to admin_down_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Nay (<span data-id="down-votes"><%= @candidate.votes.nay.count %></span>)
|
||||
|
||||
<% if @candidate.pending? %>
|
||||
<%= link_to admin_up_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Yea (<span data-id="up-votes"><%= @candidate.votes.yea.count %></span>)
|
||||
<% end %>
|
||||
|
||||
<%= link_to admin_down_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Nay (<span data-id="down-votes"><%= @candidate.votes.nay.count %></span>)
|
||||
<% end %>
|
||||
<% else %>
|
||||
Voting closed -
|
||||
Yea (<%= @candidate.votes.yea.count %>) -
|
||||
Nay (<%= @candidate.votes.nay.count %>)
|
||||
<% end %>
|
||||
|
||||
<small>(Your vote: <span data-id="my-vote"><%= current_user.my_vote(@candidate) %></span>)</small>
|
||||
</div>
|
||||
<% end %>
|
||||
|
Reference in New Issue
Block a user