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

53 lines
2.0 KiB
Plaintext
Raw Normal View History

2016-11-20 13:07:53 -06:00
<% if current_user.acts_as_reviewer? %>
2017-03-20 10:57:50 -05:00
<div data-id="vote-count">
2016-11-20 13:07:53 -06:00
<strong>Votes: </strong>
2017-03-07 16:35:59 -06:00
<% if @candidate.pending? && current_user.commented_on?(@candidate.test_hash) %>
<%= 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 %>
2017-03-07 16:35:59 -06:00
<% elsif @candidate.pending? %>
<div>You must comment before you can vote</div>
<span>Yea (<span data-id="up-votes"><%= @candidate.votes.yea.count %></span>)</span>
<span>Nay (<span data-id="down-votes"><%= @candidate.votes.nay.count %></span>)</span>
<% 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? %>
2017-03-20 10:57:50 -05:00
<div>
<%= 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" %>
2017-03-20 10:57:50 -05:00
<div>
<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 %>
2017-03-07 16:35:59 -06:00
<% unless @candidate.review_status.blank? %>
<div>Review Status Comments:</div>
<div><%= @candidate.review_comments %></div>
<% end %>
2016-11-20 13:07:53 -06:00
<% end %>