# HG changeset patch # User Steve Losh # Date 1276558117 14400 # Node ID a88dd00c407960a12bcb52409b5eb24d0bd9a814 # Parent c92ca10967c3b7d0158bdd553d9f9f2c8f48296e web: add diff line backgrounds and show file comment counts diff -r c92ca10967c3 -r a88dd00c4079 review/static/comments.js --- a/review/static/comments.js Mon Jun 14 19:06:46 2010 -0400 +++ b/review/static/comments.js Mon Jun 14 19:28:37 2010 -0400 @@ -18,7 +18,7 @@ \ \ '; - comment_form = comment_form.replace('<<>>', line.closest(".file").find(".filename h3 a").html()); + comment_form = comment_form.replace('<<>>', line.closest(".file").find(".filename h3 a .name").html()); comment_form = comment_form.replace('<<>>', currNum); return comment_form; } diff -r c92ca10967c3 -r a88dd00c4079 review/static/style.css --- a/review/static/style.css Mon Jun 14 19:06:46 2010 -0400 +++ b/review/static/style.css Mon Jun 14 19:28:37 2010 -0400 @@ -557,10 +557,24 @@ line-height: 1; } #changeset .content .diff table tr.rem { - color: #800; + color: black; + background-color: #f7cdcd; +} +#changeset .content .diff table tr.rem td.code:after { + color: white; +} +#changeset .content .diff table tr.rem td.linenumber { + color: #292620; } #changeset .content .diff table tr.add { - color: #040; + color: black; + background-color: #c5e5ce; +} +#changeset .content .diff table tr.add td.code:after { + color: white; +} +#changeset .content .diff table tr.add td.linenumber { + color: #292620; } #changeset .content .diff table tr.viewing { background-color: #f2f2d7; diff -r c92ca10967c3 -r a88dd00c4079 review/static/style.less --- a/review/static/style.less Mon Jun 14 19:06:46 2010 -0400 +++ b/review/static/style.less Mon Jun 14 19:28:37 2010 -0400 @@ -13,6 +13,9 @@ @c-metal: #eaeaea; @c-soft-cream: lighten(@c-cream, 12%); +@c-diff-add: #c5e5ce; +@c-diff-rem: #f7cdcd; + @content-width: 800px; @content-background: rgb(250, 250, 250); @@ -500,10 +503,26 @@ } tr { &.rem { - color: #800; + color: black; + background-color: @c-diff-rem; + + td.code:after { + color: white; + } + td.linenumber { + color: @c-dark; + } } &.add { - color: #040; + color: black; + background-color: @c-diff-add; + + td.code:after { + color: white; + } + td.linenumber { + color: @c-dark; + } } &.viewing { background-color: lighten(@c-cream, 5%); diff -r c92ca10967c3 -r a88dd00c4079 review/templates/changeset.html --- a/review/templates/changeset.html Mon Jun 14 19:06:46 2010 -0400 +++ b/review/templates/changeset.html Mon Jun 14 19:28:37 2010 -0400 @@ -25,14 +25,14 @@ {% block content %}
 
- +

{{ rev.rev() }}: {{ rev.description().splitlines()[0] }} by {{ utils['templatefilters'].person(rev.user()) }}

- + {% if utils['len'](rev.description().splitlines()) > 1 %}
{{ "\n".join(rev.description().splitlines()[1:]).strip() }}
{% endif %} @@ -80,7 +80,7 @@
{{ signoff.opinion or "meh" }}
- +
{{ utils['templatefilters'].person(signoff.author) }} @@ -129,23 +129,26 @@

Files

{% for filename in rcset.files() %} + {% set comments = rcset.file_level_comments(filename) %} + {% set commentcount = utils['len'](comments) + utils['len'](rcset.line_level_comments(filename)) %} +
- {% with %} - {% set comments = rcset.file_level_comments(filename) %} + {% if comments %} +
+ {% for comment in comments %} + {% include "pieces/comment.html" %} + {% endfor %} +
+ {% endif %} - {% if comments %} -
- {% for comment in comments %} - {% include "pieces/comment.html" %} - {% endfor %} -
- {% endif %} - {% endwith %} {% if not read_only or allow_anon %}