<fieldset class="box">
  <legend><%= toggle_checkboxes_link('.projects-selection input:enabled') %><%= l(:label_project_plural) %></legend>
  <div class="objects-selection">
    <div class="projects-selection">
    <%= render_project_nested_lists(@projects) do |p| %>
      <label>
        <%= check_box_tag('membership[project_ids][]', p.id, false, :id => nil, :disabled => @principal.member_of?(p)) %> <%= p %>
      </label>
    <% end %>
    </div>
  </div>
</fieldset>

<fieldset class="box">
  <legend><%= toggle_checkboxes_link('.roles-selection input') %><%= l(:label_role_plural) %></legend>
  <div class="roles-selection">
  <% @roles.each do |role| %>
    <label>
      <%= check_box_tag 'membership[role_ids][]', role.id, false, :id => nil %>
      <%= role %>
    </label>
  <% end %>
  </div>
</fieldset>
