2015-11-26 14:37:03 +05:30
|
|
|
.awards.votes-block
|
2016-01-14 18:37:52 +05:30
|
|
|
- awards_sort(votable.notes.awards.grouped_awards).each do |emoji, notes|
|
2015-11-26 14:37:03 +05:30
|
|
|
.award{class: (note_active_class(notes, current_user)), title: emoji_author_list(notes, current_user)}
|
2016-01-14 18:37:52 +05:30
|
|
|
= emoji_icon(emoji)
|
2015-11-26 14:37:03 +05:30
|
|
|
.counter
|
|
|
|
= notes.count
|
|
|
|
|
|
|
|
- if current_user
|
2016-01-14 18:37:52 +05:30
|
|
|
.awards-controls
|
2016-04-02 18:10:28 +05:30
|
|
|
%a.add-award{"href" => "#"}
|
2015-11-26 14:37:03 +05:30
|
|
|
= icon('smile-o')
|
2016-01-14 18:37:52 +05:30
|
|
|
.emoji-menu
|
|
|
|
.emoji-menu-content
|
|
|
|
= text_field_tag :emoji_search, "", class: "emoji-search search-input form-control"
|
|
|
|
- AwardEmoji.emoji_by_category.each do |category, emojis|
|
|
|
|
%h5= AwardEmoji::CATEGORIES[category]
|
|
|
|
%ul
|
|
|
|
- emojis.each do |emoji|
|
|
|
|
%li
|
|
|
|
= emoji_icon(emoji["name"], emoji["unicode"], emoji["aliases"])
|
2015-11-26 14:37:03 +05:30
|
|
|
|
|
|
|
- if current_user
|
2016-01-14 18:37:52 +05:30
|
|
|
:javascript
|
|
|
|
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 aliases = #{AwardEmoji.aliases.to_json};
|
2015-11-26 14:37:03 +05:30
|
|
|
|
2016-01-14 18:37:52 +05:30
|
|
|
window.awards_handler = new AwardsHandler(
|
|
|
|
post_emoji_url,
|
|
|
|
noteable_type,
|
|
|
|
noteable_id,
|
|
|
|
aliases
|
|
|
|
);
|
2015-11-26 14:37:03 +05:30
|
|
|
|
2016-01-14 18:37:52 +05:30
|
|
|
$(".awards").on("click", ".emoji-menu-content li", function(e) {
|
|
|
|
var emoji = $(this).find(".emoji-icon").data("emoji");
|
|
|
|
awards_handler.addAward(emoji);
|
|
|
|
});
|
2015-11-26 14:37:03 +05:30
|
|
|
|
2016-01-14 18:37:52 +05:30
|
|
|
$(".awards").on("click", ".award", function(e) {
|
|
|
|
var emoji = $(this).find(".icon").data("emoji");
|
|
|
|
awards_handler.addAward(emoji);
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".award").tooltip();
|
|
|
|
|
|
|
|
$(".emoji-menu-content").niceScroll({cursorwidth: "7px", autohidemode: false});
|