diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/groups/_users.html.erb | 8 | ||||
-rw-r--r-- | app/views/groups/autocomplete_for_user.html.erb | 1 | ||||
-rw-r--r-- | app/views/groups/autocomplete_for_user.js.erb | 1 | ||||
-rw-r--r-- | app/views/members/autocomplete.html.erb | 1 | ||||
-rw-r--r-- | app/views/members/autocomplete.js.erb | 1 | ||||
-rw-r--r-- | app/views/projects/settings/_members.html.erb | 10 |
6 files changed, 8 insertions, 14 deletions
diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb index 8bd76e90e..a0f89d76f 100644 --- a/app/views/groups/_users.html.erb +++ b/app/views/groups/_users.html.erb @@ -22,22 +22,18 @@ </div> <div class="splitcontentright"> -<% users = User.active.not_in_group(@group).all(:limit => 100) %> -<% if users.any? %> <%= form_for(@group, :remote => true, :url => group_users_path(@group), :html => {:method => :post}) do |f| %> <fieldset><legend><%=l(:label_user_new)%></legend> <p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p> - <%= javascript_tag "observeSearchfield('user_search', 'users', '#{ escape_javascript autocomplete_for_user_group_path(@group) }')" %> + <%= javascript_tag "observeSearchfield('user_search', null, '#{ escape_javascript autocomplete_for_user_group_path(@group) }')" %> <div id="users"> - <%= principals_check_box_tags 'user_ids[]', users %> + <%= render_principals_for_new_group_users(@group) %> </div> <p><%= submit_tag l(:button_add) %></p> </fieldset> <% end %> -<% end %> - </div> diff --git a/app/views/groups/autocomplete_for_user.html.erb b/app/views/groups/autocomplete_for_user.html.erb deleted file mode 100644 index de1b0073a..000000000 --- a/app/views/groups/autocomplete_for_user.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= principals_check_box_tags 'user_ids[]', @users %> diff --git a/app/views/groups/autocomplete_for_user.js.erb b/app/views/groups/autocomplete_for_user.js.erb new file mode 100644 index 000000000..9bb569ea1 --- /dev/null +++ b/app/views/groups/autocomplete_for_user.js.erb @@ -0,0 +1 @@ +$('#users').html('<%= escape_javascript(render_principals_for_new_group_users(@group)) %>'); diff --git a/app/views/members/autocomplete.html.erb b/app/views/members/autocomplete.html.erb deleted file mode 100644 index a3ae74a0b..000000000 --- a/app/views/members/autocomplete.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= principals_check_box_tags 'membership[user_ids][]', @principals %> diff --git a/app/views/members/autocomplete.js.erb b/app/views/members/autocomplete.js.erb new file mode 100644 index 000000000..ba98983d3 --- /dev/null +++ b/app/views/members/autocomplete.js.erb @@ -0,0 +1 @@ +$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>'); diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index 7b2eaac87..87c8f8be3 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -51,18 +51,16 @@ <% end %> </div> -<% principals = Principal.active.not_member_of(@project).all(:limit => 100, :order => 'type, login, lastname ASC') %> - <div class="splitcontentright"> -<% if roles.any? && principals.any? %> +<% if roles.any? %> <%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %> <fieldset><legend><%=l(:label_member_new)%></legend> <p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p> - <%= javascript_tag "observeSearchfield('principal_search', 'principals', '#{ escape_javascript autocomplete_project_memberships_path(@project) }')" %> + <%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %> - <div id="principals"> - <%= principals_check_box_tags 'membership[user_ids][]', principals %> + <div id="principals_for_new_member"> + <%= render_principals_for_new_members(@project) %> </div> <p><%= l(:label_role_plural) %>: |