# HG changeset patch # User Steve Losh # Date 1276914986 14400 # Node ID 24f0d81f3aa54c88fae3b2b3fd7b3d3458ca2425 # Parent 63bcbedb93416156ff3dc6086f2f2a32df8bd134 web: pull the forms into separate templates The changeset.html was getting pretty hairy until this change. diff -r 63bcbedb9341 -r 24f0d81f3aa5 review/templates/changeset.html --- a/review/templates/changeset.html Fri Jun 18 22:28:46 2010 -0400 +++ b/review/templates/changeset.html Fri Jun 18 22:36:26 2010 -0400 @@ -53,22 +53,7 @@ {% endwith %} {% if not read_only or allow_anon %} -
- Add a comment on this changeset -
-
- - -
-
- - - -
- Post Comment - Cancel -
-
+ {% include "pieces/forms/review-comment.html" %} {% endif %}

Signoffs

@@ -79,30 +64,7 @@ {% if signoffs %}
{% for signoff in signoffs %} - {% if signoff.style == 'markdown' %} - {% set rendered = utils['markdown'](signoff.message) %} - {% endif %} - -
-
- -
- -
{{ signoff.opinion or "meh" }}
- -
-
- {{ utils['templatefilters'].person(signoff.author) }} - signed off as {{ signoff.opinion or "neutral" }} on this changeset, saying: -
- - {% if signoff.style == 'markdown' %} -
{{ rendered|safe }}
- {% else %} -
{{ signoff.message }}
- {% endif %} -
-
+ {% include "pieces/signoff.html" %} {% endfor %}
{% else %} @@ -111,41 +73,7 @@ {% endwith %} {% if not read_only %} -
- - {% if cu_signoff %} - Change your signoff - {% else %} - Sign off on this changeset - {% endif %} - -
-

Sign off as:

- -
- - - -
- -
- - -
- -
- - - -
- {% if cu_signoff %} - Change Signoff - {% else %} - Add Signoff - {% endif %} - Cancel -
-
+ {% include "pieces/forms/signoff.html" %} {% endif %}

Files

@@ -172,26 +100,8 @@ {% endif %} {% if not read_only or allow_anon %} -
- Add a comment on this file - -
-
- - -
- -
- - -
- - Post Comment - Cancel - - -
-
+ {% set index = loop.index %} + {% include "pieces/forms/file-comment.html" %} {% endif %} {% include "pieces/diff.html" %} diff -r 63bcbedb9341 -r 24f0d81f3aa5 review/templates/pieces/forms/file-comment.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/pieces/forms/file-comment.html Fri Jun 18 22:36:26 2010 -0400 @@ -0,0 +1,20 @@ +
+ Add a comment on this file + +
+
+ + +
+ +
+ + +
+ + Post Comment + Cancel + + +
+
diff -r 63bcbedb9341 -r 24f0d81f3aa5 review/templates/pieces/forms/review-comment.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/pieces/forms/review-comment.html Fri Jun 18 22:36:26 2010 -0400 @@ -0,0 +1,16 @@ +
+ Add a comment on this changeset +
+
+ + +
+
+ + + +
+ Post Comment + Cancel +
+
diff -r 63bcbedb9341 -r 24f0d81f3aa5 review/templates/pieces/forms/signoff.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/pieces/forms/signoff.html Fri Jun 18 22:36:26 2010 -0400 @@ -0,0 +1,35 @@ +
+ + {% if cu_signoff %} + Change your signoff + {% else %} + Sign off on this changeset + {% endif %} + +
+

Sign off as:

+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ {% if cu_signoff %} + Change Signoff + {% else %} + Add Signoff + {% endif %} + Cancel +
+
diff -r 63bcbedb9341 -r 24f0d81f3aa5 review/templates/pieces/linecomment.html --- a/review/templates/pieces/linecomment.html Fri Jun 18 22:28:46 2010 -0400 +++ b/review/templates/pieces/linecomment.html Fri Jun 18 22:36:26 2010 -0400 @@ -1,3 +1,7 @@ +{% if comment.style == 'markdown' %} + {% set rendered = utils['markdown'](comment.message) %} +{% endif %} +
@@ -19,7 +23,12 @@ said:
-
{{ comment.message }}
+ + {% if comment.style == 'markdown' %} +
{{ rendered|safe }}
+ {% else %} +
{{ comment.message }}
+ {% endif %}
diff -r 63bcbedb9341 -r 24f0d81f3aa5 review/templates/pieces/signoff.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/templates/pieces/signoff.html Fri Jun 18 22:36:26 2010 -0400 @@ -0,0 +1,24 @@ +{% if signoff.style == 'markdown' %} + {% set rendered = utils['markdown'](signoff.message) %} +{% endif %} + +
+
+ +
+ +
{{ signoff.opinion or "meh" }}
+ +
+
+ {{ utils['templatefilters'].person(signoff.author) }} + signed off as {{ signoff.opinion or "neutral" }} on this changeset, saying: +
+ + {% if signoff.style == 'markdown' %} +
{{ rendered|safe }}
+ {% else %} +
{{ signoff.message }}
+ {% endif %} +
+