c48a619ef5db webui

Add file-level comments.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 15 Oct 2009 17:53:37 -0400
parents 0a9effb274b0
children 02210fd5a4fb
branches/tags webui
files review/web_templates/review.html

Changes

--- a/review/web_templates/review.html	Wed Oct 14 20:30:36 2009 -0400
+++ b/review/web_templates/review.html	Thu Oct 15 17:53:37 2009 -0400
@@ -15,11 +15,22 @@
 
 $for filename, diff in rcset.diffs().iteritems():
     <h3>${ filename }</h3>
+    
+    $ file_level_comments = filter(lambda c: c.filename == filename and not c.lines, rcset.comments)
+    $for comment in file_level_comments:
+        <div class="comment">
+            <div class="avatar"><img height="52" width="52" src="http://www.gravatar.com/avatar/${ md5(email(comment.author)).hexdigest() }?s=52"/></div>
+            <div>
+                <div class="author"><a href="mailto:${ email(comment.author) }">${ templatefilters.person(comment.author) }</a> said:</div>
+                <div class="message">${ comment.message }</div>
+            </div>
+        </div>
+    
     <div class="diff">
         <table>
             $ max_line = diff['max']
             $ content = diff['content']
-            $ line_level_comments = filter(lambda c: c.filename == filename, rcset.comments)
+            $ line_level_comments = filter(lambda c: c.filename == filename and c.lines, rcset.comments)
             $for n, line in content:
                 $ kind = 'rem' if line[0] == '-' else 'add' if line[0] == '+' else ''
                 <tr class="${ kind }">