diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-23 21:46:40 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-23 21:46:40 +0000 |
commit | c2e73160daa7782d7a91f2b6a974a936c6f084da (patch) | |
tree | 62e174df69aba43cb5a84f2ddd278dc4562963f0 /app/views/groups | |
parent | ca5946d82ebb96464a3d283be657bc24ce0c47f1 (diff) | |
download | redmine-c2e73160daa7782d7a91f2b6a974a936c6f084da.tar.gz redmine-c2e73160daa7782d7a91f2b6a974a936c6f084da.zip |
Adds a single controller for users and groups memberships and support for adding multiple projects at once (#11702).
git-svn-id: http://svn.redmine.org/redmine/trunk@13498 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/groups')
-rw-r--r-- | app/views/groups/_memberships.html.erb | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/app/views/groups/_memberships.html.erb b/app/views/groups/_memberships.html.erb index ec275c594..1242bf6e8 100644 --- a/app/views/groups/_memberships.html.erb +++ b/app/views/groups/_memberships.html.erb @@ -1,65 +1 @@ -<% roles = Role.find_all_givable %> -<% projects = Project.active.to_a %> - -<div class="splitcontentleft"> -<% if @group.memberships.any? %> -<table class="list memberships"> - <thead><tr> - <th><%= l(:label_project) %></th> - <th><%= l(:label_role_plural) %></th> - <th style="width:15%"></th> - </tr></thead> - <tbody> - <% @group.memberships.each do |membership| %> - <% next if membership.new_record? %> - <tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class"> - <td class="project"><%= link_to_project membership.project %></td> - <td class="roles"> - <span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span> - <%= form_for(:membership, :remote => true, - :url => { :action => 'edit_membership', :id => @group, :membership_id => membership }, - :html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> - <p><% roles.each do |role| %> - <label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role), :id => nil %> <%=h role %></label><br /> - <% end %></p> - <p><%= submit_tag l(:button_change) %> - <%= link_to_function( - l(:button_cancel), - "$('#member-#{membership.id}-roles').show(); $('#member-#{membership.id}-roles-form').hide(); return false;" - ) %></p> - <% end %> - </td> - <td class="buttons"> - <%= link_to_function( - l(:button_edit), - "$('#member-#{membership.id}-roles').hide(); $('#member-#{membership.id}-roles-form').show(); return false;", - :class => 'icon icon-edit' - ) %> - <%= delete_link({:controller => 'groups', :action => 'destroy_membership', :id => @group, :membership_id => membership}, - :remote => true, - :method => :post) %> - </td> - </tr> -<% end; reset_cycle %> - </tbody> -</table> -<% else %> -<p class="nodata"><%= l(:label_no_data) %></p> -<% end %> -</div> - -<div class="splitcontentright"> -<% if projects.any? %> -<fieldset><legend><%=l(:label_project_new)%></legend> -<%= form_for(:membership, :remote => true, :url => { :action => 'edit_membership', :id => @group }) do %> -<%= label_tag "membership_project_id", l(:description_choose_project), :class => "hidden-for-sighted" %> -<%= select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %> -<p><%= l(:label_role_plural) %>: -<% roles.each do |role| %> - <label><%= check_box_tag 'membership[role_ids][]', role.id, false, :id => nil %> <%=h role %></label> -<% end %></p> -<p><%= submit_tag l(:button_add) %></p> -<% end %> -</fieldset> -<% end %> -</div> +<%= render_principal_memberships @group %> |