Commit 79a4da90 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #7816 from cirosantilli/factor-fork

Factor fork button view.
parents f0c0edc2 b5c0bdd7
......@@ -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)
......
......@@ -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' : ''}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment