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
b5c0bdd7
Commit
b5c0bdd7
authored
Sep 21, 2014
by
Ciro Santilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor fork button view.
parent
fda61a04
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+8
-0
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+2
-8
No files found.
app/helpers/projects_helper.rb
View file @
b5c0bdd7
...
@@ -156,6 +156,14 @@ module ProjectsHelper
...
@@ -156,6 +156,14 @@ module ProjectsHelper
end
end
end
end
def
link_to_toggle_fork
out
=
content_tag
(
:i
,
''
,
class:
'icon-code-fork'
)
out
<<
' Fork'
out
<<
content_tag
(
:span
,
class:
'count'
)
do
@project
.
forks_count
.
to_s
end
end
private
private
def
get_project_nav_tabs
(
project
,
current_user
)
def
get_project_nav_tabs
(
project
,
current_user
)
...
...
app/views/projects/_home_panel.html.haml
View file @
b5c0bdd7
...
@@ -18,16 +18,10 @@
...
@@ -18,16 +18,10 @@
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
&&
@project
.
namespace
!=
current_user
.
namespace
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
&&
@project
.
namespace
!=
current_user
.
namespace
-
if
current_user
.
already_forked?
(
@project
)
-
if
current_user
.
already_forked?
(
@project
)
=
link_to
project_path
(
current_user
.
fork_of
(
@project
)),
title:
'Got to my fork'
do
=
link_to
project_path
(
current_user
.
fork_of
(
@project
)),
title:
'Got to my fork'
do
%i
.icon-code-fork
=
link_to_toggle_fork
Fork
%span
.count
=
@project
.
forks_count
-
else
-
else
=
link_to
fork_project_path
(
@project
),
title:
"Fork project"
,
method:
"POST"
do
=
link_to
fork_project_path
(
@project
),
title:
"Fork project"
,
method:
"POST"
do
%i
.icon-code-fork
=
link_to_toggle_fork
Fork
%span
.count
=
@project
.
forks_count
.star-buttons
.star-buttons
%span
.star.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
%span
.star.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
...
...
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