linked into views
This commit is contained in:
BIN
app/assets/images/thumb-down-red.png
Normal file
BIN
app/assets/images/thumb-down-red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 311 B |
BIN
app/assets/images/thumb-down.png
Normal file
BIN
app/assets/images/thumb-down.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 282 B |
BIN
app/assets/images/thumb-up-green.png
Normal file
BIN
app/assets/images/thumb-up-green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 316 B |
BIN
app/assets/images/thumb-up.png
Normal file
BIN
app/assets/images/thumb-up.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 B |
12
app/assets/stylesheets/molecules/_review_meta.scss
Normal file
12
app/assets/stylesheets/molecules/_review_meta.scss
Normal file
@ -0,0 +1,12 @@
|
||||
.review_meta {
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
display: flex;
|
||||
& > div { flex: 1 1 auto; }
|
||||
}
|
||||
|
||||
.review_meta__votes,
|
||||
.review_meta__vetos {
|
||||
a { padding: 5px; }
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ class Candidate < ApplicationRecord
|
||||
has_many :questions, -> { order("sort") }, through: :quiz
|
||||
has_many :answers
|
||||
belongs_to :recruiter, class_name: "User"
|
||||
has_many :votes, class_name: "ReviewerVote"
|
||||
|
||||
serialize :email, CryptSerializer
|
||||
|
||||
@ -15,6 +16,12 @@ class Candidate < ApplicationRecord
|
||||
validates :email, uniqueness: true, presence: true, email_format: true
|
||||
validates :test_hash, uniqueness: true, presence: true
|
||||
|
||||
enum review_status: {
|
||||
# pending: 0,
|
||||
approved: 1,
|
||||
declined: 2
|
||||
}
|
||||
|
||||
def submitted_answers
|
||||
answers.where(submitted: true)
|
||||
end
|
||||
|
@ -1,10 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
class ReviewerVote < ApplicationRecord
|
||||
# validates :user_id, uniqueness: {scope: :friend_id}
|
||||
|
||||
belongs_to :candidate
|
||||
belongs_to :user
|
||||
|
||||
validates :user_id, uniqueness: { scope: :candidate_id }
|
||||
|
||||
enum vote: {
|
||||
undecided: 0,
|
||||
yea: 1,
|
||||
|
@ -15,6 +15,7 @@
|
||||
<th>Progress</th>
|
||||
<th>Completed</th>
|
||||
<th>Reminded</th>
|
||||
<th>Review Status</th>
|
||||
</tr>
|
||||
|
||||
<% @candidates.each do |candidate| %>
|
||||
@ -28,8 +29,9 @@
|
||||
</td>
|
||||
<td><%= candidate.experience %> years</td>
|
||||
<td><%= candidate.status %></td>
|
||||
<td><%= candidate.completed ? "Submitted" : "" %></td>
|
||||
<td><%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
|
||||
<td><%= candidate.reminded ? "Yes" : "" %></td>
|
||||
<td><%= candidate.review_status %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
@ -1,10 +1,33 @@
|
||||
<main class="summary_tpl">
|
||||
<h2 class="prft-heading">Quiz Review</h2>
|
||||
<p>
|
||||
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
|
||||
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
|
||||
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
|
||||
</p>
|
||||
|
||||
<div class="review_meta">
|
||||
<div>
|
||||
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
|
||||
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
|
||||
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
|
||||
</div>
|
||||
<div>
|
||||
<div class="review_meta__votes">
|
||||
<strong>Votes: </strong>
|
||||
<%= link_to '#cast-vote-up', remote: true do %>
|
||||
Yea (<%= @candidate.votes.yea.count %>)
|
||||
<% end %>
|
||||
<%= link_to '#cast-vote-down', remote: true do %>
|
||||
Nay (<%= @candidate.votes.nay.count %>)
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="review_meta__vetos">
|
||||
<strong>Manager Vetos: </strong>
|
||||
<%= link_to '#request', remote: true do %>
|
||||
Request Interview
|
||||
<% end %>
|
||||
<%= link_to '#decline', remote: true do %>
|
||||
Decline Interview
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% @quiz.each do |question| %>
|
||||
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
|
||||
|
Reference in New Issue
Block a user