app/views/district/users/_label_form.html.erb
<%= label_form.error_messages %>
<%= label_form.text_field :username %>
<%= label_form.password_field :password %>
<%= label_form.password_field :password_confirmation %>
<%= label_form.text_field :first_name %>
<%= label_form.text_field :middle_name %>
<%= label_form.text_field :last_name %>
<%= label_form.text_field :suffix %>
<%= label_form.text_field :email ,:help =>"This must be a valid email address" %>
<%= label_form.text_field :district_user_id, :label => "Primary key in your <br />Student Information System",
:help => "The primary key used to identify this user in your Student Information System. It might be a personID, or userID or something similar." %>
<%= render :partial => 'roles', :locals => {:form => label_form} %>
<%= render :partial => 'district_groups', :locals => {:form => label_form} %>
<h2>Explicit School Assignments
<%= help_popup "Gives a user access to a school. They then need to be assigned to groups (collections of students.)
Choosing 'All students' gives the user access to every student in the school. Choosing 'Admin' allows a user to administer the school, and is typically for the school secretary." %>
</h2>
<div id= "user_school_assignments" class ="awesome_nested">
<div class ="items">
<%= label_form.nested_fields_for :user_school_assignments do |f| %>
<div class="user_school_assignment item form_row">
<%= f.collection_select('school_id', @schools, :id, :to_s,{:wrap => :span}) %>
<%= f.check_box :admin %>
<%= f.check_box :all_students %>
<%= f.hidden_field :id %>
<%= f.hidden_field :_destroy %>
<%= link_to "Remove", "#", :class =>"remove" %>
</div>
<% end %>
</div>
<div>
<%= link_to "Add a school assignment","#", :id => "new_user_school_assignment_link", :class => "add" %>
</div>
</div>
<% unless current_district.staff_assignments.empty? %>
<h2>Staff Assignments
<%=help_popup "The staff assignments limit who is in the dropdown for participants, and other fields. If there are no staff assignments for a <b>district</b> then those fields will be populated by the user school assignments." %>
</h2>
<%= render :partial => '/district/users/staff_assignments', :locals => {:form => label_form} %>
<% end %>