Commit 1587caa3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use name+username in team -> new

parent fa9a8c38
...@@ -8,8 +8,4 @@ class UserDecorator < ApplicationDecorator ...@@ -8,8 +8,4 @@ class UserDecorator < ApplicationDecorator
def tm_of(project) def tm_of(project)
project.team_member_by_id(self.id) project.team_member_by_id(self.id)
end end
def name_with_email
"#{name} (#{email})"
end
end end
...@@ -340,4 +340,8 @@ class User < ActiveRecord::Base ...@@ -340,4 +340,8 @@ class User < ActiveRecord::Base
def owned_teams def owned_teams
UserTeam.where(owner_id: self.id) UserTeam.where(owner_id: self.id)
end end
def name_with_username
"#{name} (#{username})"
end
end end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
%h6 1. Choose people you want in the team %h6 1. Choose people you want in the team
.clearfix .clearfix
= f.label :user_ids, "People" = f.label :user_ids, "People"
.input= select_tag(:user_ids, options_from_collection_for_select(User.active.not_in_project(@project).alphabetically, :id, :name), {data: {placeholder: "Select users"}, class: "chosen xxlarge", multiple: true}) .input= select_tag(:user_ids, options_from_collection_for_select(User.active.not_in_project(@project).alphabetically, :id, :name_with_username), {data: {placeholder: "Select users"}, class: "chosen xxlarge", multiple: true})
%h6 2. Set access level for them %h6 2. Set access level for them
.clearfix .clearfix
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
%td= @team.admin?(member) ? "Admin" : "Member" %td= @team.admin?(member) ? "Admin" : "Member"
%td %td
%tr %tr
%td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name_with_email), multiple: true, data: {placeholder: 'Select users'}, class: 'chosen span5' %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name_with_username), multiple: true, data: {placeholder: 'Select users'}, class: 'chosen span5'
%td= select_tag :default_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" } %td= select_tag :default_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" }
%td %td
%span= check_box_tag :group_admin %span= check_box_tag :group_admin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment