Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1587caa3
Commit
1587caa3
authored
Mar 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use name+username in team -> new
parent
fa9a8c38
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
app/decorators/user_decorator.rb
app/decorators/user_decorator.rb
+0
-4
app/models/user.rb
app/models/user.rb
+4
-0
app/views/team_members/_form.html.haml
app/views/team_members/_form.html.haml
+1
-1
app/views/teams/members/new.html.haml
app/views/teams/members/new.html.haml
+1
-1
No files found.
app/decorators/user_decorator.rb
View file @
1587caa3
...
...
@@ -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
app/models/user.rb
View file @
1587caa3
...
...
@@ -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
app/views/team_members/_form.html.haml
View file @
1587caa3
...
...
@@ -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
...
...
app/views/teams/members/new.html.haml
View file @
1587caa3
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment