admin a11y polish

This commit is contained in:
Mark Moser 2017-05-01 16:17:41 -05:00
parent 9368184aa8
commit b961fe7553
8 changed files with 23 additions and 14 deletions

View File

@ -28,7 +28,8 @@ class Candidate < ApplicationRecord
def interview? def interview?
return 'yes' if approved? return 'yes' if approved?
'no' if declined? return 'no' if declined?
'-'
end end
def build_reviews def build_reviews

View File

@ -21,7 +21,9 @@
<%= form.text_field :project %> <%= form.text_field :project %>
</div> </div>
<div> <div role="group" aria-labelledby="position-type">
<span id="position-type">Position Type</span>
<%= form.radio_button :position, 'full-time' %> <%= form.radio_button :position, 'full-time' %>
<%= form.label "position_full-time", "Full-time" %> <%= form.label "position_full-time", "Full-time" %>

View File

@ -31,7 +31,7 @@
<td><%= candidate.experience %> years</td> <td><%= candidate.experience %> years</td>
<td><%= candidate.status %></td> <td><%= candidate.status %></td>
<td><%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td> <td><%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
<td><%= candidate.reminded ? "Yes" : "" %></td> <td><%= raw candidate.reminded ? "&check;" : "&middot;" %></td>
<td><%= candidate.interview? %></td> <td><%= candidate.interview? %></td>
</tr> </tr>
<% end %> <% end %>

View File

@ -3,6 +3,8 @@
content_for :title, "Profile - Skills Assessment Admin" content_for :title, "Profile - Skills Assessment Admin"
%> %>
<h1>Edit Profile</h1>
<%= render partial: 'shared/form_model_errors', locals: {obj: @user} %> <%= render partial: 'shared/form_model_errors', locals: {obj: @user} %>
<%= form_for @user, url: admin_profile_url, method: :post do |form| %> <%= form_for @user, url: admin_profile_url, method: :post do |form| %>

View File

@ -14,7 +14,7 @@
<td><%= question.question %></td> <td><%= question.question %></td>
<td><%= question.input_type %></td> <td><%= question.input_type %></td>
<td><%= question.category %></td> <td><%= question.category %></td>
<td><%= question.active unless question.active? %></td> <td><%= raw question.active? ? "&check;" : "&cross;" %></td>
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: "" } %></td> <td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: "" } %></td>
</tr> </tr>
<% end %> <% end %>

View File

@ -27,16 +27,18 @@
<% if current_user.acts_as_manager? %> <% if current_user.acts_as_manager? %>
<div> <div>
<%= form_tag admin_interview_path(test_hash: @candidate.test_hash) do %> <%= form_tag admin_interview_path(test_hash: @candidate.test_hash) do %>
<strong>Interview: </strong> <div role="group" aria-labelledby="interview-status">
<strong id="interview-status">Interview: </strong>
<%= radio_button_tag :review_status, :approved, checked = @candidate.approved? %> <%= radio_button_tag :review_status, :approved, checked = @candidate.approved? %>
<%= label_tag :review_status_approved, "Yes" %> <%= label_tag :review_status_approved, "Yes" %>
<%= radio_button_tag :review_status, :declined, checked = @candidate.declined? %> <%= radio_button_tag :review_status, :declined, checked = @candidate.declined? %>
<%= label_tag :review_status_declined, "No" %> <%= label_tag :review_status_declined, "No" %>
</div>
<div> <div>
<span>Review comments for recruiter</span> <%= label_tag :review_comments, "Review comments for recruiter" %>
<%= text_area_tag :review_comments, @candidate.review_comments %> <%= text_area_tag :review_comments, @candidate.review_comments %>
<%= submit_tag 'Send Request' %> <%= submit_tag 'Send Request' %>
</div> </div>

View File

@ -18,11 +18,12 @@
</div> </div>
<% @quiz.each do |question| %> <% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %> <%= form_for(:answer, url: '#never-post', html:{id: "summary-#{question.to_i}"}) do |form| %>
<h2><%= question.question %></h2> <h2><%= question.question %></h2>
<%= image_tag question.attachment if question.attachment.present? %> <%= image_tag question.attachment if question.attachment.present? %>
<fieldset disabled> <fieldset disabled>
<legend>Response</legend>
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %> <%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset> </fieldset>
<% end %> <% end %>

View File

@ -16,16 +16,17 @@
<%= form.select :role, admin_role_options(user.role), include_blank: false %> <%= form.select :role, admin_role_options(user.role), include_blank: false %>
</div> </div>
<div> <div role="group" aria-labelledby="assigned-quiz-list">
<div><strong>Quiz Review List</strong></div> <div id="assigned-quiz-list"><strong>Quiz Review List</strong></div>
<p> <p>
Quizzes this user should be reviewing the results of.<br /> Quizzes this user should be reviewing the results of.<br />
Admins and Recruiters should not have any checked, unless they are expected Admins and Recruiters should not have any checked, unless they are expected
to participate in the technical review for that quiz. to participate in the technical review for that quiz.
</p> </p>
<%= hidden_field_tag('user[quiz_ids][]') %>
<ul> <ul>
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: ""}) do | quiz | %> <%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {include_hidden: false}, {class: ""}) do | quiz | %>
<li> <li>
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %> <%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
<%= quiz.label %> <%= quiz.label %>