skill-assessment-app/app/views/admin/user/_form.html.erb
2017-06-05 11:30:35 -05:00

40 lines
1.1 KiB
Plaintext

<%= render partial: 'shared/form_model_errors', locals: { obj: user} %>
<%= form_for user, url: action do |form| %>
<div>
<%= form.label :name, "Full Name" %>
<%= form.text_field :name %>
</div>
<div>
<%= form.label :email, "eMail" %>
<%= form.email_field :email %>
</div>
<div>
<%= form.label :role, "Role" %>
<%= form.select :role, admin_role_options(user.role), include_blank: false %>
</div>
<div role="group" aria-labelledby="assigned-quiz-list">
<div id="assigned-quiz-list"><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>
<%= hidden_field_tag('user[quiz_ids][]') %>
<ul>
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {include_hidden: false}, {class: ""}) do | quiz | %>
<li>
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
<%= quiz.label %>
</li>
<% end %>
</ul>
</div>
<%= form.submit %>
<% end %>