move recruiter to admin/candidate

This commit is contained in:
Mark Moser
2016-09-22 13:30:30 -05:00
parent 47d7188a2f
commit 9078c463f4
25 changed files with 383 additions and 327 deletions

View File

@ -0,0 +1,25 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: candidate } %>
<%= form_for candidate, url: action, method: :post do |form| %>
<div class="form-group">
<%= form.label :name, "Candidate name" %>
<%= form.text_field :name %>
</div>
<div class="form-group">
<%= form.label :email, "Candidate email" %>
<%= form.email_field :email %>
</div>
<div class="form-group">
<%= form.label :experience, "Years of experience" %>
<%= form.select :experience, experience_options(candidate.experience), include_blank: false %>
</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) %>
</div>
<%= submit_tag %>
<% end %>

View File

@ -0,0 +1,6 @@
<main class="intro_tpl">
<h1>Edit: <%= @candidate.name %></h1>
<p><strong>Test ID: </strong><%= @candidate.test_hash %></p>
<%= render partial: 'form', locals: { action: admin_update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %>
</main>

View File

@ -0,0 +1,35 @@
<main class="summary_tpl">
<h1>Candidates</h1>
<%= link_to(admin_new_candidate_path, { class: 'secondary-btn' }) do %>
<button>Create New Candidate</button>
<% end %>
<table cellspacing="0" cellpadding="0">
<tr>
<th>Candidate</th>
<th>Test ID</th>
<th>Email</th>
<th>Experience</th>
<th>Progress</th>
<th>Completed</th>
<th>Reminded</th>
</tr>
<% @candidates.each do |candidate| %>
<tr>
<td><%= link_to candidate.name, admin_edit_candidate_path(candidate.id) %></td>
<td><%= candidate.test_hash %></td>
<td>
<%= mail_to(candidate.email) %>
<br />
<%= link_to "resend welcome email", admin_resend_welcome_path(candidate.id), remote: true, class: '', data: { id: 'ajax-action' } %>
</td>
<td><%= candidate.experience %> years</td>
<td><%= candidate.status %></td>
<td><%= candidate.completed ? "Submitted" : "" %></td>
<td><%= candidate.reminded ? "Yes" : "" %></td>
</tr>
<% end %>
</table>
</main>

View File

@ -0,0 +1,6 @@
<main class="intro_tpl">
<h1>New Candidate</h1>
<%= render partial: 'form', locals:
{ action: admin_create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>
</main>