# HG changeset patch # User Steve Losh # Date 1256252888 14400 # Node ID 2e65351af70289fd5a93433cf4cedb8536db0785 # Parent e2ddb8631463a22b51b2cefcf6c415743a95ef35 Rough cut of line-level comments. diff -r e2ddb8631463 -r 2e65351af702 review/web_media/comments.js --- a/review/web_media/comments.js Thu Oct 22 18:27:11 2009 -0400 +++ b/review/web_media/comments.js Thu Oct 22 19:08:08 2009 -0400 @@ -1,11 +1,18 @@ $(function() { - $("form").hide(); + $("div > form").hide(); + $("tr:has(form)").hide(); $("p.comment-activate a").click(function(event) { $(event.target).hide(); $(event.target).closest("div").children("form").fadeIn("fast"); return false; }); + + $("tr.rem, tr.add, tr.con").click(function(event) { + $(event.target).closest("tr").addClass("comment-line-selected"); + $(event.target).closest("tr").next("tr.comment-line").fadeIn("fast"); + return false; + }); }); \ No newline at end of file diff -r e2ddb8631463 -r 2e65351af702 review/web_media/style.css --- a/review/web_media/style.css Thu Oct 22 18:27:11 2009 -0400 +++ b/review/web_media/style.css Thu Oct 22 19:08:08 2009 -0400 @@ -47,6 +47,9 @@ table tr td.last { text-align: right; } +table tr form * { + margin: 0em; +} /* Review pages. */ div.filename-header { @@ -85,6 +88,9 @@ } div#comment-file form { } +tr.comment-line-selected { + background-color: #FBEAD0; +} /* Diffs. */ div.diff { @@ -93,6 +99,9 @@ div.diff table tr { white-space: pre; } +div.diff table tr.comment-line { + white-space: normal; +} table tr.add { background: #DBF3D1; } diff -r e2ddb8631463 -r 2e65351af702 review/web_templates/review.html --- a/review/web_templates/review.html Thu Oct 22 18:27:11 2009 -0400 +++ b/review/web_templates/review.html Thu Oct 22 19:08:08 2009 -0400 @@ -69,7 +69,7 @@ … skipped ${ skipped_count } lines … - $ kind = 'rem' if line[0] == '-' else 'add' if line[0] == '+' else '' + $ kind = 'rem' if line[0] == '-' else 'add' if line[0] == '+' else 'con' ${ line[1:] or ' ' } @@ -82,9 +82,24 @@
${ comment.message }
+ + +
+
+ + +
+
+ +
+ + +
+ + $ previous_n = n - $if previous_n < diff['max']: - $ skipped_count = diff['max'] - previous_n + $if previous_n < max_line: + $ skipped_count = max_line - previous_n … skipped ${ skipped_count } lines … diff -r e2ddb8631463 -r 2e65351af702 review/web_ui.py --- a/review/web_ui.py Thu Oct 22 18:27:11 2009 -0400 +++ b/review/web_ui.py Thu Oct 22 19:08:08 2009 -0400 @@ -62,10 +62,12 @@ i = web.input() body = i['body'] filename = i['filename'] if 'filename' in i else '' + lines = i['lines'].split(',') if 'lines' in i else '' + print filename, lines if body: rcset = _rd[node_short] - rcset.add_comment(body, filename) + rcset.add_comment(body, filename, lines) raise web.seeother('/review/%s/' % node_short)