diff options
-rw-r--r-- | app/helpers/projects_helper.rb | 8 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index d22526947dd..f7da30bcc4b 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -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) diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 1627a61d236..2c1ac06fc90 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -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' : ''} |