summaryrefslogtreecommitdiffstats
path: root/app/views/projects/settings/_members.html.erb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-07 10:26:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-07 10:26:36 +0000
commita4f167ec1a6d8cb3707716e73378e98e870d466f (patch)
tree0a7a6317e9c4488f3bf0d121c7ee844343040c93 /app/views/projects/settings/_members.html.erb
parente29b4ba26ad18a1ab871effe0fa5e11c2a2b189e (diff)
downloadredmine-a4f167ec1a6d8cb3707716e73378e98e870d466f.tar.gz
redmine-a4f167ec1a6d8cb3707716e73378e98e870d466f.zip
Don't render memberships forms, use #edit instead.
git-svn-id: http://svn.redmine.org/redmine/trunk@16149 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/projects/settings/_members.html.erb')
-rw-r--r--app/views/projects/settings/_members.html.erb34
1 files changed, 6 insertions, 28 deletions
diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb
index 1dd665a34..4009e7b15 100644
--- a/app/views/projects/settings/_members.html.erb
+++ b/app/views/projects/settings/_members.html.erb
@@ -1,5 +1,4 @@
-<% roles = Role.find_all_givable
- members = @project.memberships.sorted.to_a %>
+<% members = @project.memberships.sorted.to_a %>
<p><%= link_to l(:label_member_new), new_project_membership_path(@project), :remote => true, :class => "icon icon-add" %></p>
@@ -20,34 +19,13 @@
<td class="name icon icon-<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<td class="roles">
<span id="member-<%= member.id %>-roles"><%= member.roles.sort.collect(&:to_s).join(', ') %></span>
- <%= form_for(member,
- {:as => :membership, :remote => true,
- :url => membership_path(member),
- :method => :put,
- :html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
- ) do |f| %>
- <p>
- <% roles.each do |role| %>
- <label>
- <%= check_box_tag('membership[role_ids][]',
- role.id, member.roles.include?(role),
- :id => nil,
- :disabled => !member.role_editable?(role)) %> <%= role %>
- </label><br />
- <% end %>
- </p>
- <%= hidden_field_tag 'membership[role_ids][]', '', :id => nil %>
- <p>
- <%= submit_tag l(:button_save), :class => "small" %>
- <%= link_to_function(l(:button_cancel),
- "$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;") %>
- </p>
- <% end %>
+ <div id="member-<%= member.id %>-form"></div>
</td>
<td class="buttons">
- <%= link_to_function l(:button_edit),
- "$('#member-#{member.id}-roles').hide(); $('#member-#{member.id}-roles-form').show(); return false;",
- :class => 'icon icon-edit' %>
+ <%= link_to l(:button_edit),
+ edit_membership_path(member),
+ :remote => true,
+ :class => 'icon icon-edit' %>
<%= delete_link membership_path(member),
:remote => true,
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %>