skill-assessment-app/app/views/admin/result/_voting.html.erb

47 lines
1.7 KiB
Plaintext
Raw Normal View History

<% # TODO: This should be extracted into a decorator, or something. It is only a quick hack solution. %>
2016-11-20 13:07:53 -06:00
<% if current_user.acts_as_reviewer? %>
<div class="review_meta__votes" data-id="vote-count">
<strong>Votes: </strong>
<% 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 %>)
2016-11-20 13:07:53 -06:00
<% end %>
2016-11-20 13:07:53 -06:00
<small>(Your vote: <span data-id="my-vote"><%= current_user.my_vote(@candidate) %></span>)</small>
</div>
<% end %>
<% if current_user.acts_as_manager? %>
<div class="review_meta__vetos">
<%= form_tag admin_interview_path(test_hash: @candidate.test_hash) do %>
<strong>Interview: </strong>
2016-11-20 13:07:53 -06:00
<%= radio_button_tag :review_status, :approved, checked = @candidate.approved? %>
<%= label_tag :review_status_approved, "Yes" %>
<%= radio_button_tag :review_status, :declined, checked = @candidate.declined? %>
<%= label_tag :review_status_declined, "No" %>
<div class="review-status-comments">
<span>Review comments for recruiter</span>
<%= text_area_tag :review_comments, @candidate.review_comments %>
<%= submit_tag 'Send Request' %>
</div>
<% end %>
</div>
2016-11-20 13:07:53 -06:00
<% else %>
<strong>Candidate Interview Status: </strong><%= @candidate.review_status %>
<% end %>