1cc8e18b1b43 webui

Add skipped line counts to diffs.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 21 Oct 2009 19:57:17 -0400
parents 5c274209a7ec
children 001f5ecfd9bc e2ddb8631463
branches/tags webui
files review/web_media/style.css review/web_templates/review.html

Changes

--- a/review/web_media/style.css	Wed Oct 21 19:31:46 2009 -0400
+++ b/review/web_media/style.css	Wed Oct 21 19:57:17 2009 -0400
@@ -99,6 +99,9 @@
 table tr.rem {
     background: #FBDBDA;
 }
+table tr.skipped {
+    background: #ccc;
+}
 div.diff .comment {
     margin-bottom: 0em;
 }
\ No newline at end of file
--- a/review/web_templates/review.html	Wed Oct 21 19:31:46 2009 -0400
+++ b/review/web_templates/review.html	Wed Oct 21 19:57:17 2009 -0400
@@ -60,7 +60,15 @@
             $ max_line = diff['max']
             $ content = diff['content']
             $ line_level_comments = filter(lambda c: c.filename == filename and c.lines, rcset.comments)
+            $ previous_n = -1
             $for n, line in content:
+                $if n - 1 > previous_n:
+                    $ skipped_count = n - previous_n
+                    $if previous_n == -1:
+                        $ skipped_count -= 1
+                    <tr class="skipped">
+                        <td><code>&hellip; skipped ${ skipped_count } lines &hellip;</code></td>
+                    </tr>
                 $ kind = 'rem' if line[0] == '-' else 'add' if line[0] == '+' else ''
                 <tr class="${ kind }">
                     <td class="diff-line"><code>${ line[1:] or ' ' }</code></td>
@@ -74,5 +82,11 @@
                             <div class="message">${ comment.message }</div>
                         </div>
                     </td></tr>
+                $ previous_n = n
+            $if previous_n < diff['max']:
+                $ skipped_count = diff['max'] - previous_n
+                <tr class="skipped">
+                    <td><code>&hellip; skipped ${ skipped_count } lines &hellip;</code></td>
+                </tr>
         </table>
     </div>
\ No newline at end of file