444f6ef08d88

web: you guessed it
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 13 Jun 2010 02:31:31 -0400
parents 7521b06e6b18
children 0d78b56ae9aa
branches/tags (none)
files review/static/style.css review/static/style.less review/templates/diff.html

Changes

--- a/review/static/style.css	Sun Jun 13 02:11:28 2010 -0400
+++ b/review/static/style.css	Sun Jun 13 02:31:31 2010 -0400
@@ -450,20 +450,31 @@
   border: 1px solid #ddd;
   background-color: #f9f9f9;
 }
-#changeset .content .diff table tr.viewing {
-  background-color: #f2f2d7;
-}
 #changeset .content .diff table td.code:after {
   color: #ccc;
   content: "↩";
   vertical-align: -1px;
   line-height: 1;
 }
+#changeset .content .diff table tr.rem {
+  color: #800;
+}
+#changeset .content .diff table tr.add {
+  color: #040;
+}
+#changeset .content .diff table tr.viewing {
+  background-color: #f2f2d7;
+}
 #changeset .content .diff table td {
   border: none;
   line-height: 1;
   padding: 3px 5px;
 }
+#changeset .content .diff table td.addrem-add, #changeset .content .diff table td.addrem-rem {
+  font-weight: bold;
+  text-align: center;
+  width: 10px;
+}
 #changeset .content .diff table td.linenumber {
   width: 25px;
   text-align: right;
@@ -479,7 +490,7 @@
 }
 #changeset .content .diff table td.comment {
   line-height: 15px;
-  padding: 10px 10px 10px 36px;
+  padding: 10px 10px 10px 56px;
   border-bottom: 1px solid #eee;
   border-top: 1px solid #eee;
   background-color: #f4f4f4;
--- a/review/static/style.less	Sun Jun 13 02:11:28 2010 -0400
+++ b/review/static/style.less	Sun Jun 13 02:31:31 2010 -0400
@@ -402,20 +402,34 @@
             border: 1px solid #ddd;
             background-color: #f9f9f9;
 
-            tr.viewing {
-                background-color: lighten(@c-cream, 5%);
-            }
             td.code:after {
                 color: #ccc;
                 content: "↩";
                 vertical-align: -1px;
                 line-height: 1;
             }
+            tr {
+                &.rem {
+                    color: #800;
+                }
+                &.add {
+                    color: #040;
+                }
+                &.viewing {
+                    background-color: lighten(@c-cream, 5%);
+                }
+            }
+
             td {
                 border: none;
                 line-height: 1;
                 padding: 3px 5px;
 
+                &.addrem-add, &.addrem-rem {
+                    font-weight: bold;
+                    text-align: center;
+                    width: 10px;
+                }
                 &.linenumber {
                     width: 25px;
                     text-align: right;
@@ -431,7 +445,7 @@
                 }
                 &.comment {
                     line-height: 15px;
-                    padding: 10px 10px 10px 36px;
+                    padding: 10px 10px 10px 56px;
                     border-bottom: 1px solid #eee;
                     border-top: 1px solid #eee;
                     background-color: #f4f4f4;
--- a/review/templates/diff.html	Sun Jun 13 02:11:28 2010 -0400
+++ b/review/templates/diff.html	Sun Jun 13 02:31:31 2010 -0400
@@ -10,7 +10,7 @@
         {% for line in annotated_diff %}
             {% if line['skipped'] %}
                 <tr class="skipped">
-                    <td colspan="2" class="skip">
+                    <td colspan="3" class="skip">
                         &hellip; skipped {{ line['skipped'] }} lines &hellip;
                     </td>
                 </tr>
@@ -30,17 +30,22 @@
                     </td></tr>
                 {% endfor %}
             {% else %}
-            <tr class="{{ utils['line_type'](line['content']) }}{% if not read_only %} commentable {% endif %} line-{{ line['number'] }}">
-                    <td class="linenumber">{{ line['number'] }}</td>
-                    <td class="code"><code>{{ line['content'][1:]|escape }}</code></td>
-                </tr>
+                {% with %}
+                    {% set line_type = utils['line_type'](line['content']) %}
+
+                    <tr class="{{ line_type }} {% if not read_only %} commentable {% endif %} line-{{ line['number'] }}">
+                        <td class="linenumber">{{ line['number'] }}</td>
+                        <td class="addrem-{{ line_type }}">{% if line_type == 'add' %}+{% elif line_type == 'rem' %}-{% endif %}</td>
+                        <td class="code"><code>{{ line['content'][1:]|escape }}</code></td>
+                    </tr>
+                {% endwith %}
 
                 {% with %}
                     {% set comments = line['comments'] %}
 
                     {% for comment in comments %}
                         <tr class="comment">
-                            <td class="comment group" colspan="2">
+                            <td class="comment group" colspan="3">
                                 <span class="commentlines disabled">{{ ','.join(utils['map'](utils['str'], comment.lines)) }}</span>
                                 {{ macros.gravatar(comment, utils) }}
                                 <div>