Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_star.html.haml « buttons « projects « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 06583902035de013d505250661d194a988b7ffe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
- if current_user
  = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn star-btn toggle-star', method: :post, remote: true do
    = icon('star fw')
    %span.count
      = @project.star_count

  :javascript
    $('.project-home-panel .toggle-star').on('ajax:success', function (e, data, status, xhr) {
      $(this).replaceWith(data.html);
    })
    .on('ajax:error', function (e, xhr, status, error) {
      new Flash('Star toggle failed. Try again later.', 'alert');
    });

- else
  = link_to new_user_session_path, class: 'btn has_tooltip star-btn', title: 'You must sign in to star a project' do
    = icon('star fw')
    %span.count
      = @project.star_count