diff options
author | barthc <mackintosh02@gmail.com> | 2016-09-08 11:08:09 +0100 |
---|---|---|
committer | barthc <mackintosh02@gmail.com> | 2017-04-14 09:33:28 +0100 |
commit | 04e2dde538b7a91de0ffdd09d355e9c990b4c7b1 (patch) | |
tree | 8139527c01760cfec392d5250583f5d9b4459f74 /app/views/award_emoji | |
parent | 0497d3eadb67f347a6376c77cbd39511e5136bfb (diff) | |
download | gitlab-ce-04e2dde538b7a91de0ffdd09d355e9c990b4c7b1.tar.gz |
frontend prevent authored votes
Diffstat (limited to 'app/views/award_emoji')
-rw-r--r-- | app/views/award_emoji/_awards_block.html.haml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/views/award_emoji/_awards_block.html.haml b/app/views/award_emoji/_awards_block.html.haml index 3ca45fbf751..9aabfb49a29 100644 --- a/app/views/award_emoji/_awards_block.html.haml +++ b/app/views/award_emoji/_awards_block.html.haml @@ -1,8 +1,9 @@ - grouped_emojis = awardable.grouped_awards(with_thumbs: inline) +- user_authored = awardable.user_authored?(current_user) .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| %button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button", - class: (award_state_class(awards, current_user)), + class: [(award_state_class(awards, current_user)), (award_user_authored_class(emoji) if user_authored)], data: { placement: "bottom", title: award_user_list(awards, current_user) } } = emoji_icon(emoji) %span.award-control-text.js-counter @@ -12,6 +13,7 @@ .award-menu-holder.js-award-holder %button.btn.award-control.has-tooltip.js-add-award{ type: 'button', 'aria-label': 'Add emoji', + class: ("js-user-authored" if user_authored), data: { title: 'Add emoji', placement: "bottom" } } %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') |