diff --git a/app/views/members/autocomplete_for_member.json.erb b/app/views/members/autocomplete_for_member.json.erb index b6500b190d..d0dd7479d7 100644 --- a/app/views/members/autocomplete_for_member.json.erb +++ b/app/views/members/autocomplete_for_member.json.erb @@ -36,7 +36,8 @@ See doc/COPYRIGHT.rdoc for more details. { "results": { - <% email = params[:q] =~ /.+@.+/ %> + <%# Offer to invite via email unless it's one of the found user's addresses already. #%> + <% email = params[:q] =~ /.+@.+/ && @principals.none? { |p| p.mail == params[:q] } %> "items":[ <% @principals.each_with_index do |principal, ix| %> { diff --git a/app/views/members/index.html.erb b/app/views/members/index.html.erb index 03648af899..34339294f3 100644 --- a/app/views/members/index.html.erb +++ b/app/views/members/index.html.erb @@ -104,7 +104,7 @@ See doc/COPYRIGHT.rdoc for more details. <%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %> <%= 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_delete), {:controller => '/members', :action => 'destroy', :id => member, :page => params[:page]}, + <%= link_to(l(:button_remove), {:controller => '/members', :action => 'destroy', :id => member, :page => params[:page]}, :method => :delete, data: { confirm: ((!User.current.admin? && member.include?(User.current)) ? l(:text_own_membership_delete_confirmation) : nil) }, :title => l(:button_delete), :class => 'icon icon-delete') if member.deletable? %> diff --git a/app/views/members/new.html.erb b/app/views/members/new.html.erb index fe64473680..f09796092e 100644 --- a/app/views/members/new.html.erb +++ b/app/views/members/new.html.erb @@ -37,6 +37,9 @@ See doc/COPYRIGHT.rdoc for more details. :roles => @roles } %> <% else %> - No roles defined. +

+ <%= @roles.any? ? I18n.t('text_no_more_users_to_add') : I18n.t('text_no_roles_defined') %> +

+ <%= link_to I18n.t('button_back'), :back, class: 'button' %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 7b246eff97..3827ac93d5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -391,6 +391,7 @@ en: button_move: "Move" button_move_and_follow: "Move and follow" button_quote: "Quote" + button_remove: Remove button_remove_widget: "Remove widget" button_rename: "Rename" button_reply: "Reply" @@ -1569,6 +1570,8 @@ en: text_line_separated: "Multiple values allowed (one line for each value)." text_load_default_configuration: "Load the default configuration" text_min_max_length_info: "0 means no restriction" + text_no_more_users_to_add: There are no more users to be added. + text_no_roles_defined: There are no roles defined. text_no_configuration_data: "Roles, types, work package statuses and workflow have not been configured yet.\nIt is highly recommended to load the default configuration. You will be able to modify it once loaded." text_no_notes: "There are no comments available for this work package." text_notice_too_many_values_are_inperformant: "Note: Displaying more than 100 items per page can increase the page load time."