Commit 4caf38a1 authored by Phil Hughes's avatar Phil Hughes Committed by Fatih Acet

Refactored JS slightly to make things easier

# Conflicts:
#	app/assets/javascripts/awards_handler.coffee
#	app/views/emoji_awards/_awards_block.html.haml
parent 6c89e2fd
.awards.votes-block.js-votes-block{ data: { award_url: url_for([:toggle_emoji_award, @project.namespace.becomes(Namespace), @project, awardable]) } }
- awards_sort(awardable.grouped_awards).each do |emoji, awards|
%button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button", class: (award_active_class(awards, current_user)), title: award_user_list(awards, current_user) }
= emoji_icon(emoji)
%span.award-control-text.js-counter
= awards.count
- if current_user
%div.award-menu-holder.js-award-holder
%button.btn.award-control.js-add-award{ type: "button" }
= 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 aliases = #{AwardEmoji.aliases.to_json};
window.awards_handler = new AwardsHandler(
aliases
);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment