allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [03/10] allura git commit: [#8253] Adding reaction support for UI
Date Thu, 08 Nov 2018 21:53:44 GMT
[#8253] Adding reaction support for UI


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/71818772
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/71818772
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/71818772

Branch: refs/heads/master
Commit: 71818772d3443dffbab3fc6aaf7b523554e84d31
Parents: 919f146
Author: Shalitha <shalithasuranga@gmail.com>
Authored: Tue Oct 30 22:06:07 2018 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Nov 8 21:53:25 2018 +0000

----------------------------------------------------------------------
 Allura/allura/nf/allura/css/site_style.css      |  6 +++++
 .../allura/templates/widgets/post_widget.html   | 24 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/71818772/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 8d5315e..af187a9 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3810,6 +3810,12 @@ fieldset.preferences legend {
     width: 100%;
 }
 
+.post-reactions-list img.emoji { 
+    width: 16px;
+    margin-left: 4px;
+    cursor: pointer;
+}
+
 .meta_post .bubble .header{
     background-color: #ffffff;
     font-size: 0.7em;

http://git-wip-us.apache.org/repos/asf/allura/blob/71818772/Allura/allura/templates/widgets/post_widget.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/post_widget.html b/Allura/allura/templates/widgets/post_widget.html
index 81be2e0..496d973 100644
--- a/Allura/allura/templates/widgets/post_widget.html
+++ b/Allura/allura/templates/widgets/post_widget.html
@@ -55,6 +55,10 @@
             {{lib.user_link(value.author())}} - <i style="color: #777">{{lib.abbr_date(value.timestamp)}}</i>
 
             <div class="tools">
+            {% if not c.user.is_anonymous() %}
+                <a href="#" id="react_{{value.slug.replace('/','_')}}" data-commentlink="{{value.url()}}"
class="reaction-button icon btn ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"{%if
value.status == 'pending'%} style="display:none"{%endif%}>
+                    <span><i class="fa fa-smile-o" aria-hidden="true"></i></span></a>
+            {% endif %}
             {% if (h.has_access(value.thread, 'post')() and value.status == 'ok') or moderator
%}
                 <a class="icon reply_post btn" href="#" style="" title="Reply" role="button"><span
class="ui-button-text"><i class="fa fa-reply"></i></span></a>
             {% endif %}
@@ -79,6 +83,26 @@
             {% 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'>
+              {% if value.react_thumbs_up > 0 %}
+              <span>{{ '\U0001F44D' }}</span> {{ value.react_thumbs_up }}
+              {% endif %}
+              {% if value.react_thumbs_down > 0 %}
+              <span>{{ '\U0001F44E' }}</span> {{ value.react_thumbs_down }}
+              {% endif %}
+              {% if value.react_laugh > 0 %}
+              <span>{{ '\U0001F604' }}</span> {{ value.react_laugh }}
+              {% endif %}
+              {% if value.react_hooray > 0 %}
+              <span>{{ '\U0001F389' }}</span> {{ value.react_hooray }}
+              {% endif %}
+              {% if value.react_confused > 0 %}
+              <span>{{ '\U0001F615' }}</span> {{ value.react_confused }}
+              {% endif %}
+              {% if value.react_heart > 0 %}
+              <span>{{ '\U00002764' }}</span> {{ value.react_heart }}
+              {% endif %}
+            </div>
             {{lib.related_artifacts(value)}}
             {% if value.edit_count %}
                 <br><small>Last edit: {{value.last_edit_by().display_name}} {{h.ago(value.last_edit_date)}}</small>


Mime
View raw message