# HG changeset patch # User Steve Losh # Date 1276914526 14400 # Node ID 63bcbedb93416156ff3dc6086f2f2a32df8bd134 # Parent 5101c0cba85d83ca4caf198574d0ffe69caecbb5 web: add support for Markdown formatting diff -r 5101c0cba85d -r 63bcbedb9341 review/static/comments.js --- a/review/static/comments.js Fri Jun 18 22:28:31 2010 -0400 +++ b/review/static/comments.js Fri Jun 18 22:28:46 2010 -0400 @@ -10,6 +10,11 @@ name="new-comment-body">\ \ \ +
\ + \ + \ +
\ + \ Post Comment\ Cancel\ \ diff -r 5101c0cba85d -r 63bcbedb9341 review/static/style.css --- a/review/static/style.css Fri Jun 18 22:28:31 2010 -0400 +++ b/review/static/style.css Fri Jun 18 22:28:46 2010 -0400 @@ -1,3 +1,11 @@ +.markdown p:last-child, .markdown ol:last-child, .markdown ul:last-child { + margin-bottom: 0; +} +.plain { + font-family: Monaco, Consolas, "Courier New", monospace; + font-size: 12px; + white-space: pre; +} .group:after { clear: both; content: ' '; @@ -180,6 +188,9 @@ border-radius: 2px; border: 1px solid #444; } +form .field.cuddly { + margin-top: -13px; +} #index .content table { width: 100%; } @@ -477,12 +488,8 @@ float: right; } #changeset .content .item-listing .comment .message, #changeset .content .item-listing .signoff .message { - font-family: Monaco, Consolas, "Courier New", monospace; - font-size: 12px; width: 690px; padding-top: 3px; - white-space: pre; - overflow-x: auto; } #changeset .content .item-listing .comment .avatar img, #changeset .content .item-listing .signoff .avatar img { height: 30px; @@ -641,10 +648,6 @@ -moz-border-radius: 3px; border-radius: 3px; } -#changeset .content .diff table td.comment .message { - white-space: pre; - font-family: Monaco, Consolas, "Courier New", monospace; -} #changeset .content .diff table td.comment .author { padding-bottom: 3px; } diff -r 5101c0cba85d -r 63bcbedb9341 review/static/style.less --- a/review/static/style.less Fri Jun 18 22:28:31 2010 -0400 +++ b/review/static/style.less Fri Jun 18 22:28:46 2010 -0400 @@ -70,6 +70,20 @@ background-color: @bgcolor; } +.markdown { + p, ol, ul { + &:last-child { + margin-bottom: 0; + } + } +} +.plain { + font-family: @font-mono; + font-size: 12px; + white-space: pre; +} + + .group:after { clear:both; content:' '; display:block; font-size:0; line-height:0; visibility:hidden; width:0; height:0; } @@ -220,6 +234,9 @@ .border-radius(2px); border: 1px solid #444; } + &.cuddly { + margin-top: -13px; + } } } @@ -421,12 +438,8 @@ float: right; } .message { - font-family: @font-mono; - font-size: 12px; width: 690px; padding-top: 3px; - white-space: pre; - overflow-x: auto; } .avatar img { height: 30px; @@ -601,10 +614,6 @@ .border-radius(3px); } } - .message { - white-space: pre; - font-family: @font-mono; - } .author { padding-bottom: 3px; } diff -r 5101c0cba85d -r 63bcbedb9341 review/templates/changeset.html --- a/review/templates/changeset.html Fri Jun 18 22:28:31 2010 -0400 +++ b/review/templates/changeset.html Fri Jun 18 22:28:46 2010 -0400 @@ -60,6 +60,11 @@ +
+ + + +
Post Comment Cancel @@ -74,6 +79,10 @@ {% if signoffs %}
{% for signoff in signoffs %} + {% if signoff.style == 'markdown' %} + {% set rendered = utils['markdown'](signoff.message) %} + {% endif %} +
@@ -86,7 +95,12 @@ {{ utils['templatefilters'].person(signoff.author) }} signed off as {{ signoff.opinion or "neutral" }} on this changeset, saying:
-
{{ signoff.message }}
+ + {% if signoff.style == 'markdown' %} +
{{ rendered|safe }}
+ {% else %} +
{{ signoff.message }}
+ {% endif %}
{% endfor %} @@ -107,15 +121,23 @@

Sign off as:

+
+
+ +
+ + + +
{% if cu_signoff %} Change Signoff {% else %} @@ -159,6 +181,11 @@ +
+ + +
+ Post Comment Cancel diff -r 5101c0cba85d -r 63bcbedb9341 review/templates/pieces/comment.html --- a/review/templates/pieces/comment.html Fri Jun 18 22:28:31 2010 -0400 +++ b/review/templates/pieces/comment.html Fri Jun 18 22:28:46 2010 -0400 @@ -1,3 +1,7 @@ +{% if comment.style == 'markdown' %} + {% set rendered = utils['markdown'](comment.message) %} +{% endif %} +