A very fine release.

This commit is contained in:
Mark Moser
2017-03-08 09:00:04 -06:00
96 changed files with 1816 additions and 284 deletions

View File

@ -16,6 +16,24 @@
<%= form.select :experience, experience_options(candidate.experience), include_blank: false %>
</div>
<div class="form-group">
<%= form.label :project, "Client or project" %>
<%= form.text_field :project %>
</div>
<div class="form-group">
<%= form.radio_button :position, 'full-time' %>
<%= form.label "position_full-time", "Full-time" %>
<%= form.radio_button :position, 'contract' %>
<%= form.label :position_contract, "Contract" %>
</div>
<div class="form-group">
<%= form.label :skill_needs, "Specific skill needs" %>
<%= form.text_field :skill_needs %>
</div>
<div class="form-group">
<%= form.label :quiz_id, "Quiz" %>
<%= form.select :quiz_id, quiz_options(quizzes, candidate.quiz_id), include_blank: (quizzes.size > 1) %>

View File

@ -9,14 +9,14 @@
<table cellspacing="0" cellpadding="0">
<tr>
<th>Candidate</th>
<th>Test ID</th>
<th>Email</th>
<th>Experience</th>
<th><%= sortable "name", "Candidate" %></th>
<th><%= sortable "test_hash", "Test ID" %></th>
<th><%= sortable "email" %></th>
<th><%= sortable "experience" %></th>
<th>Progress</th>
<th>Completed</th>
<th>Reminded</th>
<th>Interview Request</th>
<th><%= sortable "completed_at", "Completed" %></th>
<th><%= sortable "reminded" %></th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
@ -32,8 +32,9 @@
<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>
<%= paginate @candidates %>
</main>

View File

@ -0,0 +1 @@
{ "message" : "Email queued!" }

View File

@ -0,0 +1,23 @@
<div class="comment-message">
<%= comment.message %>
<% if policy(comment).update? %>
<label class="comment-edit-btn" for="comment-<%= comment.id %>">edit</label>
<% end %>
<% if comment.edits? %>
<div class="comment-edit-stamp">Updated <%= time_ago_in_words(comment.updated_at) %> ago</div>
<% else %>
<div class="comment-edit-stamp"><%= time_ago_in_words(comment.created_at) %> ago</div>
<% end %>
</div>
<div class="comment-author"><%= comment.user.name %></div>
<% if policy(comment).update? %>
<input type="checkbox" id="comment-<%= comment.id %>">
<div class="comment-edit-form">
<%= render partial: 'comment_form', locals: {comment: comment, test_hash: comment.test_hash } %>
</div>
<% end %>

View File

@ -0,0 +1,23 @@
<% if comment.id.nil? %>
<%= form_for comment, url: admin_create_comment_path(test_hash: test_hash), method: :post do |form| %>
<div class="form-group">
<%= form.label :message, "New Comment" %>
<%= form.text_area :message %>
</div>
<%= submit_tag "Save Comment" %>
<% end %>
<% else %>
<%= form_for comment, url: admin_update_comment_path(test_hash: test_hash, id: comment.id), method: :post do |form| %>
<div class="form-group">
<%= form.label :message, "Update Comment" %>
<%= form.text_area :message %>
</div>
<%= submit_tag "Update" %>
<% end %>
<% end %>

View File

@ -1,34 +1,54 @@
<% # 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">
<strong>Votes: </strong>
<%= 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>)
<% 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 %>
<% 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 %>)
<% end %>
<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" 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>
<div class="review_meta__vetos">
<%= form_tag admin_interview_path(test_hash: @candidate.test_hash) do %>
<strong>Interview: </strong>
<%= 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>
<% else %>
<strong>Candidate Interview Status: </strong><%= @candidate.review_status %>
<% unless @candidate.review_status.blank? %>
<div>Review Status Comments:</div>
<div><%= @candidate.review_comments %></div>
<% end %>
<% end %>

View File

