diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-05 16:35:27 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-05 16:35:27 +0000 |
commit | 78bd24c6f738ea946622bfab5b6ea8a2040f5bde (patch) | |
tree | d170a86a5fe88326435223b19b5670fe2c5df439 /app/views/projects | |
parent | 229b2f8d2af251e1bce0fa11946c41095c19f834 (diff) | |
download | redmine-78bd24c6f738ea946622bfab5b6ea8a2040f5bde.tar.gz redmine-78bd24c6f738ea946622bfab5b6ea8a2040f5bde.zip |
Resourcified project memberships.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8789 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/settings/_members.html.erb | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index 02591efe9..5cd3afd32 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -18,21 +18,19 @@ <td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td> <td class="roles"> <span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span> - <% if authorize_for('members', 'edit') %> - <% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, - :method => :post, + <% remote_form_for(:membership, member, :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 'member[role_ids][]', role.id, member.roles.include?(role), + <label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role), :disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br /> <% end %></p> - <%= hidden_field_tag 'member[role_ids][]', '' %> + <%= hidden_field_tag 'membership[role_ids][]', '' %> <p><%= submit_tag l(:button_change), :class => "small" %> <%= link_to_function l(:button_cancel), "$('member-#{member.id}-roles').show(); $('member-#{member.id}-roles-form').hide(); return false;" %></p> <% end %> - <% end %> </td> <td class="buttons"> <%= link_to_function l(:button_edit), @@ -40,8 +38,8 @@ :class => 'icon icon-edit' %> <%= link_to_remote( l(:button_delete), - { :url => {:controller => 'members', :action => 'destroy', :id => member}, - :method => :post, + { :url => membership_path(member), + :method => :delete, :confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil) }, :title => l(:button_delete), :class => 'icon icon-del' @@ -61,7 +59,7 @@ <div class="splitcontentright"> <% if roles.any? && principals.any? %> - <% remote_form_for(:member, @member, :url => {:controller => 'members', :action => 'new', :id => @project}, :method => :post, + <% remote_form_for(:membership, @member, :url => project_memberships_path(@project), :method => :post, :loading => '$(\'member-add-submit\').disable();', :complete => 'if($(\'member-add-submit\')) $(\'member-add-submit\').enable();') do |f| %> <fieldset><legend><%=l(:label_member_new)%></legend> @@ -70,17 +68,18 @@ <%= observe_field(:principal_search, :frequency => 0.5, :update => :principals, - :url => { :controller => 'members', :action => 'autocomplete_for_member', :id => @project }, + :url => autocomplete_project_memberships_path(@project), + :method => :get, :with => 'q') %> <div id="principals"> - <%= principals_check_box_tags 'member[user_ids][]', principals %> + <%= principals_check_box_tags 'membership[user_ids][]', principals %> </div> <p><%= l(:label_role_plural) %>: <% roles.each do |role| %> - <label><%= check_box_tag 'member[role_ids][]', role.id %> <%=h role %></label> + <label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label> <% end %></p> <p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p> |