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
7765ce18
Commit
7765ce18
authored
Jan 11, 2016
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup new fork link in sidebar and routes. #2406
parent
a382ad99
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
10 deletions
+20
-10
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+3
-0
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+2
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+7
-0
app/views/projects/buttons/_dropdown.html.haml
app/views/projects/buttons/_dropdown.html.haml
+1
-1
app/views/projects/buttons/_fork.html.haml
app/views/projects/buttons/_fork.html.haml
+1
-1
app/views/projects/forks/new.html.haml
app/views/projects/forks/new.html.haml
+1
-1
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+3
-3
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/projects/forks_controller.rb
View file @
7765ce18
...
...
@@ -3,6 +3,9 @@ class Projects::ForksController < Projects::ApplicationController
before_action
:require_non_empty_project
before_action
:authorize_download_code!
def
index
end
def
new
@namespaces
=
current_user
.
manageable_namespaces
@namespaces
.
delete
(
@project
.
namespace
)
...
...
app/helpers/blob_helper.rb
View file @
7765ce18
...
...
@@ -47,7 +47,7 @@ module BlobHelper
notice:
edit_in_new_fork_notice
,
notice_now:
edit_in_new_fork_notice_now
}
fork_path
=
namespace_project_fork_path
(
project
.
namespace
,
project
,
namespace_key:
current_user
.
namespace
.
id
,
fork_path
=
namespace_project_fork
s
_path
(
project
.
namespace
,
project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
link_to
"Edit"
,
fork_path
,
class:
'btn btn-small'
,
method: :post
...
...
@@ -73,7 +73,7 @@ module BlobHelper
notice:
edit_in_new_fork_notice
+
" Try to
#{
action
}
this file again."
,
notice_now:
edit_in_new_fork_notice_now
}
fork_path
=
namespace_project_fork_path
(
project
.
namespace
,
project
,
namespace_key:
current_user
.
namespace
.
id
,
fork_path
=
namespace_project_fork
s
_path
(
project
.
namespace
,
project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
link_to
label
,
fork_path
,
class:
"btn btn-
#{
btn_class
}
"
,
method: :post
...
...
app/helpers/projects_helper.rb
View file @
7765ce18
...
...
@@ -116,7 +116,7 @@ module ProjectsHelper
private
def
get_project_nav_tabs
(
project
,
current_user
)
nav_tabs
=
[
:home
]
nav_tabs
=
[
:home
,
:forks
]
if
!
project
.
empty_repo?
&&
can?
(
current_user
,
:download_code
,
project
)
nav_tabs
<<
[
:files
,
:commits
,
:network
,
:graphs
]
...
...
app/views/layouts/nav/_project.html.haml
View file @
7765ce18
...
...
@@ -98,6 +98,13 @@
%span
Wiki
-
if
project_nav_tab?
:forks
=
nav_link
(
controller: :forks
,
action: :index
)
do
=
link_to
namespace_project_forks_path
(
@project
.
namespace
,
@project
),
title:
'Forks'
,
class:
'shortcuts-wiki'
do
=
icon
(
'book fw'
)
%span
Forks
-
if
project_nav_tab?
:snippets
=
nav_link
(
controller: :snippets
)
do
=
link_to
namespace_project_snippets_path
(
@project
.
namespace
,
@project
),
title:
'Snippets'
,
class:
'shortcuts-snippets'
do
...
...
app/views/projects/buttons/_dropdown.html.haml
View file @
7765ce18
...
...
@@ -46,7 +46,7 @@
-
continue_params
=
{
to:
namespace_project_new_blob_path
(
@project
.
namespace
,
@project
,
@project
.
default_branch
||
'master'
),
notice:
edit_in_new_fork_notice
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_fork_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
-
fork_path
=
namespace_project_fork
s
_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'file fw'
)
...
...
app/views/projects/buttons/_fork.html.haml
View file @
7765ce18
...
...
@@ -9,7 +9,7 @@
%span
.count
=
@project
.
forks_count
-
else
=
link_to
new_namespace_project_fork_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
,
class:
'btn has_tooltip'
do
=
link_to
new_namespace_project_fork
s
_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
,
class:
'btn has_tooltip'
do
=
icon
(
'code-fork fw'
)
Fork
%div
.count-with-arrow
...
...
app/views/projects/forks/new.html.haml
View file @
7765ce18
...
...
@@ -22,7 +22,7 @@
-
else
.fork-thumbnail
=
link_to
namespace_project_fork_path
(
@project
.
namespace
,
@project
,
namespace_key:
namespace
.
id
),
title:
"Fork here"
,
method:
"POST"
,
class:
'has_tooltip'
do
=
link_to
namespace_project_fork
s
_path
(
@project
.
namespace
,
@project
,
namespace_key:
namespace
.
id
),
title:
"Fork here"
,
method:
"POST"
,
class:
'has_tooltip'
do
=
image_tag
namespace_icon
(
namespace
,
100
)
.caption
%strong
...
...
app/views/projects/tree/_tree_header.html.haml
View file @
7765ce18
...
...
@@ -40,7 +40,7 @@
-
continue_params
=
{
to:
namespace_project_new_blob_path
(
@project
.
namespace
,
@project
,
@id
),
notice:
edit_in_new_fork_notice
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_fork_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
-
fork_path
=
namespace_project_fork
s
_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'pencil fw'
)
...
...
@@ -49,7 +49,7 @@
-
continue_params
=
{
to:
request
.
fullpath
,
notice:
edit_in_new_fork_notice
+
" Try to upload a file again."
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_fork_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
-
fork_path
=
namespace_project_fork
s
_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'file fw'
)
...
...
@@ -58,7 +58,7 @@
-
continue_params
=
{
to:
request
.
fullpath
,
notice:
edit_in_new_fork_notice
+
" Try to create a new directory again."
,
notice_now:
edit_in_new_fork_notice_now
}
-
fork_path
=
namespace_project_fork_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
-
fork_path
=
namespace_project_fork
s
_path
(
@project
.
namespace
,
@project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
=
link_to
fork_path
,
method: :post
do
=
icon
(
'folder fw'
)
...
...
config/routes.rb
View file @
7765ce18
...
...
@@ -554,7 +554,7 @@ Rails.application.routes.draw do
end
end
resource
:fork
,
only:
[
:new
,
:create
]
resource
s
:forks
,
only:
[
:index
,
:new
,
:create
]
resource
:import
,
only:
[
:new
,
:create
,
:show
]
resources
:refs
,
only:
[]
do
...
...
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