Use name+username in team -> new

5-0-stable
Dmitriy Zaporozhets 2013-03-13 19:24:30 +02:00
parent fa9a8c3847
commit 1587caa3e4
4 changed files with 6 additions and 6 deletions

View File

@ -8,8 +8,4 @@ class UserDecorator < ApplicationDecorator
def tm_of(project)
project.team_member_by_id(self.id)
end
def name_with_email
"#{name} (#{email})"
end
end

View File

@ -340,4 +340,8 @@ class User < ActiveRecord::Base
def owned_teams
UserTeam.where(owner_id: self.id)
end
def name_with_username
"#{name} (#{username})"
end
end

View File

@ -11,7 +11,7 @@
%h6 1. Choose people you want in the team
.clearfix
= 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
.clearfix

View File

@ -20,7 +20,7 @@
%td= @team.admin?(member) ? "Admin" : "Member"
%td
%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
%span= check_box_tag :group_admin