<% # TODO: This should be extracted into a decorator, or something. It is only a quick hack solution. %> <% if current_user.acts_as_reviewer? %>
Votes: <%= link_to admin_up_vote_path(test_hash: @candidate.test_hash), remote: true do %> Yea (<%= @candidate.votes.yea.count %>) <% end %> <%= link_to admin_down_vote_path(test_hash: @candidate.test_hash), remote: true do %> Nay (<%= @candidate.votes.nay.count %>) <% end %> (Your vote: <%= current_user.my_vote(@candidate) %>)
<% end %> <% if current_user.acts_as_manager? %>
Interview: <% if !@candidate.approved? %> <%= link_to admin_approve_vote_path(test_hash: @candidate.test_hash), remote: true do %> Yes <% end %> <% else %>Yes<% end %> <% if !@candidate.declined? %> <%= link_to admin_decline_vote_path(test_hash: @candidate.test_hash), remote: true do %> No <% end %> <% else %>No<% end %>
<% else %> Candidate Interview Status: <%= @candidate.review_status %> <% end %>