debian-mirror-gitlab/app/views/votes/_votes_block.html.haml

31 lines
1.1 KiB
Text
Raw Normal View History

2015-11-26 14:37:03 +05:30
.awards.votes-block
- awards_sort(votable.notes.awards.grouped_awards).each do |emoji, notes|
2016-06-02 11:05:42 +05:30
%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
2015-11-26 14:37:03 +05:30
= notes.count
- if current_user
2016-06-02 11:05:42 +05:30
%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
2015-11-26 14:37:03 +05:30
- if current_user
:javascript
2016-06-02 11:05:42 +05:30
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};
2015-11-26 14:37:03 +05:30
2016-06-02 11:05:42 +05:30
window.awardsHandler = new AwardsHandler(
getEmojisUrl,
postEmojiUrl,
noteableType,
noteableId,
unicodes
);