Merge ~pappacena/launchpad:comment-editing-ui-bugcomment into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: ecc8c28c320bb56428a4bd042b40d56d5c9d769a
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:comment-editing-ui-bugcomment
Merge into: launchpad:master
Prerequisite: ~pappacena/launchpad:comment-editing-ui
Diff against target: 470 lines (+145/-55)
14 files modified
lib/lp/bugs/browser/bugcomment.py (+9/-0)
lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt (+14/-4)
lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-add-comment-distribution-no-current-release.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-bug-activity.txt (+4/-0)
lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt (+35/-12)
lib/lp/bugs/stories/bugs/xx-bug-create-question.txt (+1/-1)
lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt (+4/-4)
lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt (+28/-16)
lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt (+3/-2)
lib/lp/bugs/templates/bugcomment-box.pt (+22/-4)
lib/lp/bugs/templates/bugtask-index.pt (+3/-1)
lib/lp/services/comments/templates/comment-body.pt (+18/-7)
lib/lp/services/messages/javascript/tests/test_messages.edit.html (+2/-2)
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+402604@code.launchpad.net

Commit message

Adding editing option to bug comments

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

Pushed the requested change. This should be good to go.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/bugs/browser/bugcomment.py b/lib/lp/bugs/browser/bugcomment.py
2index 6cc89f2..45a992d 100644
3--- a/lib/lp/bugs/browser/bugcomment.py
4+++ b/lib/lp/bugs/browser/bugcomment.py
5@@ -52,6 +52,7 @@ from lp.services.webapp import (
6 Navigation,
7 stepthrough,
8 )
9+from lp.services.webapp.authorization import check_permission
10 from lp.services.webapp.breadcrumb import Breadcrumb
11 from lp.services.webapp.interfaces import ILaunchBag
12
13@@ -353,12 +354,20 @@ class BugCommentBoxView(LaunchpadView, BugCommentBoxViewMixin):
14
15 expand_reply_box = False
16
17+ @property
18+ def can_edit(self):
19+ return check_permission('launchpad.Edit', self.context)
20+
21
22 class BugCommentBoxExpandedReplyView(LaunchpadView, BugCommentBoxViewMixin):
23 """Render a comment box with reply field expanded."""
24
25 expand_reply_box = True
26
27+ @property
28+ def can_edit(self):
29+ return False
30+
31
32 @adapter(IBugComment, IWebServiceClientRequest)
33 @implementer(Interface)
34diff --git a/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt b/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
35index f705c8a..b9f7292 100644
36--- a/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
37+++ b/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
38@@ -24,11 +24,17 @@ The attachment is now visible on the bug page.
39 There will also be a comment with a link to the attachment in its body.
40
41 >>> print_comments(user_browser.contents)
42- <p>This would be a real killer feature...</p>
43+ <div class="comment-text editable-message-text"
44+ itemprop="commentText"><p>This would be a real killer
45+ feature...</p></div>
46 ----------------------------------------
47- <p>Oddly enough the bug system seems only capable...</p>
48+ <div class="comment-text editable-message-text"
49+ itemprop="commentText"><p>Oddly enough the bug system seems
50+ only capable...</p></div>
51 ----------------------------------------
52 Attachment: Great deal
53+ <div class="comment-text editable-message-text"
54+ itemprop="commentText"></div>
55 <BLANKLINE>
56 ----------------------------------------
57
58@@ -80,9 +86,13 @@ Since the attachment has been deleted, the comment referencing it will no
59 longer be visible.
60
61 >>> print_comments(user_browser.contents)
62- <p>This would be a real killer feature...</p>
63+ <div class="comment-text editable-message-text"
64+ itemprop="commentText"><p>This would be a real
65+ killer feature...</p></div>
66 ----------------------------------------
67- <p>Oddly enough the bug system seems only capable...</p>
68+ <div class="comment-text editable-message-text"
69+ itemprop="commentText"><p>Oddly enough the bug system
70+ seems only capable...</p></div>
71 ----------------------------------------
72
73 XXX Abel Deuring, 2009-11-25: We should check here that attempts to
74diff --git a/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt
75index cb230ec..d2e6dcb 100644
76--- a/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt
77+++ b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt
78@@ -21,4 +21,4 @@ The user was returned to the bug page, and the comment was added.
79 >>> main_content = find_main_content(user_browser.contents)
80 >>> last_comment = main_content('div', 'boardCommentBody')[-1]
81 >>> print(last_comment.div.decode_contents())
82- <p>A comment with no change to the bug task.</p>
83+ <div...><p>A comment with no change to the bug task.</p></div>
84diff --git a/lib/lp/bugs/stories/bugs/xx-add-comment-distribution-no-current-release.txt b/lib/lp/bugs/stories/bugs/xx-add-comment-distribution-no-current-release.txt
85index f28a028..b90a49f 100644
86--- a/lib/lp/bugs/stories/bugs/xx-add-comment-distribution-no-current-release.txt
87+++ b/lib/lp/bugs/stories/bugs/xx-add-comment-distribution-no-current-release.txt
88@@ -17,4 +17,4 @@ it's still possible to add comments to the bug.
89 >>> for comment_div in find_tags_by_class(
90 ... user_browser.contents, 'boardCommentBody'):
91 ... print(comment_div.div.decode_contents())
92- <p>A new comment.</p>
93+ <div...><p>A new comment.</p></div>
94diff --git a/lib/lp/bugs/stories/bugs/xx-bug-activity.txt b/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
95index d2e3dc1..95d0d4f 100644
96--- a/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
97+++ b/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
98@@ -222,12 +222,16 @@ bundled with that comment in the UI.
99 >>> admin_browser.getControl('Importance').value = ['Low']
100 >>> admin_browser.getControl('Comment').value = "Lookit, a change!"
101 >>> admin_browser.getControl("Save Changes").click()
102+
103+Note that "Lookit, a change!" appears twice: once displaying the message
104+itself, and once again inside the textarea to edit the message.
105 >>> print_comments(admin_browser.contents)
106 Foo Bar (name16)
107 wrote
108 ... ago:
109 #2
110 Lookit, a change!
111+ Lookit, a change!
112 Changed in mozilla-firefox (Ubuntu):
113 status:
114 New → Confirmed
115diff --git a/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt b/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt
116index 0bc014c..1bef19e 100644
117--- a/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt
118+++ b/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt
119@@ -30,25 +30,41 @@ truncated.
120 ... comment_divs = soup('div', 'boardCommentBody')
121 ... for div_tag in comment_divs:
122 ... print(div_tag)
123- >>> print_comments(browser.contents) #doctest: -ELLIPSIS
124+ >>> print_comments(browser.contents) #doctest: +ELLIPSIS
125 <div class="boardCommentBody">
126- <a href="http://bugs.launchpad.test/tomcat/+bug/2/comments/1/+download">Download
127+ <a href="http://bugs...test/tomcat/+bug/2/comments/1/+download">Download
128 full text</a> (363 bytes)
129- <div class="comment-text" itemprop="commentText"><p>This
130+ <div class="editable-message-body">
131+ <div class="comment-text editable-message-text"
132+ itemprop="commentText"><p>This
133 would be a real killer feature. If there...</p></div>
134 <p>
135 <a href="/tomcat/+bug/2/comments/1">Read more...</a>
136 </p>
137 </div>
138+ <div class="editable-message-form" style="display: none">
139+ <textarea rows="10" style="width: 100%">This would be a real...</textarea>
140+ <input class="editable-message-update-btn" type="button" value="Update"/>
141+ <input class="editable-message-cancel-btn" type="button" value="Cancel"/>
142+ </div>
143+ </div>
144 <div class="boardCommentBody">
145- <a href="http://bugs.launchpad.test/tomcat/+bug/2/comments/2/+download">Download
146+ <a href="http://bugs...test/tomcat/+bug/2/comments/2/+download">Download
147 full text</a> (364 bytes)
148- <div class="comment-text" itemprop="commentText"><p>Oddly
149- enough the bug system seems only capabl...</p></div>
150+ <div class="editable-message-body">
151+ <div class="comment-text editable-message-text"
152+ itemprop="commentText"><p>Oddly enough the bug system seems only
153+ capabl...</p></div>
154 <p>
155 <a href="/tomcat/+bug/2/comments/2">Read more...</a>
156 </p>
157 </div>
158+ <div class="editable-message-form" style="display: none">
159+ <textarea rows="10" style="width: 100%">Oddly enough the bug...</textarea>
160+ <input class="editable-message-update-btn" type="button" value="Update"/>
161+ <input class="editable-message-cancel-btn" type="button" value="Cancel"/>
162+ </div>
163+ </div>
164
165 Let's click on the first "Read more..." link.
166
167@@ -61,15 +77,22 @@ The whole comment is visible on this page:
168 >>> print(browser.title)
169 Comment #1 : Bug #2 (blackhole) : Bugs : Tomcat
170
171- >>> print_comments(browser.contents) #doctest: -ELLIPSIS
172+ >>> print_comments(browser.contents) #doctest: +ELLIPSIS
173 <div class="boardCommentBody">
174- <div class="comment-text" itemprop="commentText"><p>This
175- would be a real killer feature. If there is already code
176+ <div class="editable-message-body">
177+ <div class="comment-text editable-message-text"
178+ itemprop="commentText"><p>This would be a real killer feature.
179+ If there is already code
180 to make it possible, why aren't there tons of press announcements
181 about the secuirty possibilities. Imagine - no more embarrassing
182- emails for Mr Gates... everything they delete would actually
183- disappear! I'm sure Redmond will switch over as soon as they hear
184- about this. It's not a bug, it's a feature!</p></div>
185+ emails for ... disappear! I'm sure Redmond will switch over as soon as
186+ they hear about this. It's not a bug, it's a feature!</p></div>
187+ </div>
188+ <div class="editable-message-form" style="display: none">
189+ <textarea rows="10" style="width: 100%">This would be a...</textarea>
190+ <input class="editable-message-update-btn" type="button" value="Update"/>
191+ <input class="editable-message-cancel-btn" type="button" value="Cancel"/>
192+ </div>
193 </div>
194
195 >>> config_data = config.pop('max_comment_data')
196diff --git a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
197index 35d576e..ed2fd5d 100644
198--- a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
199+++ b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
200@@ -84,7 +84,7 @@ bugtask directly.
201 They see their comment was appended to the bug report's messages.
202
203 >>> print(extract_text(
204- ... find_tags_by_class(str(content), 'boardCommentBody')[-1]))
205+ ... find_tags_by_class(str(content), 'editable-message-text')[-1]))
206 This bug is a question.
207
208 No Privileges Person looks at the page heading and sees that Foo Bar is
209diff --git a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt
210index 91435b0..e92f1ef 100644
211--- a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt
212+++ b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt
213@@ -78,7 +78,7 @@ Admin users will see the hidden message highlighted with an
214 'adminHiddenComment' style.
215
216 >>> print(' '.join(last_comment.parent['class']))
217- boardComment adminHiddenComment
218+ boardComment editable-message adminHiddenComment
219
220 Admin users can also reach the message via direct link, and it is
221 highlighted with the 'adminHiddenComment style there too.
222@@ -95,7 +95,7 @@ highlighted with the 'adminHiddenComment style there too.
223 >>> last_comment = main_content('div', 'boardCommentBody')[-1]
224 >>> last_comment_text = extract_text(last_comment.div)
225 >>> print(' '.join(last_comment.parent['class']))
226- boardComment adminHiddenComment
227+ boardComment editable-message adminHiddenComment
228
229 Also for the owner of comment the message is still visible in the bug page.
230
231@@ -112,7 +112,7 @@ Owner of the comment will see the hidden message highlighted with an
232 'adminHiddenComment' style.
233
234 >>> print(' '.join(last_comment.parent['class']))
235- boardComment adminHiddenComment
236+ boardComment editable-message adminHiddenComment
237
238 Owner of the comment can also reach the message via direct link, and it is
239 highlighted with the 'adminHiddenComment style there too.
240@@ -129,4 +129,4 @@ highlighted with the 'adminHiddenComment style there too.
241 >>> last_comment = main_content('div', 'boardCommentBody')[-1]
242 >>> last_comment_text = extract_text(last_comment.div)
243 >>> print(' '.join(last_comment.parent['class']))
244- boardComment adminHiddenComment
245+ boardComment editable-message adminHiddenComment
246diff --git a/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt b/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt
247index b1e9221..576043d 100644
248--- a/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt
249+++ b/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt
250@@ -7,19 +7,25 @@ These comments can be displayed like any other comments on a bug. Bug
251
252 >>> user_browser.open('http://launchpad.test/bugs/15')
253 >>> print_comments(user_browser.contents)
254- <p>Package: gnome-volume...manager...
255+ <div class="comment-text editable-message-text"
256+ itemprop="commentText"><p>Package: gnome-volume...manager...
257 ----------------------------------------
258- <p>reassign 308994 pmount...
259+ <div class="comment-text editable-message-text"
260+ itemprop="commentText"><p>reassign 308994 pmount...
261 ----------------------------------------
262- <p>reassign 308994 gnome-volume-...
263+ <div class="comment-text editable-message-text"
264+ itemprop="commentText"><p>reassign 308994 gnome-volume-...
265 ----------------------------------------
266- <p>reassign 308994 pmount...
267+ <div class="comment-text editable-message-text"
268+ itemprop="commentText"><p>reassign 308994 pmount...
269 ----------------------------------------
270- <p>Hi!...Usually CD-ROMs are handled in /etc/fstab, so this might
271- not even be a...pmount bug...
272+ <div class="comment-text editable-message-text"
273+ itemprop="commentText"><p>Hi!...Usually CD-ROMs are
274+ handled in /etc/fstab, so this might not even be a...pmount bug...
275 ----------------------------------------
276- <p>I'll be happy to add the info you request to the bug report
277- if it will...
278+ <div class="comment-text editable-message-text"
279+ itemprop="commentText"><p>I'll be happy to add the info you request to
280+ the bug report if it will...
281 ----------------------------------------
282
283 The comments imported for a watch can be seen on that watch's +comments
284@@ -32,17 +38,23 @@ page. This page isn't linked to, so we need to browse to it directly.
285 The ordinary user can't see these comments:
286
287 >>> print_comments(user_browser.contents)
288- <p>Package: gnome-volume...manager...
289+ <div class="comment-text editable-message-text"
290+ itemprop="commentText"><p>Package: gnome-volume...manager...
291 ----------------------------------------
292- <p>reassign 308994 pmount...
293+ <div class="comment-text editable-message-text"
294+ itemprop="commentText"><p>reassign 308994 pmount...
295 ----------------------------------------
296- <p>reassign 308994 gnome-volume-...
297+ <div class="comment-text editable-message-text"
298+ itemprop="commentText"><p>reassign 308994 gnome-volume-...
299 ----------------------------------------
300- <p>reassign 308994 pmount...
301+ <div class="comment-text editable-message-text"
302+ itemprop="commentText"><p>reassign 308994 pmount...
303 ----------------------------------------
304- <p>Hi!...Usually CD-ROMs are handled in /etc/fstab, so this might
305- not even be a...pmount bug...
306+ <div class="comment-text editable-message-text"
307+ itemprop="commentText"><p>Hi!...Usually CD-ROMs are handled
308+ in /etc/fstab, so this might not even be a...pmount bug...
309 ----------------------------------------
310- <p>I'll be happy to add the info you request to the bug report
311- if it will...
312+ <div class="comment-text editable-message-text"
313+ itemprop="commentText"><p>I'll be happy to add the info you request to
314+ the bug report if it will...
315 ----------------------------------------
316diff --git a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt
317index ba8dda6..e9629f2 100644
318--- a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt
319+++ b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt
320@@ -142,12 +142,13 @@ And three comments were added, including the empty comment that was
321 created for the attachments.
322
323 >>> print_comments(user_browser.contents)
324- <p>This should be added as a comment.</p>
325+ <div...><p>This should be added as a comment.</p></div>
326 ----------------------------------------
327- <p>This should be added as another comment.</p>
328+ <div...><p>This should be added as another comment.</p></div>
329 ----------------------------------------
330 Attachment: attachment1
331 Attachment: Attachment description.
332+ <div class="comment-text editable-message-text"...></div>
333 ----------------------------------------
334
335
336diff --git a/lib/lp/bugs/templates/bugcomment-box.pt b/lib/lp/bugs/templates/bugcomment-box.pt
337index 1b087d7..83befd7 100644
338--- a/lib/lp/bugs/templates/bugcomment-box.pt
339+++ b/lib/lp/bugs/templates/bugcomment-box.pt
340@@ -9,8 +9,9 @@
341 python: comment.bugwatch and 'remoteBugComment' or '';
342 admin_comment_hidden_class
343 python: comment.show_for_admin and 'adminHiddenComment' or ''"
344- tal:attributes="class string:boardComment ${remote_bug_comment_class}
345- ${admin_comment_hidden_class}">
346+ tal:attributes="class string:boardComment editable-message
347+ ${remote_bug_comment_class} ${admin_comment_hidden_class};
348+ data-baseurl comment/fmt:url">
349
350 <div class="boardCommentDetails">
351 <table>
352@@ -26,7 +27,13 @@
353 datetime comment/datecreated/fmt:isodate"
354 tal:content="comment/datecreated/fmt:displaydate">
355 7 minutes ago
356- </time>:
357+ </time><span class="editable-message-last-edit-date"><tal:last-edit condition="context/date_last_edited">
358+ (last edit <time
359+ itemprop="editTime"
360+ tal:attributes="title context/date_last_edited/fmt:datetime;
361+ datetime context/date_last_edited/fmt:isodate"
362+ tal:content="context/date_last_edited/fmt:displaydate"/>)</tal:last-edit>:
363+ </span>
364 <a tal:attributes="href comment/fmt:url"
365 tal:condition="comment/display_title">
366 <strong tal:content="comment/title" />
367@@ -47,13 +54,24 @@
368 datetime comment/datecreated/fmt:isodate"
369 tal:content="comment/datecreated/fmt:displaydate">
370 7 minutes ago
371- </time>:
372+ </time><span class="editable-message-last-edit-date"><tal:last-edit condition="context/date_last_edited">
373+ (last edit <time
374+ itemprop="editTime"
375+ tal:attributes="title context/date_last_edited/fmt:datetime;
376+ datetime context/date_last_edited/fmt:isodate"
377+ tal:content="context/date_last_edited/fmt:displaydate"/>)</tal:last-edit>:
378+ </span>
379 <a tal:attributes="href comment/fmt:url">
380 <strong tal:condition="comment/display_title"
381 tal:content="comment/title" />
382 </a>
383 </td>
384
385+ <td>
386+ <img class="sprite edit action-icon editable-message-edit-btn"
387+ tal:condition="view/can_edit"/>
388+ </td>
389+
390 <td class="bug-comment-index">
391 <a itemprop="url"
392 tal:attributes="href comment/fmt:url"
393diff --git a/lib/lp/bugs/templates/bugtask-index.pt b/lib/lp/bugs/templates/bugtask-index.pt
394index 2e4fb91..8517916 100644
395--- a/lib/lp/bugs/templates/bugtask-index.pt
396+++ b/lib/lp/bugs/templates/bugtask-index.pt
397@@ -12,7 +12,7 @@
398 <script type="text/javascript">
399 LPJS.use('base', 'node', 'oop', 'event', 'lp.bugs.bugtask_index',
400 'lp.bugs.subscribers', 'lp.code.branchmergeproposal.diff',
401- 'lp.app.comment', function(Y) {
402+ 'lp.app.comment', 'lp.services.messages.edit', function(Y) {
403 Y.on('domready', function() {
404 Y.lp.code.branchmergeproposal.diff.connect_diff_links();
405 Y.lp.bugs.bugtask_index.setup_bugtask_index();
406@@ -26,6 +26,8 @@
407 '/+bug-portlet-subscribers-details',
408 subscribe_someone_else_link: '.menu-link-addsubscriber'
409 }, window);
410+
411+ Y.lp.services.messages.edit.setup();
412 });
413 });
414 </script>
415diff --git a/lib/lp/services/comments/templates/comment-body.pt b/lib/lp/services/comments/templates/comment-body.pt
416index d68be76..cce285b 100644
417--- a/lib/lp/services/comments/templates/comment-body.pt
418+++ b/lib/lp/services/comments/templates/comment-body.pt
419@@ -5,11 +5,22 @@
420
421 <a tal:replace="structure view/download_link"
422 tal:condition="context/too_long">Download full text</a>
423- <div class="comment-text" itemprop="commentText" tal:content="structure
424- context/text_for_display/fmt:obfuscate-email/fmt:email-to-html" />
425- <tal:renderable condition="not: context/too_long_to_render">
426- <p tal:condition="context/too_long">
427- <a tal:attributes="href context/fmt:url">Read more...</a>
428- </p>
429- </tal:renderable >
430+ <div class="editable-message-body">
431+ <div class="comment-text editable-message-text" itemprop="commentText"
432+ tal:content="structure
433+ context/text_for_display/fmt:obfuscate-email/fmt:email-to-html" />
434+ <tal:renderable condition="not: context/too_long_to_render">
435+ <p tal:condition="context/too_long">
436+ <a tal:attributes="href context/fmt:url">Read more...</a>
437+ </p>
438+ </tal:renderable >
439+ </div>
440+
441+ <div class="editable-message-form" style="display: none"
442+ tal:condition="python: not getattr(context, 'hide_text', False)">
443+ <textarea style="width: 100%" rows="10"
444+ tal:content="context/text_contents" />
445+ <input type="button" value="Update" class="editable-message-update-btn" />
446+ <input type="button" value="Cancel" class="editable-message-cancel-btn" />
447+ </div>
448 </tal:root>
449diff --git a/lib/lp/services/messages/javascript/tests/test_messages.edit.html b/lib/lp/services/messages/javascript/tests/test_messages.edit.html
450index 483f425..94c60ea 100644
451--- a/lib/lp/services/messages/javascript/tests/test_messages.edit.html
452+++ b/lib/lp/services/messages/javascript/tests/test_messages.edit.html
453@@ -62,7 +62,7 @@ GNU Affero General Public License version 3 (see the file LICENSE).
454 <div class="editable-message-text"></div>
455 The message is above :)
456 </div>
457- <img class="sprite edit action-icon editable-message-edit-btn">
458+ <img class="sprite edit action-icon editable-message-edit-btn" />
459
460 <div class="editable-message-form">
461 <textarea></textarea>
462@@ -83,7 +83,7 @@ GNU Affero General Public License version 3 (see the file LICENSE).
463 <div class="editable-message-text"></div>
464 The message is above :)
465 </div>
466- <img class="sprite edit action-icon editable-message-edit-btn">
467+ <img class="sprite edit action-icon editable-message-edit-btn" />
468
469 <div class="editable-message-form">
470 <textarea></textarea>