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
7b5d68f0
Commit
7b5d68f0
authored
Jun 10, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error page if forking fails
parent
1487ed3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
5 deletions
+27
-5
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+6
-5
app/views/projects/fork.html.haml
app/views/projects/fork.html.haml
+19
-0
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-0
No files found.
CHANGELOG
View file @
7b5d68f0
...
@@ -23,6 +23,7 @@ v 5.3.0
...
@@ -23,6 +23,7 @@ v 5.3.0
- Fix dashboard event filter when navigate via turbolinks
- Fix dashboard event filter when navigate via turbolinks
- init.d: Ensure socket is removed before starting service
- init.d: Ensure socket is removed before starting service
- Admin area: Style teams:index, group:show pages
- Admin area: Style teams:index, group:show pages
- Own page for failed forking
v 5.2.0
v 5.2.0
- Turbolinks
- Turbolinks
...
...
app/controllers/projects_controller.rb
View file @
7b5d68f0
...
@@ -7,7 +7,7 @@ class ProjectsController < ProjectResourceController
...
@@ -7,7 +7,7 @@ class ProjectsController < ProjectResourceController
before_filter
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:destroy
,
:transfer
]
before_filter
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:destroy
,
:transfer
]
before_filter
:require_non_empty_project
,
only:
[
:blob
,
:tree
,
:graph
]
before_filter
:require_non_empty_project
,
only:
[
:blob
,
:tree
,
:graph
]
layout
'navless'
,
only:
[
:new
,
:create
]
layout
'navless'
,
only:
[
:new
,
:create
,
:fork
]
before_filter
:set_title
,
only:
[
:new
,
:create
]
before_filter
:set_title
,
only:
[
:new
,
:create
]
def
new
def
new
...
@@ -81,14 +81,15 @@ class ProjectsController < ProjectResourceController
...
@@ -81,14 +81,15 @@ class ProjectsController < ProjectResourceController
end
end
def
fork
def
fork
@project
=
::
Projects
::
ForkContext
.
new
(
project
,
current_user
).
execute
@
forked_
project
=
::
Projects
::
ForkContext
.
new
(
project
,
current_user
).
execute
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
if
@
project
.
saved?
&&
@
project
.
forked?
if
@
forked_project
.
saved?
&&
@forked_
project
.
forked?
redirect_to
(
@project
,
notice:
'Project was successfully forked.'
)
redirect_to
(
@
forked_
project
,
notice:
'Project was successfully forked.'
)
else
else
render
action:
"new"
@title
=
'Fork project'
render
action:
"fork"
end
end
end
end
format
.
js
format
.
js
...
...
app/views/projects/fork.html.haml
0 → 100644
View file @
7b5d68f0
.alert.alert-error.alert-block
%h4
%i
.icon-code-fork
Fork Error!
%p
You are trying to fork
=
link_to_project
@project
but it fails due to next reason:
-
if
@forked_project
&&
@forked_project
.
errors
.
any?
%p
–
=
@forked_project
.
errors
.
full_messages
.
first
%p
=
link_to
fork_project_path
(
@project
),
title:
"Fork"
,
class:
"btn"
,
method:
"POST"
do
%i
.icon-code-fork
Try to Fork again
app/views/projects/show.html.haml
View file @
7b5d68f0
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
%p
Owner:
#{
link_to
@project
.
owner_name
,
@project
.
owner
}
%p
Owner:
#{
link_to
@project
.
owner_name
,
@project
.
owner
}
-
if
@project
.
forked_from_project
-
if
@project
.
forked_from_project
%p
%p
%i
.icon-code-fork
Forked from:
Forked from:
=
link_to
@project
.
forked_from_project
.
name_with_namespace
,
project_path
(
@project
.
forked_from_project
)
=
link_to
@project
.
forked_from_project
.
name_with_namespace
,
project_path
(
@project
.
forked_from_project
)
...
...
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