# HG changeset patch # User Steve Losh # Date 1276556806 14400 # Node ID c92ca10967c3b7d0158bdd553d9f9f2c8f48296e # Parent 1a2f5b8da6efe9b6c20b349691c0397cc7100fd7 web: refactor the templates a bit diff -r 1a2f5b8da6ef -r c92ca10967c3 review/static/style.css --- a/review/static/style.css Mon Jun 14 18:53:02 2010 -0400 +++ b/review/static/style.css Mon Jun 14 19:06:46 2010 -0400 @@ -120,7 +120,7 @@ body .content .navigation { line-height: 1; width: 780px; - margin: 10px auto; + margin: 15px auto; } body .content .wrap { border: 1px solid #d8d685; diff -r 1a2f5b8da6ef -r c92ca10967c3 review/static/style.less --- a/review/static/style.less Mon Jun 14 18:53:02 2010 -0400 +++ b/review/static/style.less Mon Jun 14 19:06:46 2010 -0400 @@ -153,7 +153,7 @@ .navigation { line-height: 1; width: @content-width - 20px; - margin: 10px auto; + margin: 15px auto; } .wrap { border: 1px solid darken(@c-cream, 20%); diff -r 1a2f5b8da6ef -r c92ca10967c3 review/templates/base.html --- a/review/templates/base.html Mon Jun 14 18:53:02 2010 -0400 +++ b/review/templates/base.html Mon Jun 14 19:06:46 2010 -0400 @@ -1,8 +1,6 @@ -{% import 'macros.html' as macros %} - {% block title %}{% endblock %}Reviewing {{ title }} with hg-review diff -r 1a2f5b8da6ef -r c92ca10967c3 review/templates/changeset.html --- a/review/templates/changeset.html Mon Jun 14 18:53:02 2010 -0400 +++ b/review/templates/changeset.html Mon Jun 14 19:06:46 2010 -0400 @@ -44,16 +44,7 @@ {% if comments %}
{% for comment in comments %} -
- {{ macros.gravatar(comment, utils) }} -
- -
{{ comment.message }}
-
-
+ {% include "pieces/comment.html" %} {% endfor %}
{% else %} @@ -84,7 +75,10 @@
{% for signoff in signoffs %}
- {{ macros.gravatar(signoff, utils) }} +
+ +
+
{{ signoff.opinion or "meh" }}
@@ -147,17 +141,7 @@ {% if comments %}
{% for comment in comments %} -
- {{ macros.gravatar(comment, utils) }} -
- -
{{ comment.message }}
-
-
+ {% include "pieces/comment.html" %} {% endfor %}
{% endif %} @@ -180,7 +164,7 @@
{% endif %} - {% include "diff.html" %} + {% include "pieces/diff.html" %}
{% endfor %} diff -r 1a2f5b8da6ef -r c92ca10967c3 review/templates/diff.html --- a/review/templates/diff.html Mon Jun 14 18:53:02 2010 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -{% import 'macros.html' as macros %} - -
- - - - {% set annotated_diff = rcset.annotated_diff(filename) %} - {# We need to ignore the first item from this generator, because - we don't care about providing a line-number prefix (for now!). #} - {% set ignore_this_variable = annotated_diff.next() %} - - {% for line in annotated_diff %} - {% if line['skipped'] %} - - - - - {% for comment in line['comments'] %} - - {% endfor %} - {% else %} - {% with %} - {% set line_type = utils['line_type'](line['content']) %} - - - - - - - {% endwith %} - - {% with %} - {% set comments = line['comments'] %} - - {% for comment in comments %} - - - - {% endfor %} - {% endwith %} - {% endif %} - {% else %} - - - - {% endfor %} - -
- … skipped {{ line['skipped'] }} lines … -
- {{ macros.gravatar(comment, utils) }} -
- -
{{ comment.message|escape }}
-
-
{{ line['number'] }}{% if line_type == 'add' %}+{% elif line_type == 'rem' %}-{% endif %}{{ utils['decode'](line['content'][1:])|escape }}
- {{ ','.join(utils['map'](utils['str'], comment.lines)) }} - {{ macros.gravatar(comment, utils) }} -
- -
{{ comment.message }}
-
-
- … no lines to show … -
- -
diff -r 1a2f5b8da6ef -r c92ca10967c3 review/templates/macros.html --- a/review/templates/macros.html Mon Jun 14 18:53:02 2010 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -{% macro gravatar(item, utils, size=30) -%} -
- -
-{%- endmacro %} diff -r 1a2f5b8da6ef -r c92ca10967c3 review/templates/pieces/comment.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/pieces/comment.html Mon Jun 14 19:06:46 2010 -0400 @@ -0,0 +1,12 @@ +
+
+ +
+
+ +
{{ comment.message }}
+
+
diff -r 1a2f5b8da6ef -r c92ca10967c3 review/templates/pieces/diff.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/pieces/diff.html Mon Jun 14 19:06:46 2010 -0400 @@ -0,0 +1,81 @@ +
+ + + + {% set annotated_diff = rcset.annotated_diff(filename) %} + {# We need to ignore the first item from this generator, because + we don't care about providing a line-number prefix (for now!). #} + {% set ignore_this_variable = annotated_diff.next() %} + + {% for line in annotated_diff %} + {% if line['skipped'] %} + + + + + {% for comment in line['comments'] %} + + {% endfor %} + {% else %} + {% with %} + {% set line_type = utils['line_type'](line['content']) %} + + + + + + + {% endwith %} + + {% with %} + {% set comments = line['comments'] %} + + {% for comment in comments %} + + + + {% endfor %} + {% endwith %} + {% endif %} + {% else %} + + + + {% endfor %} + +
+ … skipped {{ line['skipped'] }} lines … +
+
+ +
+ +
+ +
{{ comment.message|escape }}
+
+
{{ line['number'] }}{% if line_type == 'add' %}+{% elif line_type == 'rem' %}-{% endif %}{{ utils['decode'](line['content'][1:])|escape }}
+ {{ ','.join(utils['map'](utils['str'], comment.lines)) }} +
+ +
+ +
+ +
{{ comment.message }}
+
+
+ … no lines to show … +
+ +