You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2019/03/15 16:36:31 UTC

[allura] 02/04: [#8263] Limit reactions list interactivity using permission checks

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 36a929feb82cd5ddb244943ea00924594180bcff
Author: Shalitha Suranga <sh...@gmail.com>
AuthorDate: Thu Mar 14 09:26:19 2019 +0530

    [#8263] Limit reactions list interactivity using permission checks
---
 Allura/allura/lib/widgets/resources/js/reactions.js | 2 +-
 Allura/allura/nf/allura/css/site_style.css          | 5 ++++-
 Allura/allura/templates/widgets/post_widget.html    | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/lib/widgets/resources/js/reactions.js b/Allura/allura/lib/widgets/resources/js/reactions.js
index 8be73a8..b45aad0 100644
--- a/Allura/allura/lib/widgets/resources/js/reactions.js
+++ b/Allura/allura/lib/widgets/resources/js/reactions.js
@@ -63,7 +63,7 @@ $(function () {
         });
     });
 
-    attachClickEvents($('.reactions .reaction'));
+    attachClickEvents($('.reactions-active .reaction'));
 
 });
 
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 6489521..69d0b5f 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2542,7 +2542,10 @@ div.attachment_item{
 #comment .display_post .reactions .reaction {
     display: inline-block;
     padding: 2px;
-    cursor: pointer;
+}
+
+#comment .display_post .reactions-active .reaction {
+  cursor: pointer;
 }
 
 #comment .display_post .reactions .reaction-current {
diff --git a/Allura/allura/templates/widgets/post_widget.html b/Allura/allura/templates/widgets/post_widget.html
index 9ed02e1..072c07f 100644
--- a/Allura/allura/templates/widgets/post_widget.html
+++ b/Allura/allura/templates/widgets/post_widget.html
@@ -84,7 +84,7 @@
             {% endif %}
 
             <div{% if h.has_access(value, 'moderate') %} class="active-md" data-markdownlink="{{value.url()}}" {% endif %}>{{g.markdown.cached_convert(value, 'text')|safe}}</div>&nbsp;
-            <div class='reactions' style='user-select: none; cursor: default'>
+            <div class='reactions{% if h.has_access(value, 'moderate') %} reactions-active{% endif %}' style='user-select: none; cursor: default'>
               {% for reaction in value.react_counts %}<div class="reaction{% if current_reaction == reaction %} reaction-current{% endif %}" data-react="{{ reaction }}"><div class="emoj">{{ h.emojize(reaction) }}</div><div class="emoj-count">{{ value.react_counts[reaction] }}</div></div>{% endfor %}
             </div>
             {{lib.related_artifacts(value)}}