@ -5,19 +5,24 @@
<main class="summary_tpl">
<table cellspacing="0" cellpadding="0">
<tr>
<th>Test ID</th>
<th>Experience</th>
<th><%= sortable "test_hash", "Test ID" %></th>
<th><%= sortable "name" %></th>
<th><%= sortable "project", "Client/Project" %></th>
<th>Recruiter</th>
<th>Interview Request</th>
<th><%= sortable "completed_at", "Submitted on" %></th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
<tr>
<td><%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %></td>
<td><%= candidate.experience %> years</td>
<td><%= candidate.name if !candidate.pending? %></td>
<td><%= candidate.project %></td>
<td><%= mail_to(candidate.recruiter.email) %></td>
<td><%= candidate.review_status unless candidate.pending? %></td>
<td><%= candidate.completed_at.strftime('%D') unless candidate.completed_at.nil? %></td>
<td><%= candidate.interview? %></td>
</tr>
<% end %>
</table>
<%= paginate @candidates %>
</main>

View File

@ -2,41 +2,65 @@
content_for :title, "Quiz Review - Skills Assessment Admin"
%>
<main class="summary_tpl admin-review">
<h2 class="prft-heading">Quiz Review</h2>
<div class="summary_tpl">
<div class="admin-review">
<h2 class="prft-heading">Quiz Review</h2>
<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 class="review_meta">
<div>
<% unless @candidate.pending? %>
<strong>Name:</strong> <%= @candidate.name %><br />
<% end %>
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
<strong>Client/Project:</strong> <%= @candidate.project %><br />
<strong>Position Type:</strong> <%= @candidate.position %><br />
<strong>Skill Needs:</strong> <%= @candidate.skill_needs %><br />
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
</div>
</div>
<div><%= render partial: 'voting' %></div>
<% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
<div class="question-heading">
<div class="question-title">
<h3><%= question.question %></h3>
</div>
</div>
<div class="answer-container">
<% if question.attachment.present? %>
<%= image_tag question.attachment %>
<% end %>
<fieldset disabled class="answer-block">
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset>
</div>
</article>
<% end #form_tag %>
<% end #questions loop %>
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
<button>Back to list</button>
<% end %>
</div>
<% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
<div class="question-heading">
<div class="question-title">
<h3><%= question.question %></h3>
</div>
</div>
<div class="review-comments">
<div>
<h2 class="prft-heading">Voting</h2>
<div class="review_meta">
<div><%= render partial: 'voting' %></div>
</div>
</div>
<div class="answer-container">
<% if question.attachment.present? %>
<%= image_tag question.attachment %>
<% end %>
<fieldset disabled class="answer-block">
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset>
</div>
</article>
<% end #form_tag %>
<% end #questions loop %>
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
<button>Back to list</button>
<% end %>
</main>
<div>
<h2 id="comment-header" class="prft-heading">Comments</h2>
<% if policy(QuizComment).new? %>
<%= render partial: 'comment_form', locals: {comment: @comment, test_hash: @candidate.test_hash } %>
<% end %>
<%= render partial: 'comment', collection: @comments, locals: { test_hash: @candidate.test_hash } %>
<a href="#comment-header">Back to top</a>
</div>
</div>
</div>

View File

@ -1,8 +1,8 @@
<table cellspacing="0" cellpadding="0">
<tr>
<th>User</th>
<th>Email</th>
<th>Role</th>
<th><%= sortable "name", "User" %></th>
<th><%= sortable "email" %></th>
<th><%= sortable "role" %></th>
<th></th>
</tr>

View File

@ -0,0 +1,6 @@
{
"message" : "Vote Counted",
"upCount" : <%= @candidate.votes.yea.count %>,
"downCount" : <%= @candidate.votes.nay.count %>,
"myVote" : "nay"
}

View File

@ -0,0 +1,6 @@
{
"message" : "Vote Counted",
"upCount" : <%= @candidate.votes.yea.count %>,
"downCount" : <%= @candidate.votes.nay.count %>,
"myVote" : "yea"
}

View File

@ -23,7 +23,7 @@
<table>
<tr>
<td class="email-copyright">
&copy;2016 All Rights Reserved - Perficient Digital
&copy;2016-<%= Time.now.year %> All Rights Reserved - Perficient Digital
</td>
<td class="email-logo">
<%= image_tag(attachments["perficientdigital-logo.jpg"].url, alt:"Perficient Digital") %>

View File

@ -7,8 +7,9 @@
<strong>Candidate email:</strong> <%= @candidate.email %><br />
<strong>Candidate ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of experience:</strong> <%= @candidate.experience %> Years<br />
<strong>Client/Project:</strong> <%= @candidate.project %><br />
</p>
<p>You will be notified when the candidate has finished taking the test.</p>
</columns>
</row>
</row>

