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
Kazuhiko Shiozaki
gitlab-ce
Commits
ee13297a
Commit
ee13297a
authored
Jun 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: removed unused routing/methods. Improved admin area usability
parent
59f75e6c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
93 deletions
+22
-93
app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
+0
-10
app/controllers/admin/projects/members_controller.rb
app/controllers/admin/projects/members_controller.rb
+0
-15
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+0
-11
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+3
-2
app/views/admin/projects/members/_form.html.haml
app/views/admin/projects/members/_form.html.haml
+0
-16
app/views/admin/projects/members/edit.html.haml
app/views/admin/projects/members/edit.html.haml
+0
-8
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+10
-6
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+8
-15
config/routes.rb
config/routes.rb
+1
-10
No files found.
app/controllers/admin/groups_controller.rb
View file @
ee13297a
...
...
@@ -44,16 +44,6 @@ class Admin::GroupsController < Admin::ApplicationController
end
end
def
project_update
project_ids
=
params
[
:project_ids
]
Project
.
where
(
id:
project_ids
).
each
do
|
project
|
project
.
transfer
(
@group
)
end
redirect_to
:back
,
notice:
'Group was successfully updated.'
end
def
project_teams_update
@group
.
add_users
(
params
[
:user_ids
].
split
(
','
),
params
[
:group_access
])
...
...
app/controllers/admin/projects/members_controller.rb
View file @
ee13297a
class
Admin::Projects::MembersController
<
Admin
::
Projects
::
ApplicationController
def
edit
@member
=
team_member
@project
=
project
@team_member_relation
=
team_member_relation
end
def
update
if
team_member_relation
.
update_attributes
(
params
[
:team_member
])
redirect_to
[
:admin
,
project
],
notice:
'Project Access was successfully updated.'
else
render
action:
"edit"
end
end
def
destroy
team_member_relation
.
destroy
...
...
@@ -28,5 +14,4 @@ class Admin::Projects::MembersController < Admin::Projects::ApplicationControlle
def
team_member_relation
team_member
.
users_projects
.
find_by_project_id
(
project
)
end
end
app/controllers/admin/users_controller.rb
View file @
ee13297a
...
...
@@ -12,17 +12,6 @@ class Admin::UsersController < Admin::ApplicationController
@projects
=
admin_user
.
authorized_projects
end
def
team_update
UsersProject
.
add_users_into_projects
(
params
[
:project_ids
],
[
admin_user
.
id
],
params
[
:project_access
]
)
redirect_to
[
:admin
,
admin_user
],
notice:
'Teams were successfully updated.'
end
def
new
@admin_user
=
User
.
new
.
with_defaults
end
...
...
app/views/admin/groups/show.html.haml
View file @
ee13297a
...
...
@@ -65,7 +65,7 @@
.span6
.ui-box
%h5
.title
Add user(s):
Add user(s)
to the group
:
.ui-box-body.form-holder
%p
.light
Read more about project permissions
...
...
@@ -80,7 +80,8 @@
=
submit_tag
'Add users into group'
,
class:
"btn btn-create"
.ui-box
%h5
.title
Users from
#{
@group
.
name
}
Group
%strong
#{
@group
.
name
}
Group Members
%small
(
#{
@group
.
users_groups
.
count
}
)
%ul
.well-list.group-users-list
...
...
app/views/admin/projects/members/_form.html.haml
deleted
100644 → 0
View file @
59f75e6c
=
form_for
@team_member_relation
,
as: :team_member
,
url:
admin_project_member_path
(
@project
,
@member
)
do
|
f
|
-
if
@team_member_relation
.
errors
.
any?
.alert.alert-error
%ul
-
@team_member_relation
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
.clearfix
%label
Project Access:
.input
=
f
.
select
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member_relation
.
project_access
),
{},
class:
"project-access-select chosen span3"
%br
.actions
=
f
.
submit
'Save'
,
class:
"btn btn-primary"
=
link_to
'Cancel'
,
:back
,
class:
"btn"
app/views/admin/projects/members/edit.html.haml
deleted
100644 → 0
View file @
59f75e6c
%p
.slead
Edit access for
=
link_to
@member
.
name
,
admin_user_path
(
@member
)
in
=
link_to
@project
.
name_with_namespace
,
admin_project_path
(
@project
)
%hr
=
render
'form'
app/views/admin/projects/show.html.haml
View file @
ee13297a
...
...
@@ -91,12 +91,16 @@
Team
%small
(
#{
@project
.
users
.
count
}
)
=
link_to
project_team_index_path
(
@project
),
class:
"btn btn-tiny"
do
%i
.icon-edit
Edit Team
.pull-right
=
link_to
project_team_index_path
(
@project
),
class:
"btn btn-tiny"
do
%i
.icon-edit
Manage Access
%ul
.well-list.team_members
-
@project
.
users
.
each
do
|
tm
|
-
@project
.
users
.
each
do
|
user
|
%li
%strong
=
link_to
tm
.
name
,
admin_user_path
(
tm
)
%span
.pull-right.light
=
@project
.
project_access_human
(
tm
)
=
link_to
user
.
name
,
admin_user_path
(
user
)
.pull-right
%span
.light
=
@project
.
project_access_human
(
user
)
=
link_to
admin_project_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn btn-small btn-remove"
do
%i
.icon-remove
app/views/admin/users/show.html.haml
View file @
ee13297a
...
...
@@ -63,15 +63,16 @@
%strong
=
link_to
@admin_user
.
created_by
.
name
,
[
:admin
,
@admin_user
.
created_by
]
-
if
@admin_user
.
owned
_groups
.
present?
-
if
@admin_user
.
users
_groups
.
present?
.ui-box
%h5
.title
Owned g
roups:
%h5
.title
G
roups:
%ul
.well-list
-
@admin_user
.
groups
.
each
do
|
group
|
-
@admin_user
.
users_groups
.
each
do
|
user_group
|
-
group
=
user_group
.
group
%li
%strong
=
link_to
group
.
name
,
admin_group_path
(
group
)
.pull-right
%span
.light
=
user_group
.
human_access
.span6
.ui-box
...
...
@@ -87,16 +88,8 @@
%strong
.well-title
=
truncate
(
project
.
name
,
length:
45
)
-
if
project
.
owner
==
@admin_user
%span
.label.label-info
owner
-
if
tm
.pull-right
=
link_to
edit_admin_project_member_path
(
project
,
tm
.
user
),
class:
"btn grouped btn-small"
do
%i
.icon-edit
=
link_to
admin_project_member_path
(
project
,
tm
.
user
),
confirm:
remove_from_project_team_message
(
project
,
@admin_user
),
method: :delete
,
class:
"btn grouped btn-small btn-remove"
do
%span
.light
=
tm
.
human_access
=
link_to
admin_project_member_path
(
project
,
tm
.
user
),
confirm:
remove_from_project_team_message
(
project
,
@admin_user
),
method: :delete
,
class:
"btn btn-small btn-remove"
do
%i
.icon-remove
.pull-right.light
=
tm
.
project_access_human
config/routes.rb
View file @
ee13297a
...
...
@@ -76,16 +76,7 @@ Gitlab::Application.routes.draw do
resources
:groups
,
constraints:
{
id:
/[^\/]+/
}
do
member
do
put
:project_update
put
:project_teams_update
delete
:remove_project
end
end
resources
:teams
,
constraints:
{
id:
/[^\/]+/
}
do
scope
module: :teams
do
resources
:members
,
only:
[
:edit
,
:update
,
:destroy
,
:new
,
:create
]
resources
:projects
,
only:
[
:edit
,
:update
,
:destroy
,
:new
,
:create
],
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
end
end
...
...
@@ -98,7 +89,7 @@ Gitlab::Application.routes.draw do
resources
:projects
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
},
only:
[
:index
,
:show
]
do
scope
module: :projects
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
do
resources
:members
,
only:
[
:
edit
,
:update
,
:
destroy
]
resources
:members
,
only:
[
:destroy
]
end
end
...
...
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