summaryrefslogtreecommitdiff
path: root/app/views/projects/buttons/_fork.html.haml
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-08 12:25:34 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-08 12:25:34 +0200
commitc2f02fc1a4b88e1c01cb3562168322d0c5debba3 (patch)
treebcfc20e755dcdb8e07e7aa6600643e3d76585a0b /app/views/projects/buttons/_fork.html.haml
parent5be6cbac6fd50f6e97c483f78de667ce5628a3ce (diff)
downloadgitlab-ce-c2f02fc1a4b88e1c01cb3562168322d0c5debba3.tar.gz
Refactor star and fork buttons
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/projects/buttons/_fork.html.haml')
-rw-r--r--app/views/projects/buttons/_fork.html.haml13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/views/projects/buttons/_fork.html.haml b/app/views/projects/buttons/_fork.html.haml
new file mode 100644
index 00000000000..f0483c79edc
--- /dev/null
+++ b/app/views/projects/buttons/_fork.html.haml
@@ -0,0 +1,13 @@
+- if current_user && can?(current_user, :fork_project, @project)
+ - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
+ = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to your fork', class: 'btn' do
+ = icon('code-fork')
+ Fork
+ %span.count
+ = @project.forks_count
+ - else
+ = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn' do
+ = icon('code-fork')
+ Fork
+ %span.count
+ = @project.forks_count