View File

@ -6,5 +6,6 @@ Candidate name: <%= @candidate.name %>
Candidate email: <%= @candidate.email %>
Candidate ID: <%= @candidate.test_hash %>
Years of experience: <%= @candidate.experience %> Years
Client/Project: <%= @candidate.project %>
You will be notified when the candidate has finished taking the test.

View File

@ -0,0 +1,9 @@
<row>
<columns class="email-body">
<p>The team has <%= @candidate.review_status %> an interview with <strong><%= @candidate.name %></strong> with the following comments:</p>
<p><%= @candidate.review_comments %></p>
<p>Thank you</p>
</columns>
</row>

View File

@ -0,0 +1,7 @@
PERFICIENT/digital - Skills Assessment Test
The team has <%= @candidate.review_status %> an interview with <%= @candidate.name %> with the following comments:
<%= @candidate.review_comments %>
Thank you.

View File

@ -1,6 +1,6 @@
<row>
<columns class="email-body">
<p><strong><%= @candidate.name %></strong> has completed the Skills Assessment Test.</p>
<p><strong>Martin Ridgway</strong> will let you know if we would like to interview this candidate.</p>
<p><strong><%= @candidate.manager.name %></strong> will let you know if we would like to interview this candidate.</p>
</columns>
</row>
</row>

View File

@ -1,4 +1,4 @@
PERFICIENT/digital - Skills Assessment Test
<%= @candidate.name %> has completed the Skills Assessment Test.
Martin Ridgway will let you know if we would like to interview this candidate.
<%= @candidate.manager.name %> will let you know if we would like to interview this candidate.

View File

@ -1,6 +1,9 @@
<row>
<columns class="email-body">
<p>Candidate <strong><%= @candidate.test_hash %></strong> has completed the Skills Assessment Test.</p>
<p>
Candidate <strong><%= @candidate.test_hash %></strong> has completed the
Skills Assessment Test for client/project <%= @candidate.project %>.
</p>
<p>You can view the results here: <%= link_to nil, admin_result_url(@candidate.test_hash) %>.</p>
</columns>
</row>

View File

@ -1,5 +1,5 @@
PERFICIENT/digital SKILLS ASSESSMENT RESULTS
Candidate <%= @candidate.test_hash %> has completed the Skills Assessment Test.
Candidate <%= @candidate.test_hash %> has completed the Skills Assessment Test for client/project <%= @candidate.project %>.
You can view the results here: <%= admin_result_url(@candidate.test_hash) %>.

View File

@ -0,0 +1,13 @@
<row>
<columns class="email-body">
<p>
<%= @comment.user.name %> wrote a comment for quiz <%= @comment.test_hash %>
</p>
<p style="border-top: 1px solid; border-bottom: 1px solid;">
<%= @comment.message %>
</p>
<p>You can view and reply here: <%= link_to nil, admin_result_url(@comment.test_hash) %>.</p>
</columns>
</row>

View File

@ -0,0 +1,9 @@
SKILLS ASSESSMENT RESULT COMMENT
<%= @comment.user.name %> wrote a comment for quiz <%= @comment.test_hash %>
--- --- --- ---
<%= @comment.message %>
--- --- --- ---
You can view and reply here: <%= admin_result_url(@comment.test_hash) %>.

View File

@ -0,0 +1,10 @@
<row>
<columns class="email-body">
<p>Hello <%= @manager.name %>,</p>
<p>
Everyone has voted and you need to request or decline an interview for
<%= link_to nil, admin_result_url(@candidate.test_hash) %>
</p>
</columns>
</row>

View File

@ -0,0 +1,6 @@
PERFICIENT/digital SKILLS ASSESSMENT RESULTS
Hello <%= @manager.name %>,
Everyone has voted and you need to request or decline an interview for
<%= admin_result_url(@candidate.test_hash) %>

View File

@ -0,0 +1,9 @@
<row>
<columns class="email-body">
<p>Hello <%= @reminder.name %>,</p>
<p>
Please review and vote on the results for <%= link_to nil, admin_result_url(@reminder.test_hash) %>
</p>
</columns>
</row>

View File

@ -0,0 +1,5 @@
PERFICIENT/digital SKILLS ASSESSMENT RESULTS
Hello <%= @reminder.name %>,
Please review and vote on the results for <%= admin_result_url(@reminder.test_hash) %>.