html reset
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<nav>
|
||||
<nav aria-label="Admin Menu">
|
||||
<%= link_to("Users", admin_users_url) if policy(User).index? %>
|
||||
<% #= link_to("Departments", admin_departments_url) if policy(Department).index? %>
|
||||
<%= link_to("Quizzes", admin_quizzes_url) if policy(Quiz).index? %>
|
||||
|
@ -1,23 +1,20 @@
|
||||
<%
|
||||
content_for :main_class, "intro_tpl"
|
||||
content_for :title, "Skills Assessment Admin"
|
||||
%>
|
||||
<% content_for :title, "Skills Assessment Admin" %>
|
||||
|
||||
<h1>Admin Login</h1>
|
||||
|
||||
<%= form_for :auth, url: admin_login_path do |form| %>
|
||||
<% if flash[:error].present? %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
Need a <%= link_to "password reset", admin_reset_request_path %>?
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :email %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :password %>
|
||||
<%= form.password_field :password %>
|
||||
</div>
|
||||
|
@ -1,22 +1,18 @@
|
||||
<%
|
||||
content_for :main_class, "intro_tpl"
|
||||
content_for :title, "Skills Assessment Admin"
|
||||
%>
|
||||
<% content_for :title, "Skills Assessment Admin" %>
|
||||
|
||||
<h1>Password Reset</h1>
|
||||
|
||||
<%= form_for :auth, url: admin_reset_password_path do |form| %>
|
||||
<%= hidden_field_tag :reset_token, params[:reset_token] %>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :password %>
|
||||
<%= form.password_field :password %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :password_confirmation %>
|
||||
<%= form.password_field :password_confirmation %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag "Reset Password" %>
|
||||
<%= hidden_field_tag :reset_token, params[:reset_token] %>
|
||||
<% end %>
|
||||
|
@ -1,12 +1,9 @@
|
||||
<%
|
||||
content_for :main_class, "intro_tpl"
|
||||
content_for :title, "Skills Assessment Admin"
|
||||
%>
|
||||
<% content_for :title, "Skills Assessment Admin" %>
|
||||
|
||||
<h1>Password Reset</h1>
|
||||
<%= form_for :auth, url: admin_send_reset_path do |form| %>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :email %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
@ -1,27 +1,27 @@
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: candidate } %>
|
||||
|
||||
<%= form_for candidate, url: action, method: :post do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :name, "Candidate name" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :email, "Candidate email" %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :experience, "Years of experience" %>
|
||||
<%= form.select :experience, experience_options(candidate.experience), include_blank: false %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :project, "Client or project" %>
|
||||
<%= form.text_field :project %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.radio_button :position, 'full-time' %>
|
||||
<%= form.label "position_full-time", "Full-time" %>
|
||||
|
||||
@ -29,12 +29,12 @@
|
||||
<%= form.label :position_contract, "Contract" %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :skill_needs, "Specific skill needs" %>
|
||||
<%= form.text_field :skill_needs %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :quiz_id, "Quiz" %>
|
||||
<%= form.select :quiz_id, quiz_options(quizzes, candidate.quiz_id), include_blank: (quizzes.size > 1) %>
|
||||
</div>
|
||||
|
@ -1,10 +1,7 @@
|
||||
<%
|
||||
content_for :title, "Edit Candidate - Skills Assessment Admin"
|
||||
%>
|
||||
<% content_for :title, "Edit Candidate - Skills Assessment Admin" %>
|
||||
|
||||
<main class="intro_tpl">
|
||||
<h1>Edit: <%= @candidate.name %></h1>
|
||||
<p><strong>Test ID: </strong><%= @candidate.test_hash %></p>
|
||||
<h1>Edit: <%= @candidate.name %></h1>
|
||||
|
||||
<%= render partial: 'form', locals: { action: admin_update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %>
|
||||
</main>
|
||||
<div><strong>Test ID: </strong><%= @candidate.test_hash %></div>
|
||||
|
||||
<%= render partial: 'form', locals: { action: admin_update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %>
|
||||
|
@ -2,39 +2,37 @@
|
||||
content_for :section_title, "Candidates"
|
||||
content_for :title, "Candidates - Skills Assessment Admin"
|
||||
%>
|
||||
<main class="summary_tpl">
|
||||
<%= link_to(admin_new_candidate_path, { class: 'secondary-btn' }) do %>
|
||||
<button>Create New Candidate</button>
|
||||
<% end if policy(Candidate).create? %>
|
||||
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<%= link_to("Create New Candidate", admin_new_candidate_path, { class: "" }) if policy(Candidate).create? %>
|
||||
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th><%= sortable "name", "Candidate" %></th>
|
||||
<th><%= sortable "test_hash", "Test ID" %></th>
|
||||
<th><%= sortable "email" %></th>
|
||||
<th><%= sortable "experience" %></th>
|
||||
<th>Progress</th>
|
||||
<th><%= sortable "completed_at", "Completed" %></th>
|
||||
<th><%= sortable "reminded" %></th>
|
||||
<th>Interview?</th>
|
||||
</tr>
|
||||
|
||||
<% @candidates.each do |candidate| %>
|
||||
<tr>
|
||||
<th><%= sortable "name", "Candidate" %></th>
|
||||
<th><%= sortable "test_hash", "Test ID" %></th>
|
||||
<th><%= sortable "email" %></th>
|
||||
<th><%= sortable "experience" %></th>
|
||||
<th>Progress</th>
|
||||
<th><%= sortable "completed_at", "Completed" %></th>
|
||||
<th><%= sortable "reminded" %></th>
|
||||
<th>Interview?</th>
|
||||
<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 ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
|
||||
<td><%= candidate.reminded ? "Yes" : "" %></td>
|
||||
<td><%= candidate.interview? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<% @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 ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
|
||||
<td><%= candidate.reminded ? "Yes" : "" %></td>
|
||||
<td><%= candidate.interview? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<%= paginate @candidates %>
|
||||
</main>
|
||||
<%= paginate @candidates %>
|
||||
|
@ -1,10 +1,6 @@
|
||||
<%
|
||||
content_for :title, "New Candidate - Skills Assessment Admin"
|
||||
%>
|
||||
<% content_for :title, "New Candidate - Skills Assessment Admin" %>
|
||||
|
||||
<main class="intro_tpl">
|
||||
<h1>New Candidate</h1>
|
||||
<h1>New Candidate</h1>
|
||||
|
||||
<%= render partial: 'form', locals:
|
||||
{ action: admin_create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>
|
||||
</main>
|
||||
<%= render partial: 'form', locals:
|
||||
{ action: admin_create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>
|
||||
|
@ -4,23 +4,24 @@
|
||||
%>
|
||||
|
||||
<%= render partial: 'shared/form_model_errors', locals: {obj: @user} %>
|
||||
|
||||
<%= form_for @user, url: admin_profile_url, method: :post do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :name, "Full Name" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :email, "eMail" %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :password, "New Password" %>
|
||||
<%= form.password_field :password %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :password_confirmation, "New Password Confirmation" %>
|
||||
<%= form.password_field :password_confirmation %>
|
||||
</div>
|
||||
|
@ -3,7 +3,8 @@
|
||||
content_for :title, "Profile - Skills Assessment Admin"
|
||||
%>
|
||||
|
||||
<p>Name: <%= current_user.name %></p>
|
||||
<p>email: <%= current_user.email %></p>
|
||||
<p>Role: <%= current_user.role %></p>
|
||||
<%= link_to('Edit', admin_edit_profile_path, { class: 'btn' }) %>
|
||||
<div>Name: <%= current_user.name %></div>
|
||||
<div>email: <%= current_user.email %></div>
|
||||
<div>Role: <%= current_user.role %></div>
|
||||
|
||||
<%= link_to('Edit', admin_edit_profile_path, { class: "" }) %>
|
||||
|
@ -9,10 +9,8 @@
|
||||
</ul>
|
||||
|
||||
<% unless (disable ||= false) %>
|
||||
<div class="form-group">
|
||||
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
|
||||
<li style="display: none;">
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</li>
|
||||
<div> Add option </div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -12,10 +12,8 @@
|
||||
</ul>
|
||||
|
||||
<% unless (disable ||= false) %>
|
||||
<div class="form-group">
|
||||
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
|
||||
<li style="display: none;">
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</li>
|
||||
<div>Add option</div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,45 +1,44 @@
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: question} %>
|
||||
|
||||
<%= form_for question, url: action do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :quiz_id, 'Quiz' %>
|
||||
<%= form.select :quiz_id, options_for_select(@quizzes.map{ |q| [q.name, q.id] }, question.quiz_id), include_blank: (@quizzes.size > 1) %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :category, 'Category' %>
|
||||
<%= form.text_field :category %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :sort, 'Sort' %>
|
||||
<%= form.text_field :sort %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.check_box :active %>
|
||||
<%= form.label :active, 'Active' %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :question, "Question" %>
|
||||
<%= form.text_area :question %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :attachment, "Attachment URL" %>
|
||||
<%= form.text_field :attachment %>
|
||||
|
||||
<% if @question.attachment.present? %>
|
||||
<p><%= image_tag @question.attachment %></p>
|
||||
<% end %>
|
||||
<%= image_tag @question.attachment if @question.attachment.present? %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :input_type, 'Input Type' %>
|
||||
<%= form.select :input_type, question_type_options(question.input_type), { include_blank: false }, { data: { qid: question.id } } %>
|
||||
</div>
|
||||
|
||||
<div class="form-group" data-id="input-options-wrapper">
|
||||
<div>
|
||||
<%= fields_for @question do |fields| %>
|
||||
<% partial = question.input_type.blank? ? 'admin/question/text' : "admin/question/#{question.input_type}" %>
|
||||
<%= render partial: partial, locals: {question: question, fields: fields } %>
|
||||
|
@ -9,10 +9,8 @@
|
||||
</ul>
|
||||
|
||||
<% unless (disable ||= false) %>
|
||||
<div class="form-group">
|
||||
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
|
||||
<li style="display: none;">
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</li>
|
||||
<div>Add option</div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,21 +1,17 @@
|
||||
<strong>Radio Options</strong>
|
||||
|
||||
<ul data-id="input_option_list">
|
||||
<ul>
|
||||
<% question.input_options.each do | option | %>
|
||||
<li>
|
||||
<%= text_field_tag 'question[multi_choice][]', option, { disabled: (disable ||= false), data: { last: option } } %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Other: <input type="text" disabled="disabled" /></li>
|
||||
</ul>
|
||||
|
||||
<% unless (disable ||= false) %>
|
||||
<div class="form-group">
|
||||
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
|
||||
<li style="display: none;">
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</li>
|
||||
<div>Add option</div>
|
||||
<div>
|
||||
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<td><%= question.input_type %></td>
|
||||
<td><%= question.category %></td>
|
||||
<td><%= question.active unless question.active? %></td>
|
||||
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: 'btn tertiary-btn' } %></td>
|
||||
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: "" } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
@ -4,4 +4,5 @@
|
||||
%>
|
||||
|
||||
<h1><%= @question.quiz.name %></h1>
|
||||
|
||||
<%= render partial: 'form', locals: {question: @question, action: admin_update_question_path } %>
|
||||
|
@ -7,5 +7,5 @@
|
||||
<% quizzes.each do |quiz, questions| %>
|
||||
<h1><%= quiz %></h1>
|
||||
<%= render partial: 'admin/question/table_list', locals: { questions: questions } %>
|
||||
<%= link_to('Edit Quiz', admin_quiz_path(questions.first.quiz.to_i), { class: 'btn' }) %>
|
||||
<%= link_to('Edit Quiz', admin_quiz_path(questions.first.quiz.to_i), { class: "" }) %>
|
||||
<% end %>
|
||||
|
@ -3,39 +3,30 @@
|
||||
content_for :title, "Question - Skills Assessment Admin"
|
||||
%>
|
||||
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th>Category</th>
|
||||
<td><%= @question.category %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<td><%= @question.input_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Sort</th>
|
||||
<td><%= @question.sort %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
|
||||
<%= label_tag 'question_active', 'Active' %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h1><%= @question.quiz.name %></h1>
|
||||
|
||||
<strong>Question</strong>
|
||||
<p><%= @question.question %></p>
|
||||
<h2>Category</h2>
|
||||
<div><%= @question.category %></div>
|
||||
|
||||
<% if @question.attachment.present? %>
|
||||
<p><%= image_tag @question.attachment %></p>
|
||||
<% end %>
|
||||
<h2>Type</h2>
|
||||
<div><%= @question.input_type %></div>
|
||||
|
||||
<h2>Sort</h2>
|
||||
<div><%= @question.sort %></div>
|
||||
|
||||
<div>
|
||||
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
|
||||
<%= label_tag 'question_active', 'Active' %>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Question</h2>
|
||||
<div><%= @question.question %></div>
|
||||
<div><%= image_tag @question.attachment if @question.attachment.present? %></div>
|
||||
|
||||
<%= fields_for @question do |fields| %>
|
||||
<%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: 'btn' }) %>
|
||||
|
||||
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: 'btn' }) %>
|
||||
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: "" }) %>
|
||||
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: "" }) %>
|
||||
|
@ -1,16 +1,16 @@
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: quiz} %>
|
||||
<%= form_for quiz, url: action do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :name, "Quiz Description" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :dept, 'Department' %>
|
||||
<%= form.text_field :dept %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :unit, 'Unit' %>
|
||||
<%= form.text_field :unit %>
|
||||
</div>
|
||||
|
@ -13,7 +13,7 @@
|
||||
<td><%= quiz.dept %></td>
|
||||
<td><%= quiz.unit %></td>
|
||||
<td><%= quiz.questions.count %></td>
|
||||
<td><%= link_to 'edit', admin_edit_quiz_path(quiz.to_i), { class: 'btn tertiary-btn' } if policy(quiz).edit? %></td>
|
||||
<td><%= link_to 'edit', admin_edit_quiz_path(quiz.to_i), { class: "" } if policy(quiz).edit? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
@ -1,5 +1,3 @@
|
||||
<%
|
||||
content_for :section_title, "Edit: #{@quiz.name}"
|
||||
%>
|
||||
<% content_for :section_title, "Edit: #{@quiz.name}" %>
|
||||
|
||||
<%= render partial: 'form', locals: { quiz: @quiz, action: admin_update_quiz_path } %>
|
||||
|
@ -4,4 +4,4 @@
|
||||
%>
|
||||
|
||||
<%= render partial: 'admin/quiz/table_list', locals: { quizzes: @quizzes } %>
|
||||
<%= link_to('New Quiz', admin_new_quiz_path, { class: 'btn' }) %>
|
||||
<%= link_to('New Quiz', admin_new_quiz_path, { class: "" }) %>
|
||||
|
@ -3,10 +3,10 @@
|
||||
content_for :title, "Quiz - Skills Assessment Admin"
|
||||
%>
|
||||
|
||||
<p><%= @quiz.name %></p>
|
||||
<p><%= @quiz.dept %></p>
|
||||
<p><%= @quiz.unit %></p>
|
||||
<%= link_to('Edit', admin_edit_quiz_path(@quiz.to_i), { class: 'btn' }) %>
|
||||
<div><%= @quiz.name %></div>
|
||||
<div><%= @quiz.dept %></div>
|
||||
<div><%= @quiz.unit %></div>
|
||||
<%= link_to('Edit', admin_edit_quiz_path(@quiz.to_i), { class: "" }) %>
|
||||
|
||||
<%= render partial: 'admin/question/table_list', locals: { questions: @quiz.questions, disable: true } %>
|
||||
<%= link_to('New Question', admin_new_question_path, { class: 'btn' }) %>
|
||||
<%= link_to('New Question', admin_new_question_path, { class: "" }) %>
|
||||
|
@ -1,23 +1,20 @@
|
||||
<div class="comment-message">
|
||||
<div>
|
||||
<%= comment.message %>
|
||||
|
||||
<% if policy(comment).update? %>
|
||||
<label class="comment-edit-btn" for="comment-<%= comment.id %>">edit</label>
|
||||
<label class="" 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>
|
||||
<div>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>
|
||||
<div><%= time_ago_in_words(comment.created_at) %> ago</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="comment-author"><%= comment.user.name %></div>
|
||||
|
||||
<div><%= 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>
|
||||
<%= render partial: 'comment_form', locals: {comment: comment, test_hash: comment.test_hash } %>
|
||||
<% end %>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<% if comment.id.nil? %>
|
||||
|
||||
<%= form_for comment, url: admin_create_comment_path(test_hash: test_hash), method: :post do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :message, "New Comment" %>
|
||||
<%= form.text_area :message %>
|
||||
</div>
|
||||
@ -12,7 +12,7 @@
|
||||
<% else %>
|
||||
|
||||
<%= form_for comment, url: admin_update_comment_path(test_hash: test_hash, id: comment.id), method: :post do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :message, "Update Comment" %>
|
||||
<%= form.text_area :message %>
|
||||
</div>
|
||||
|
@ -1,7 +1,5 @@
|
||||
<% # 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">
|
||||
<div data-id="vote-count">
|
||||
<strong>Votes: </strong>
|
||||
|
||||
<% if @candidate.pending? && current_user.commented_on?(@candidate.test_hash) %>
|
||||
@ -27,7 +25,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if current_user.acts_as_manager? %>
|
||||
<div class="review_meta__vetos">
|
||||
<div>
|
||||
<%= form_tag admin_interview_path(test_hash: @candidate.test_hash) do %>
|
||||
<strong>Interview: </strong>
|
||||
|
||||
@ -37,7 +35,7 @@
|
||||
<%= radio_button_tag :review_status, :declined, checked = @candidate.declined? %>
|
||||
<%= label_tag :review_status_declined, "No" %>
|
||||
|
||||
<div class="review-status-comments">
|
||||
<div>
|
||||
<span>Review comments for recruiter</span>
|
||||
<%= text_area_tag :review_comments, @candidate.review_comments %>
|
||||
<%= submit_tag 'Send Request' %>
|
||||
|
@ -2,27 +2,27 @@
|
||||
content_for :section_title, "Completed Tests"
|
||||
content_for :title, "Quiz Results - Skills Assessment Admin"
|
||||
%>
|
||||
<main class="summary_tpl">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th><%= sortable "test_hash", "Test ID" %></th>
|
||||
<th><%= sortable "name" %></th>
|
||||
<th><%= sortable "project", "Client/Project" %></th>
|
||||
<th>Recruiter</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.name if !candidate.pending? %></td>
|
||||
<td><%= candidate.project %></td>
|
||||
<td><%= mail_to(candidate.recruiter.email) %></td>
|
||||
<td><%= candidate.completed_at.strftime('%D') unless candidate.completed_at.nil? %></td>
|
||||
<td><%= candidate.interview? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<%= paginate @candidates %>
|
||||
</main>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th><%= sortable "test_hash", "Test ID" %></th>
|
||||
<th><%= sortable "name" %></th>
|
||||
<th><%= sortable "project", "Client/Project" %></th>
|
||||
<th>Recruiter</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.name if !candidate.pending? %></td>
|
||||
<td><%= candidate.project %></td>
|
||||
<td><%= mail_to(candidate.recruiter.email) %></td>
|
||||
<td><%= candidate.completed_at.strftime('%D') unless candidate.completed_at.nil? %></td>
|
||||
<td><%= candidate.interview? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= paginate @candidates %>
|
||||
|
@ -2,65 +2,47 @@
|
||||
content_for :title, "Quiz Review - Skills Assessment Admin"
|
||||
%>
|
||||
|
||||
<div class="summary_tpl">
|
||||
<div class="admin-review">
|
||||
<h2 class="prft-heading">Quiz Review</h2>
|
||||
<div>
|
||||
<h1>Quiz Review</h1>
|
||||
|
||||
<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>
|
||||
|
||||
<% @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>
|
||||
<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 class="review-comments">
|
||||
<div>
|
||||
<h2 class="prft-heading">Voting</h2>
|
||||
<div class="review_meta">
|
||||
<div><%= render partial: 'voting' %></div>
|
||||
</div>
|
||||
</div>
|
||||
<% @quiz.each do |question| %>
|
||||
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
|
||||
<h2><%= question.question %></h2>
|
||||
<%= image_tag question.attachment if question.attachment.present? %>
|
||||
|
||||
<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>
|
||||
<fieldset disabled>
|
||||
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to("Back to list", admin_results_path, { class: "" }) %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<h1>Voting</h1>
|
||||
<div><%= render partial: 'voting' %></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h1 id="comment-header">Comments</h1>
|
||||
<% 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>
|
||||
|
@ -1,33 +1,37 @@
|
||||
<%= render partial: 'shared/form_model_errors', locals: { obj: user} %>
|
||||
|
||||
<%= form_for user, url: action do |form| %>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :name, "Full Name" %>
|
||||
<%= form.text_field :name %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :email, "eMail" %>
|
||||
<%= form.email_field :email %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<%= form.label :role, "Role" %>
|
||||
<%= form.select :role, admin_role_options(user.role), include_blank: false %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<div><strong>Quiz Review List</strong></div>
|
||||
<p>
|
||||
Quizzes this user should be reviewing the results of.<br />
|
||||
Admins and Recruiters should not have any checked, unless they are expected
|
||||
to participate in the technical review for that quiz.
|
||||
</p>
|
||||
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: 'checkbox'}) do | quiz | %>
|
||||
<div class="form-group-multiples">
|
||||
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
|
||||
<%= quiz.label %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<ul>
|
||||
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: ""}) do | quiz | %>
|
||||
<li>
|
||||
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
|
||||
<%= quiz.label %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%= form.submit %>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<td><%= link_to user.name, admin_user_path(user.to_i) %></td>
|
||||
<td><%= mail_to(user.email) %></td>
|
||||
<td><%= user.role %></td>
|
||||
<td><%= link_to 'edit', admin_edit_user_path(user.to_i), { class: 'btn tertiary-btn' } if policy(user).edit? %></td>
|
||||
<td><%= link_to 'edit', admin_edit_user_path(user.to_i), { class: "" } if policy(user).edit? %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
@ -1,5 +1,3 @@
|
||||
<%
|
||||
content_for :section_title, "Edit: #{@user.name}"
|
||||
%>
|
||||
<% content_for :section_title, "Edit: #{@user.name}" %>
|
||||
|
||||
<%= render partial: 'form', locals: {user: @user, action: admin_update_user_path } %>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<%
|
||||
content_for :section_title, "Users"
|
||||
%>
|
||||
<% content_for :section_title, "Users" %>
|
||||
|
||||
<h1>Users</h1>
|
||||
|
||||
<%= render partial: 'admin/user/table_list', locals: { users: @users } %>
|
||||
<%= link_to('New User', admin_new_user_path, { class: 'btn' }) if policy(User).create? %>
|
||||
|
||||
<%= link_to('New User', admin_new_user_path, { class: "" }) if policy(User).create? %>
|
||||
|
@ -1,5 +1,3 @@
|
||||
<%
|
||||
content_for :section_title, "New User"
|
||||
%>
|
||||
<% content_for :section_title, "New User" %>
|
||||
|
||||
<%= render partial: 'form', locals: {user: @user, action: admin_create_user_path } %>
|
||||
|
@ -1,16 +1,14 @@
|
||||
<%
|
||||
content_for :section_title, "#{@user.name}"
|
||||
%>
|
||||
<% content_for :section_title, "#{@user.name}" %>
|
||||
|
||||
<p><%= @user.name %></p>
|
||||
<p><%= mail_to(@user.email) %></p>
|
||||
<p><%= @user.role %></p>
|
||||
<div><%= @user.name %></div>
|
||||
<div><%= mail_to(@user.email) %></div>
|
||||
<div><%= @user.role %></div>
|
||||
|
||||
<p>Quizzes:</p>
|
||||
<div>Quizzes:</div>
|
||||
<ul>
|
||||
<% @user.quizzes.each do |quiz| %>
|
||||
<li><%= quiz.name %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= link_to('Edit', admin_edit_user_path(@user.to_i), { class: 'btn' }) %>
|
||||
<%= link_to('Edit', admin_edit_user_path(@user.to_i), { class: "" }) %>
|
||||
|
Reference in New Issue
Block a user