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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
aaa1c942
Commit
aaa1c942
authored
Nov 29, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manage team from groups page. Phase 1
parent
08fded3f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
15 deletions
+66
-15
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+6
-1
app/controllers/team_members_controller.rb
app/controllers/team_members_controller.rb
+5
-1
app/views/groups/_new_member.html.haml
app/views/groups/_new_member.html.haml
+18
-0
app/views/groups/_people_filter.html.haml
app/views/groups/_people_filter.html.haml
+14
-0
app/views/groups/people.html.haml
app/views/groups/people.html.haml
+23
-13
No files found.
app/controllers/groups_controller.rb
View file @
aaa1c942
...
@@ -47,7 +47,12 @@ class GroupsController < ApplicationController
...
@@ -47,7 +47,12 @@ class GroupsController < ApplicationController
end
end
def
people
def
people
@users
=
group
.
users
@project
=
group
.
projects
.
find
(
params
[
:project_id
])
if
params
[
:project_id
]
@users
=
@project
?
@project
.
users
:
group
.
users
if
@project
@team_member
=
@project
.
users_projects
.
new
end
end
end
protected
protected
...
...
app/controllers/team_members_controller.rb
View file @
aaa1c942
...
@@ -21,7 +21,11 @@ class TeamMembersController < ProjectResourceController
...
@@ -21,7 +21,11 @@ class TeamMembersController < ProjectResourceController
params
[
:project_access
]
params
[
:project_access
]
)
)
redirect_to
project_team_index_path
(
@project
)
if
params
[
:redirect_to
]
redirect_to
params
[
:redirect_to
]
else
redirect_to
project_team_index_path
(
@project
)
end
end
end
def
update
def
update
...
...
app/views/groups/_new_member.html.haml
0 → 100644
View file @
aaa1c942
=
form_for
@team_member
,
as: :team_member
,
url:
project_team_members_path
(
@project
,
@team_member
)
do
|
f
|
%fieldset
%legend
=
"New Team member(s) for
#{
@project
.
name
}
"
%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
.
not_in_project
(
@project
).
all
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
%h6
2. Set access level for them
.clearfix
=
f
.
label
:project_access
,
"Project Access"
.input
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member
.
project_access
),
class:
"project-access-select chosen"
.form-actions
=
hidden_field_tag
:redirect_to
,
people_group_path
(
@group
,
project_id:
@project
.
id
)
=
f
.
submit
'Add'
,
class:
"btn save-btn"
app/views/groups/_people_filter.html.haml
0 → 100644
View file @
aaa1c942
=
form_tag
people_group_path
(
@group
),
method:
'get'
do
%fieldset
%legend
Projects:
%ul
.nav.nav-pills.nav-stacked
-
@projects
.
each
do
|
project
|
%li
{
class:
(
"active"
if
params
[
:project_id
]
==
project
.
id
.
to_s
)}
=
link_to
people_group_path
(
@group
,
project_id:
project
.
id
)
do
=
project
.
name_with_namespace
%small
.right
=
project
.
users
.
count
%fieldset
%hr
=
link_to
"Reset"
,
people_group_path
(
@group
),
class:
'btn right'
app/views/groups/people.html.haml
View file @
aaa1c942
.ui-box
.row
%h5
.span3
People
=
render
'people_filter'
%small
.span9
(
#{
@users
.
size
}
)
-
if
@project
&&
can?
(
current_user
,
:manage_group
,
@group
)
%ul
.unstyled
=
render
"new_member"
-
@users
.
each
do
|
user
|
.ui-box
%li
.wll
%h5
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
Team
%strong
=
user
.
name
%small
%span
.cgray
=
user
.
email
(
#{
@users
.
size
}
)
-
if
@group
.
owner
==
user
%ul
.unstyled
%span
.btn.btn-small.disabled.right
Owner
-
@users
.
each
do
|
user
|
%li
.wll
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
%strong
=
user
.
name
%span
.cgray
=
user
.
email
-
if
@project
-
if
@project
.
owner
==
user
%span
.btn.btn-small.disabled.right
Project Owner
-
else
-
if
@group
.
owner
==
user
%span
.btn.btn-small.disabled.right
Group Owner
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