2015-07-08 06:25:34 -04:00
|
|
|
- if current_user
|
2015-11-12 06:44:33 -05:00
|
|
|
= 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-07-31 07:56:15 -04:00
|
|
|
= icon('star fw')
|
2015-07-08 06:25:34 -04:00
|
|
|
%span.count
|
|
|
|
= @project.star_count
|
2015-07-08 10:55:04 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
: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-07-08 10:55:04 -04:00
|
|
|
|
2015-07-08 06:25:34 -04:00
|
|
|
- else
|
2015-07-08 10:55:04 -04:00
|
|
|
= link_to new_user_session_path, class: 'btn has_tooltip star-btn', title: 'You must sign in to star a project' do
|
2015-07-31 07:56:15 -04:00
|
|
|
= icon('star fw')
|
2015-07-08 06:25:34 -04:00
|
|
|
%span.count
|
|
|
|
= @project.star_count
|