debian-mirror-gitlab/app/views/projects/buttons/_star.html.haml

20 lines
740 B
Text
Raw Normal View History

2015-09-11 14:41:01 +05:30
- if current_user
2015-11-26 14:37:03 +05:30
= 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
2015-09-11 14:41:01 +05:30
= icon('star fw')
%span.count
= @project.star_count
2015-11-26 14:37:03 +05:30
: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');
});
2015-09-11 14:41:01 +05:30
- 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