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
0815098d
Commit
0815098d
authored
Nov 15, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin can transfer project to any namespace
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
dcea1913
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
23 deletions
+79
-23
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+30
-0
app/assets/stylesheets/selects.scss
app/assets/stylesheets/selects.scss
+0
-19
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+21
-3
app/models/namespace.rb
app/models/namespace.rb
+4
-0
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+17
-0
config/routes.rb
config/routes.rb
+7
-1
No files found.
app/assets/stylesheets/common.scss
View file @
0815098d
...
...
@@ -358,3 +358,33 @@ table {
background
:
#555
;
color
:
#BBB
;
}
.ajax-users-select
{
width
:
400px
;
&
.input-large
{
width
:
210px
;
}
}
.user-result
{
.user-image
{
float
:
left
;
}
.user-name
{
}
.user-username
{
color
:
#999
;
}
}
.namespace-result
{
.namespace-kind
{
color
:
#AAA
;
font-weight
:
normal
;
}
.namespace-path
{
margin-left
:
10px
;
font-weight
:
bolder
;
}
}
app/assets/stylesheets/selects.scss
View file @
0815098d
.ajax-users-select
{
width
:
400px
;
&
.input-large
{
width
:
210px
;
}
}
.user-result
{
.user-image
{
float
:
left
;
}
.user-name
{
}
.user-username
{
color
:
#999
;
}
}
/** Chosen.js selectbox style override **/
.chosen-container
{
min-width
:
100px
;
...
...
app/controllers/admin/projects_controller.rb
View file @
0815098d
class
Admin::ProjectsController
<
Admin
::
ApplicationController
before_filter
:project
,
only:
[
:edit
,
:show
,
:update
,
:destroy
,
:team_update
]
before_filter
:project
,
only:
[
:show
,
:transfer
]
before_filter
:group
,
only:
[
:show
,
:transfer
]
before_filter
:repository
,
only:
[
:show
,
:transfer
]
def
index
owner_id
=
params
[
:owner_id
]
...
...
@@ -14,8 +16,16 @@ class Admin::ProjectsController < Admin::ApplicationController
end
def
show
@repository
=
@project
.
repository
@group
=
@project
.
group
end
def
transfer
result
=
::
Projects
::
TransferContext
.
new
(
@project
,
current_user
,
project:
params
).
execute
(
:admin
)
if
result
redirect_to
[
:admin
,
@project
]
else
render
:show
end
end
protected
...
...
@@ -26,4 +36,12 @@ class Admin::ProjectsController < Admin::ApplicationController
@project
=
Project
.
find_with_namespace
(
id
)
@project
||
render_404
end
def
group
@group
||=
project
.
group
end
def
repository
@repository
||=
project
.
repository
end
end
app/models/namespace.rb
View file @
0815098d
...
...
@@ -87,4 +87,8 @@ class Namespace < ActiveRecord::Base
def
send_update_instructions
projects
.
each
(
&
:send_move_instructions
)
end
def
kind
type
==
'Group'
?
'group'
:
'user'
end
end
app/views/admin/projects/show.html.haml
View file @
0815098d
...
...
@@ -74,6 +74,23 @@
%span
.cgreen
%i
.icon-lock
Private
.ui-box
.title
Transfer project
.ui-box-body
=
form_for
@project
,
url:
transfer_admin_project_path
(
@project
),
method: :put
do
|
f
|
.control-group
=
f
.
label
:namespace_id
,
"Namespace"
.controls
=
namespace_select_tag
:namespace_id
,
selected:
params
[
:namespace_id
],
class:
'input-large'
.control-group
.controls
=
f
.
submit
'Transfer'
,
class:
'btn btn-primary'
.span6
-
if
@group
.ui-box
...
...
config/routes.rb
View file @
0815098d
...
...
@@ -89,7 +89,13 @@ Gitlab::Application.routes.draw do
resources
:broadcast_messages
,
only:
[
:index
,
:create
,
:destroy
]
resource
:logs
,
only:
[
:show
]
resource
:background_jobs
,
controller:
'background_jobs'
,
only:
[
:show
]
resources
:projects
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
},
only:
[
:index
,
:show
]
resources
:projects
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
},
only:
[
:index
,
:show
]
do
member
do
put
:transfer
end
end
root
to:
"dashboard#index"
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