completes #84 : interview request status tweaks

This commit is contained in:
Mark Moser 2016-11-28 15:40:25 -06:00
parent f94de75f01
commit bcb840c986
4 changed files with 25 additions and 17 deletions

View File

@ -23,6 +23,11 @@ class Candidate < ApplicationRecord
declined: 2
}
def interview?
return 'yes' if approved?
'no' if declined?
end
def build_reviews
reviewers.each do |reviewer|
votes.find_or_create_by(user_id: reviewer.id)

View File

@ -16,7 +16,7 @@
<th>Progress</th>
<th>Completed</th>
<th>Reminded</th>
<th>Interview Request</th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
@ -32,7 +32,7 @@
<td><%= candidate.status %></td>
<td><%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
<td><%= candidate.reminded ? "Yes" : "" %></td>
<td><%= candidate.review_status unless candidate.pending? %></td>
<td><%= candidate.interview? %></td>
</tr>
<% end %>
</table>

View File

@ -1,4 +1,4 @@
<% # TODO: This needs to be extracted into a decorator, or something. It is only a quick hack solution. %>
<% # TODO: This should be extracted into a decorator, or something. It is only a quick hack solution. %>
<% if current_user.acts_as_reviewer? %>
<div class="review_meta__votes" data-id="vote-count">
@ -15,19 +15,22 @@
<% if current_user.acts_as_manager? %>
<div class="review_meta__vetos" data-id="veto-status">
<strong>Manager Vetos: </strong>
<%= link_to admin_approve_vote_path(test_hash: @candidate.test_hash), remote: true do %>
<span data-id="interview-request">
<%= @candidate.approved? ? "Requested" : "Request Interview" %>
</span>
<% end %>
<%= link_to admin_decline_vote_path(test_hash: @candidate.test_hash), remote: true do %>
<span data-id="interview-decline">
<%= @candidate.declined? ? "Declined" : "Decline Interview" %>
</span>
<% end %>
</div>
<strong>Interview: </strong>
<% if !@candidate.approved? %>
<%= link_to admin_approve_vote_path(test_hash: @candidate.test_hash), remote: true do %>
<span data-id="interview-request">Yes</span>
<% end %>
<% else %>Yes<% end %>
<% if !@candidate.declined? %>
<%= link_to admin_decline_vote_path(test_hash: @candidate.test_hash), remote: true do %>
<span data-id="interview-decline">No</span>
<% end %>
<% else %>No<% end %>
</div>
<% else %>
<strong>Candidate Interview Status: </strong><%= @candidate.review_status %>

View File

@ -8,7 +8,7 @@
<th>Test ID</th>
<th>Experience</th>
<th>Recruiter</th>
<th>Interview Request</th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
@ -16,7 +16,7 @@
<td><%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %></td>
<td><%= candidate.experience %> years</td>
<td><%= mail_to(candidate.recruiter.email) %></td>
<td><%= candidate.review_status unless candidate.pending? %></td>
<td><%= candidate.interview? %></td>
</tr>
<% end %>
</table>