319c936055
Previously it would look for the unicode character inside the award menu. But this menu might not always be there. Now, the unicode characters are loaded onto the page in an array which the award emoji that looks in to get the correct emoji unicode character Fixes #15512
30 lines
1.2 KiB
Text
30 lines
1.2 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 get_emojis_url = "#{emojis_path}";
|
|
var post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}";
|
|
var noteable_type = "#{votable.class.name.underscore}";
|
|
var noteable_id = "#{votable.id}";
|
|
var unicodes = #{AwardEmoji.unicode.to_json};
|
|
|
|
window.awards_handler = new AwardsHandler(
|
|
get_emojis_url,
|
|
post_emoji_url,
|
|
noteable_type,
|
|
noteable_id,
|
|
unicodes
|
|
);
|