summaryrefslogtreecommitdiff
path: root/app/views/projects/_home_panel.html.haml
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-29 18:50:45 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-29 18:50:45 -0700
commit9d6ffcfa5f09608d81031c7e366470b9c8a46db8 (patch)
tree03f25e79adbfcdd405c82eb9a269ee1578c41a6b /app/views/projects/_home_panel.html.haml
parent405f91d2b8eb7c8276341ac44fcabc758fc89343 (diff)
downloadgitlab-ce-9d6ffcfa5f09608d81031c7e366470b9c8a46db8.tar.gz
Refactor star btn logic for non-logged in user and fix tests
Diffstat (limited to 'app/views/projects/_home_panel.html.haml')
-rw-r--r--app/views/projects/_home_panel.html.haml11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index 774be6cd138..5689bdee1c6 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -17,8 +17,15 @@
.project-repo-buttons
.inline.star.js-toggler-container{class: @show_star ? 'on' : ''}
- if current_user
- = link_to_toggle_star('Star this project.', false, true)
- = link_to_toggle_star('Unstar this project.', true, true)
+ = link_to_toggle_star('Star this project.', false)
+ = link_to_toggle_star('Unstar this project.', true)
+ - else
+ = link_to new_user_session_path, class: 'btn star-btn has_tooltip', title: 'You must sign in to star a project' do
+ %span
+ = icon('star')
+ Star
+ %span.count
+ = @project.star_count
- unless @project.empty_repo?
- if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace
.inline.fork-buttons.prepend-left-10