Add (working) review-level and file-level comment forms.
author |
Steve Losh <steve@stevelosh.com> |
date |
Wed, 21 Oct 2009 18:37:21 -0400 |
parents |
892dd344113c
|
children |
43047ad3e2fa
|
branches/tags |
webui |
files |
review/web_templates/base.html review/web_templates/review.html review/web_ui.py |
Changes
--- a/review/web_templates/base.html Wed Oct 21 18:12:45 2009 -0400
+++ b/review/web_templates/base.html Wed Oct 21 18:37:21 2009 -0400
@@ -7,6 +7,8 @@
<title>${ basename(rd.target.root) } / hg-review</title>
<link rel="stylesheet" href="/media/aal.css" type="text/css" media="screen" />
<link rel="stylesheet" href="/media/style.css" type="text/css" media="screen" />
+
+ <script type="text/javascript" src="/media/jquery-1.3.2.min.js"></script>
</head>
<body>
--- a/review/web_templates/review.html Wed Oct 21 18:12:45 2009 -0400
+++ b/review/web_templates/review.html Wed Oct 21 18:37:21 2009 -0400
@@ -13,6 +13,18 @@
</div>
</div>
+<div id="comment-review">
+ <form id="comment-review-form" method="post" action="">
+ <div class="field">
+ <label for="body">Add a comment on this changeset:</label>
+ <textarea cols="60" rows="6" name="body"></textarea>
+ </div>
+ <div class="buttons">
+ <input type="submit" class="button" value="Submit" />
+ </div>
+ </form>
+</div>
+
$for filename, diff in rcset.diffs().iteritems():
<h3>${ filename }</h3>
@@ -26,6 +38,19 @@
</div>
</div>
+ <div id="comment-review">
+ <form id="comment-file-form" method="post" action="">
+ <div class="field">
+ <label for="body">Add a comment on this file:</label>
+ <textarea cols="60" rows="6" name="body"></textarea>
+ </div>
+ <div class="buttons">
+ <input type="submit" class="button" value="Submit" />
+ </div>
+ <input type="hidden" name="filename" value="${ filename }" />
+ </form>
+ </div>
+
<div class="diff">
<table>
$ max_line = diff['max']
--- a/review/web_ui.py Wed Oct 21 18:12:45 2009 -0400
+++ b/review/web_ui.py Wed Oct 21 18:37:21 2009 -0400
@@ -58,6 +58,17 @@
def GET(self, node_short):
return render.review(_rd, _rd[node_short])
+ def POST(self, node_short):
+ i = web.input()
+ body = i['body']
+ filename = i['filename'] if 'filename' in i else ''
+
+ if body:
+ rcset = _rd[node_short]
+ rcset.add_comment(body, filename)
+
+ raise web.seeother('/review/%s/' % node_short)
+
class media:
def GET(self, fname):