0dc141617716

Display obsolete comments/signoff with lower opacity.

Add a obsolete class on comments and signoff messages, which
sets the opacity to 0.6
[view raw] [browse files]
author Christophe de Vienne <cdevienne@gmail.com>
date Tue, 28 Oct 2014 00:28:05 +0100
parents 9ee9ef21460c
children f305fba940c0
branches/tags (none)
files review/static/styles/style.less review/templates/pieces/comment.html review/templates/pieces/linecomment.html review/templates/pieces/signoff.html

Changes

--- a/review/static/styles/style.less	Mon Oct 27 22:40:30 2014 +0100
+++ b/review/static/styles/style.less	Tue Oct 28 00:28:05 2014 +0100
@@ -451,6 +451,10 @@
             border-bottom: 1px solid #ddd;
             position: relative;
             min-height: 41px;
+            
+            &.obsolete {
+                opacity: 0.6;
+            }
 
             &:first-child {
                 border-top: none;
@@ -630,6 +634,10 @@
                     border-top: 1px solid #ddd;
                     background-color: #f4f4f4;
 
+                    &.obsolete {
+                        opacity: 0.6;
+                    }
+
                     .avatar {
                         float: right;
                         margin-top: 2px;
--- a/review/templates/pieces/comment.html	Mon Oct 27 22:40:30 2014 +0100
+++ b/review/templates/pieces/comment.html	Tue Oct 28 00:28:05 2014 +0100
@@ -1,8 +1,12 @@
 {% if comment.style == 'markdown' %}
     {% set rendered = utils['markdown'](comment.message) %}
 {% endif %}
+{% if comment.node != rev.hex() %}
+    {% set obsolete = True %}
+    {% set obsclass = ' obsolete' %}
+{% endif %}
 
-<div class="comment group" id="comment-{{ comment.identifier }}">
+<div class="comment group{{ obsclass }}" id="comment-{{ comment.identifier }}">
     <a href="#comment-{{ comment.identifier }}" rel="comments" class="expand" id="comment-expand-{{ comment.identifier }}">&rarr;</a>
     <script type="text/javascript">
         $(function() {
@@ -38,6 +42,9 @@
             <div class="context">
                 {% if comment.ufilename %}
                     <div class="context-head">on {{ comment.ufilename }}</div>
+                {% elif obsolete %}
+                    <div class="context-head">on changeset obsolete
+                        {{ utils['node_short'](comment.node.decode('hex')) }}</div>
                 {% else %}
                     <div class="context-head">on changeset {{ rev.rev() }}:{{ utils['node_short'](rev.node()) }}</div>
                 {% endif %}
--- a/review/templates/pieces/linecomment.html	Mon Oct 27 22:40:30 2014 +0100
+++ b/review/templates/pieces/linecomment.html	Tue Oct 28 00:28:05 2014 +0100
@@ -1,9 +1,13 @@
 {% if comment.style == 'markdown' %}
     {% set rendered = utils['markdown'](comment.message) %}
 {% endif %}
+{% if comment.node != rev.hex() %}
+    {% set obsolete = True %}
+    {% set obsclass = ' obsolete' %}
+{% endif %}
 
 <tr class="comment">
-    <td class="comment group" colspan="3" id="comment-{{ comment.identifier }}">
+    <td class="comment group {{ obsclass }}" colspan="3" id="comment-{{ comment.identifier }}">
         <div class="comment-content">
             <span class="identifier disabled">{{ comment.identifier }}</span>
             <span class="commentlines disabled">{{ ','.join(utils['map'](utils['str'], comment.lines)) }}</span>
--- a/review/templates/pieces/signoff.html	Mon Oct 27 22:40:30 2014 +0100
+++ b/review/templates/pieces/signoff.html	Tue Oct 28 00:28:05 2014 +0100
@@ -2,7 +2,12 @@
     {% set rendered = utils['markdown'](signoff.message) %}
 {% endif %}
 
-<div class="signoff group {{ signoff.opinion or 'neutral' }}">
+{% if signoff.node != rev.hex() %}
+    {% set obsolete = True %}
+    {% set obsclass = ' obsolete' %}
+{% endif %}
+
+<div class="signoff group {{ signoff.opinion or 'neutral' }}{{ obsclass }}">
     <div class="avatar">
         <img src="{{ utils['item_gravatar'](signoff, 30) }}" />
     </div>