summaryrefslogtreecommitdiffstats
path: root/app/views/members/_edit.html.erb
blob: e3c5ec747edb5efbd57d7b0ceed8e9f573e263c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<%= form_for(@member, :url => membership_path(@member),
                      :as => :membership,
                      :remote => request.xhr?,
                      :method => :put) do |f| %>
  <p>
    <% @roles.each do |role| %>
    <label>
      <%= check_box_tag('membership[role_ids][]',
                        role.id, @member.roles.to_a.include?(role),
                        :id => nil,
                        :disabled => !@member.role_editable?(role)) %> <%= role %>
      <%= render_role_inheritance(@member, role) %>
    </label><br />
    <% end %>
  </p>
  <%= hidden_field_tag 'membership[role_ids][]', '', :id => nil %>
  <p>
    <%= submit_tag l(:button_save) %>
    <%= link_to_function l(:button_cancel),
                         "$('#member-#{@member.id}-roles').show(); $('#member-#{@member.id}-form').empty(); return false;" if request.xhr? %>
  </p>
<% end %>