debian-mirror-gitlab/app/views/award_emoji/_awards_block.html.haml

22 lines
1.4 KiB
Text
Raw Normal View History

- grouped_emojis = awardable.grouped_awards(with_thumbs: inline)
2017-08-17 22:00:37 +05:30
- user_authored = awardable.user_authored?(current_user)
2016-09-29 09:46:39 +05:30
.awards.js-awards-block{ class: ("hidden" if !inline && grouped_emojis.empty?), data: { award_url: toggle_award_url(awardable) } }
- awards_sort(grouped_emojis).each do |emoji, awards|
2017-08-17 22:00:37 +05:30
%button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button",
2018-05-09 12:01:36 +05:30
class: [(award_state_class(awardable, awards, current_user)), (award_user_authored_class(emoji) if user_authored)],
2017-08-17 22:00:37 +05:30
data: { placement: "bottom", title: award_user_list(awards, current_user) } }
= emoji_icon(emoji)
%span.award-control-text.js-counter
= awards.count
2018-05-09 12:01:36 +05:30
- if can?(current_user, :award_emoji, awardable)
.award-menu-holder.js-award-holder
2017-08-17 22:00:37 +05:30
%button.btn.award-control.has-tooltip.js-add-award{ type: 'button',
2017-09-10 17:25:29 +05:30
'aria-label': 'Add reaction',
2017-08-17 22:00:37 +05:30
class: ("js-user-authored" if user_authored),
2017-09-10 17:25:29 +05:30
data: { title: 'Add reaction', placement: "bottom" } }
2017-08-17 22:00:37 +05:30
%span{ class: "award-control-icon award-control-icon-neutral" }= custom_icon('emoji_slightly_smiling_face')
%span{ class: "award-control-icon award-control-icon-positive" }= custom_icon('emoji_smiley')
%span{ class: "award-control-icon award-control-icon-super-positive" }= custom_icon('emoji_smile')
= icon('spinner spin', class: "award-control-icon award-control-icon-loading")