diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2015-12-18 17:12:47 -0500 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2015-12-23 12:26:50 -0500 |
commit | f56783e5244c8199dc30fb8374a96d8e5d96549c (patch) | |
tree | 0ecd840a232c7c7d566349ac4423a5ea97aa6f0e /app/views/projects/buttons/_star.html.haml | |
parent | 011a7a32978ea6cfc7857f9afa7f2f242a753634 (diff) | |
download | gitlab-ce-f56783e5244c8199dc30fb8374a96d8e5d96549c.tar.gz |
adds dropdown for cloning
Diffstat (limited to 'app/views/projects/buttons/_star.html.haml')
-rw-r--r-- | app/views/projects/buttons/_star.html.haml | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index 4289d7afd26..aba959f991a 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -1,9 +1,10 @@ - if current_user = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn star-btn toggle-star has_tooltip', method: :post, remote: true, title: "Star project" do - = icon('star fw') - if current_user.starred?(@project) + = icon('star fw') %span.starred Unstar - else + = icon('star-o fw') %span Star %div.count-with-arrow %span.arrow @@ -14,16 +15,26 @@ $('.project-home-panel .toggle-star').on('ajax:success', function (e, data, status, xhr) { var $this = $(this); var $starSpan = $this.find('span'); + var $starIcon = $this.find('i'); $this .parent() .find('span.count') .text(data.star_count); if($starSpan.hasClass('starred')){ - $starSpan.removeClass('starred'); - $starSpan.text('Star'); + $starSpan + .removeClass('starred') + .text('Star'); + $starIcon + .removeClass('fa-star') + .addClass('fa-star-o'); + } else { - $starSpan.addClass('starred'); - $starSpan.text('Unstar'); + $starSpan + .addClass('starred') + .text('Unstar'); + $starIcon + .removeClass('fa-star-o') + .addClass('fa-star'); } }) .on('ajax:error', function (e, xhr, status, error) { |