30 lines
1.1 KiB
Text
30 lines
1.1 KiB
Text
.awards.votes-block
|
|
- awards_sort(votable.notes.awards.grouped_awards).each do |emoji, notes|
|
|
%button.btn.award-control.js-emoji-btn.has-tooltip{class: (note_active_class(notes, current_user)), data: {placement: "top", original_title: emoji_author_list(notes, current_user)}}
|
|
= emoji_icon(emoji, sprite: false)
|
|
%span.award-control-text.js-counter
|
|
= notes.count
|
|
|
|
- if current_user
|
|
%div.award-menu-holder.js-award-holder
|
|
%a.btn.award-control.js-add-award{"href" => "#"}
|
|
= icon('smile-o', {class: "award-control-icon"})
|
|
= icon('spinner spin', {class: "award-control-icon award-control-icon-loading"})
|
|
%span.award-control-text
|
|
Add
|
|
|
|
- if current_user
|
|
:javascript
|
|
var getEmojisUrl = "#{emojis_path}";
|
|
var postEmojiUrl = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}";
|
|
var noteableType = "#{votable.class.name.underscore}";
|
|
var noteableId = "#{votable.id}";
|
|
var unicodes = #{AwardEmoji.unicode.to_json};
|
|
|
|
window.awardsHandler = new AwardsHandler(
|
|
getEmojisUrl,
|
|
postEmojiUrl,
|
|
noteableType,
|
|
noteableId,
|
|
unicodes
|
|
);
|