BigW Consortium Gitlab

_awards_block.html.haml 1.34 KB
Newer Older
1
- grouped_emojis = awardable.grouped_awards(with_thumbs: inline)
2
- user_authored = awardable.user_authored?(current_user)
3
.awards.js-awards-block{ class: ("hidden" if !inline && grouped_emojis.empty?), data: { award_url: toggle_award_url(awardable) } }
4
  - awards_sort(grouped_emojis).each do |emoji, awards|
5
    %button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button",
6
      class: [(award_state_class(awards, current_user)), (award_user_authored_class(emoji) if user_authored)],
7
      data: { placement: "bottom", title: award_user_list(awards, current_user) } }
8
      = emoji_icon(emoji)
9 10 11 12 13
      %span.award-control-text.js-counter
        = awards.count

  - if current_user
    .award-menu-holder.js-award-holder
14
      %button.btn.award-control.has-tooltip.js-add-award{ type: 'button',
15
        'aria-label': 'Add reaction',
16
        class: ("js-user-authored" if user_authored),
17
        data: { title: 'Add reaction', placement: "bottom" } }
18 19 20
        %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')
21
        = icon('spinner spin', class: "award-control-icon award-control-icon-loading")