diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-11-22 19:38:16 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-11-22 19:38:16 +0000 |
commit | c3f858b764d684321e3c0f149f0eb59029ef04e8 (patch) | |
tree | 29f3e70ef786776241449039dfeede8085a89012 /app/views | |
parent | 3cefaca24938d0f1b891054c9c9b6bc3c541c286 (diff) | |
parent | 9d3186e44aa9690c0c6c3af6f979132baf34cb41 (diff) | |
download | gitlab-ce-c3f858b764d684321e3c0f149f0eb59029ef04e8.tar.gz |
Merge branch 'emoji-btn-disabled' into 'master'
Disabled award emoji button when user is not logged in
## What does this MR do?
The award emoji buttons are now disabled when the user is not signed in, stopping them from clicking it & then getting an error.
## Screenshots (if relevant)
![Screen_Shot_2016-11-22_at_10.25.20](/uploads/210378bde90e689fbc12940ce271c05e/Screen_Shot_2016-11-22_at_10.25.20.png)
## What are the relevant issue numbers?
Closes #24680
See merge request !7651
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/award_emoji/_awards_block.html.haml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/views/award_emoji/_awards_block.html.haml b/app/views/award_emoji/_awards_block.html.haml index fbe3ab912b6..d8912eda314 100644 --- a/app/views/award_emoji/_awards_block.html.haml +++ b/app/views/award_emoji/_awards_block.html.haml @@ -1,7 +1,10 @@ - grouped_emojis = awardable.grouped_awards(with_thumbs: inline) .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_active_class(awards, current_user)), data: { placement: "bottom", title: award_user_list(awards, current_user) } } + %button.btn.award-control.js-emoji-btn.has-tooltip{ type: "button", + disabled: !current_user, + class: (award_active_class(awards, current_user)), + data: { placement: "bottom", title: award_user_list(awards, current_user) } } = emoji_icon(emoji, sprite: false) %span.award-control-text.js-counter = awards.count |