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
Léo-Paul Géneau
gitlab-ce
Commits
a7667ffc
Commit
a7667ffc
authored
Jan 21, 2013
by
Andrey Kumanyaev
Committed by
Dmitriy Zaporozhets
Jan 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair members management of teams
parent
b7470440
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
21 deletions
+33
-21
app/controllers/admin/teams/members_controller.rb
app/controllers/admin/teams/members_controller.rb
+13
-2
app/views/admin/teams/members/new.html.haml
app/views/admin/teams/members/new.html.haml
+1
-1
app/views/admin/teams/show.html.haml
app/views/admin/teams/show.html.haml
+19
-18
No files found.
app/controllers/admin/teams/members_controller.rb
View file @
a7667ffc
class
Admin::Teams::MembersController
<
Admin
::
Teams
::
ApplicationController
before_filter
:team_member
,
only:
[
:edit
,
:destroy
,
:update
]
def
new
@users
=
User
.
active
@users
=
@users
.
not_in_team
(
@team
)
if
@team
.
members
.
any?
...
...
@@ -17,11 +19,9 @@ class Admin::Teams::MembersController < Admin::Teams::ApplicationController
end
def
edit
@member
=
@team
.
members
.
find
(
params
[
:id
])
end
def
update
@member
=
@team
.
members
.
find
(
params
[
:id
])
options
=
{
default_projects_access:
params
[
:default_project_access
],
group_admin:
params
[
:group_admin
]}
if
@team
.
update_membership
(
@member
,
options
)
redirect_to
admin_team_path
(
@team
),
notice:
'Membership was successfully updated.'
...
...
@@ -31,5 +31,16 @@ class Admin::Teams::MembersController < Admin::Teams::ApplicationController
end
def
destroy
if
@team
.
remove_member
(
@member
)
redirect_to
admin_team_path
(
@team
),
notice:
"Member was successfully removed from team."
else
redirect_to
admin_team_members
(
@team
),
notice:
"Something wrong."
end
end
private
def
team_member
@member
=
@team
.
members
.
find
(
params
[
:id
])
end
end
app/views/admin/teams/members/new.html.haml
View file @
a7667ffc
...
...
@@ -3,7 +3,7 @@
%fieldset
%legend
Members (
#{
@team
.
members
.
count
}
)
=
form_tag
ad
d_members_admin_team
_path
(
@team
),
id:
"team_members"
,
class:
"bulk_import"
,
method: :post
do
=
form_tag
ad
min_team_members
_path
(
@team
),
id:
"team_members"
,
class:
"bulk_import"
,
method: :post
do
%table
#members_list
%thead
%tr
...
...
app/views/admin/teams/show.html.haml
View file @
a7667ffc
...
...
@@ -68,25 +68,26 @@
%fieldset
%legend
Projects (
#{
@team
.
projects
.
count
}
)
=
form_tag
delegate_projects_admin_team_path
(
@team
),
id:
"assign_projects"
,
class:
"bulk_import"
,
method: :post
do
%table
#projects_list
%thead
%tr
%th
Project name
%th
Max access
%th
.cred
Danger Zone!
-
@team
.
projects
.
each
do
|
project
|
%tr
.project
%td
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
%td
%span
=
@team
.
human_max_project_access
(
project
)
%td
.bgred
=
link_to
'Relegate'
,
relegate_project_admin_team_path
(
@team
,
project_id:
project
.
id
),
confirm:
'Remove project from team and move to global namespace. Are you sure?'
,
method: :delete
,
class:
"btn danger small"
%table
#projects_list
%thead
%tr
%td
=
select_tag
:project_ids
,
options_from_collection_for_select
(
@projects
,
:id
,
:name_with_namespace
),
multiple:
true
,
data:
{
placeholder:
'Select projects'
},
class:
'chosen span5'
%td
=
select_tag
:greatest_project_access
,
options_for_select
(
Project
.
access_options
),
{
class:
"project-access-select chosen span3"
}
%td
=
submit_tag
'Add'
,
class:
"btn primary"
,
id: :assign_projects_to_team
%th
Project name
%th
Max access
%th
.cred
Danger Zone!
-
@team
.
projects
.
each
do
|
project
|
%tr
.project
%td
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
%td
%span
=
@team
.
human_max_project_access
(
project
)
%td
.bgred
=
link_to
'Edit'
,
edit_admin_team_project_path
(
@team
,
project
),
class:
"btn small"
=
link_to
'Relegate'
,
admin_team_project_path
(
@team
,
project
),
confirm:
'Remove project from team. Are you sure?'
,
method: :delete
,
class:
"btn danger small"
%tr
%td
%td
%td
=
link_to
'Add projects'
,
new_admin_team_project_path
(
@team
),
class:
"btn primary"
,
id: :assign_projects_to_team
:javascript
$
(
function
(){
...
...
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