2016-11-28 15:40:25 -06:00
|
|
|
<% # 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>
|
2016-12-04 16:19:16 -06:00
|
|
|
|
2017-03-07 16:35:59 -06:00
|
|
|
<% if @candidate.pending? && current_user.commented_on?(@candidate.test_hash) %>
|
2016-12-04 16:19:16 -06:00
|
|
|
<%= 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>
|
2016-12-04 16:19:16 -06:00
|
|
|
<% else %>
|
|
|
|
Voting closed -
|
|
|
|
Yea (<%= @candidate.votes.yea.count %>) -
|
|
|
|
Nay (<%= @candidate.votes.nay.count %>)
|
2016-11-20 13:07:53 -06:00
|
|
|
<% end %>
|
2016-12-04 16:19:16 -06:00
|
|
|
|
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-02 10:32:02 -06:00
|
|
|
<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
|
|
|
|
2017-03-02 10:32:02 -06:00
|
|
|
<%= radio_button_tag :review_status, :approved, checked = @candidate.approved? %>
|
|
|
|
<%= label_tag :review_status_approved, "Yes" %>
|
2016-11-28 15:40:25 -06:00
|
|
|
|
2017-03-02 10:32:02 -06:00
|
|
|
<%= radio_button_tag :review_status, :declined, checked = @candidate.declined? %>
|
|
|
|
<%= label_tag :review_status_declined, "No" %>
|
2016-11-28 15:40:25 -06:00
|
|
|
|
2017-03-02 10:32:02 -06:00
|
|
|
<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 %>
|
2016-11-28 15:40:25 -06:00
|
|
|
</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 %>
|