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
iv
gitlab-ce
Commits
79a4da90
Commit
79a4da90
authored
10 years ago
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7816 from cirosantilli/factor-fork
Factor fork button view.
parents
f0c0edc2
b5c0bdd7
No related merge requests found
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 @
79a4da90
...
...
@@ -156,6 +156,14 @@ module ProjectsHelper
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
def
get_project_nav_tabs
(
project
,
current_user
)
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/_home_panel.html.haml
View file @
79a4da90
...
...
@@ -18,16 +18,10 @@
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
&&
@project
.
namespace
!=
current_user
.
namespace
-
if
current_user
.
already_forked?
(
@project
)
=
link_to
project_path
(
current_user
.
fork_of
(
@project
)),
title:
'Got to my fork'
do
%i
.icon-code-fork
Fork
%span
.count
=
@project
.
forks_count
=
link_to_toggle_fork
-
else
=
link_to
fork_project_path
(
@project
),
title:
"Fork project"
,
method:
"POST"
do
%i
.icon-code-fork
Fork
%span
.count
=
@project
.
forks_count
=
link_to_toggle_fork
.star-buttons
%span
.star.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
...
...
This diff is collapsed.
Click to expand it.
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