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 (community) 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
diff --git a/lib/lp/bugs/browser/bugcomment.py b/lib/lp/bugs/browser/bugcomment.py
index 6cc89f2..45a992d 100644
--- a/lib/lp/bugs/browser/bugcomment.py
+++ b/lib/lp/bugs/browser/bugcomment.py
@@ -52,6 +52,7 @@ from lp.services.webapp import (
52 Navigation,52 Navigation,
53 stepthrough,53 stepthrough,
54 )54 )
55from lp.services.webapp.authorization import check_permission
55from lp.services.webapp.breadcrumb import Breadcrumb56from lp.services.webapp.breadcrumb import Breadcrumb
56from lp.services.webapp.interfaces import ILaunchBag57from lp.services.webapp.interfaces import ILaunchBag
5758
@@ -353,12 +354,20 @@ class BugCommentBoxView(LaunchpadView, BugCommentBoxViewMixin):
353354
354 expand_reply_box = False355 expand_reply_box = False
355356
357 @property
358 def can_edit(self):
359 return check_permission('launchpad.Edit', self.context)
360
356361
357class BugCommentBoxExpandedReplyView(LaunchpadView, BugCommentBoxViewMixin):362class BugCommentBoxExpandedReplyView(LaunchpadView, BugCommentBoxViewMixin):
358 """Render a comment box with reply field expanded."""363 """Render a comment box with reply field expanded."""
359364
360 expand_reply_box = True365 expand_reply_box = True
361366
367 @property
368 def can_edit(self):
369 return False
370
362371
363@adapter(IBugComment, IWebServiceClientRequest)372@adapter(IBugComment, IWebServiceClientRequest)
364@implementer(Interface)373@implementer(Interface)
diff --git a/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt b/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
index f705c8a..b9f7292 100644
--- a/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
+++ b/lib/lp/bugs/stories/bugattachments/xx-delete-bug-attachment.txt
@@ -24,11 +24,17 @@ The attachment is now visible on the bug page.
24There will also be a comment with a link to the attachment in its body.24There will also be a comment with a link to the attachment in its body.
2525
26 >>> print_comments(user_browser.contents)26 >>> print_comments(user_browser.contents)
27 <p>This would be a real killer feature...</p>27 <div class="comment-text editable-message-text"
28 itemprop="commentText"><p>This would be a real killer
29 feature...</p></div>
28 ----------------------------------------30 ----------------------------------------
29 <p>Oddly enough the bug system seems only capable...</p>31 <div class="comment-text editable-message-text"
32 itemprop="commentText"><p>Oddly enough the bug system seems
33 only capable...</p></div>
30 ----------------------------------------34 ----------------------------------------
31 Attachment: Great deal35 Attachment: Great deal
36 <div class="comment-text editable-message-text"
37 itemprop="commentText"></div>
32 <BLANKLINE>38 <BLANKLINE>
33 ----------------------------------------39 ----------------------------------------
3440
@@ -80,9 +86,13 @@ Since the attachment has been deleted, the comment referencing it will no
80longer be visible.86longer be visible.
8187
82 >>> print_comments(user_browser.contents)88 >>> print_comments(user_browser.contents)
83 <p>This would be a real killer feature...</p>89 <div class="comment-text editable-message-text"
90 itemprop="commentText"><p>This would be a real
91 killer feature...</p></div>
84 ----------------------------------------92 ----------------------------------------
85 <p>Oddly enough the bug system seems only capable...</p>93 <div class="comment-text editable-message-text"
94 itemprop="commentText"><p>Oddly enough the bug system
95 seems only capable...</p></div>
86 ----------------------------------------96 ----------------------------------------
8797
88XXX Abel Deuring, 2009-11-25: We should check here that attempts to98XXX Abel Deuring, 2009-11-25: We should check here that attempts to
diff --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
index cb230ec..d2e6dcb 100644
--- a/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt
+++ b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.txt
@@ -21,4 +21,4 @@ The user was returned to the bug page, and the comment was added.
21 >>> main_content = find_main_content(user_browser.contents)21 >>> main_content = find_main_content(user_browser.contents)
22 >>> last_comment = main_content('div', 'boardCommentBody')[-1]22 >>> last_comment = main_content('div', 'boardCommentBody')[-1]
23 >>> print(last_comment.div.decode_contents())23 >>> print(last_comment.div.decode_contents())
24 <p>A comment with no change to the bug task.</p>24 <div...><p>A comment with no change to the bug task.</p></div>
diff --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
index f28a028..b90a49f 100644
--- 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
@@ -17,4 +17,4 @@ it's still possible to add comments to the bug.
17 >>> for comment_div in find_tags_by_class(17 >>> for comment_div in find_tags_by_class(
18 ... user_browser.contents, 'boardCommentBody'):18 ... user_browser.contents, 'boardCommentBody'):
19 ... print(comment_div.div.decode_contents())19 ... print(comment_div.div.decode_contents())
20 <p>A new comment.</p>20 <div...><p>A new comment.</p></div>
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-activity.txt b/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
index d2e3dc1..95d0d4f 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
+++ b/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
@@ -222,12 +222,16 @@ bundled with that comment in the UI.
222 >>> admin_browser.getControl('Importance').value = ['Low']222 >>> admin_browser.getControl('Importance').value = ['Low']
223 >>> admin_browser.getControl('Comment').value = "Lookit, a change!"223 >>> admin_browser.getControl('Comment').value = "Lookit, a change!"
224 >>> admin_browser.getControl("Save Changes").click()224 >>> admin_browser.getControl("Save Changes").click()
225
226Note that "Lookit, a change!" appears twice: once displaying the message
227itself, and once again inside the textarea to edit the message.
225 >>> print_comments(admin_browser.contents)228 >>> print_comments(admin_browser.contents)
226 Foo Bar (name16)229 Foo Bar (name16)
227 wrote230 wrote
228 ... ago:231 ... ago:
229 #2232 #2
230 Lookit, a change!233 Lookit, a change!
234 Lookit, a change!
231 Changed in mozilla-firefox (Ubuntu):235 Changed in mozilla-firefox (Ubuntu):
232 status:236 status:
233 New → Confirmed237 New → Confirmed
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt b/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt
index 0bc014c..1bef19e 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt
+++ b/lib/lp/bugs/stories/bugs/xx-bug-comments-truncated.txt
@@ -30,25 +30,41 @@ truncated.
30 ... comment_divs = soup('div', 'boardCommentBody')30 ... comment_divs = soup('div', 'boardCommentBody')
31 ... for div_tag in comment_divs:31 ... for div_tag in comment_divs:
32 ... print(div_tag)32 ... print(div_tag)
33 >>> print_comments(browser.contents) #doctest: -ELLIPSIS33 >>> print_comments(browser.contents) #doctest: +ELLIPSIS
34 <div class="boardCommentBody">34 <div class="boardCommentBody">
35 <a href="http://bugs.launchpad.test/tomcat/+bug/2/comments/1/+download">Download35 <a href="http://bugs...test/tomcat/+bug/2/comments/1/+download">Download
36 full text</a> (363 bytes)36 full text</a> (363 bytes)
37 <div class="comment-text" itemprop="commentText"><p>This37 <div class="editable-message-body">
38 <div class="comment-text editable-message-text"
39 itemprop="commentText"><p>This
38 would be a real killer feature. If there...</p></div>40 would be a real killer feature. If there...</p></div>
39 <p>41 <p>
40 <a href="/tomcat/+bug/2/comments/1">Read more...</a>42 <a href="/tomcat/+bug/2/comments/1">Read more...</a>
41 </p>43 </p>
42 </div>44 </div>
45 <div class="editable-message-form" style="display: none">
46 <textarea rows="10" style="width: 100%">This would be a real...</textarea>
47 <input class="editable-message-update-btn" type="button" value="Update"/>
48 <input class="editable-message-cancel-btn" type="button" value="Cancel"/>
49 </div>
50 </div>
43 <div class="boardCommentBody">51 <div class="boardCommentBody">
44 <a href="http://bugs.launchpad.test/tomcat/+bug/2/comments/2/+download">Download52 <a href="http://bugs...test/tomcat/+bug/2/comments/2/+download">Download
45 full text</a> (364 bytes)53 full text</a> (364 bytes)
46 <div class="comment-text" itemprop="commentText"><p>Oddly54 <div class="editable-message-body">
47 enough the bug system seems only capabl...</p></div>55 <div class="comment-text editable-message-text"
56 itemprop="commentText"><p>Oddly enough the bug system seems only
57 capabl...</p></div>
48 <p>58 <p>
49 <a href="/tomcat/+bug/2/comments/2">Read more...</a>59 <a href="/tomcat/+bug/2/comments/2">Read more...</a>
50 </p>60 </p>
51 </div>61 </div>
62 <div class="editable-message-form" style="display: none">
63 <textarea rows="10" style="width: 100%">Oddly enough the bug...</textarea>
64 <input class="editable-message-update-btn" type="button" value="Update"/>
65 <input class="editable-message-cancel-btn" type="button" value="Cancel"/>
66 </div>
67 </div>
5268
53Let's click on the first "Read more..." link.69Let's click on the first "Read more..." link.
5470
@@ -61,15 +77,22 @@ The whole comment is visible on this page:
61 >>> print(browser.title)77 >>> print(browser.title)
62 Comment #1 : Bug #2 (blackhole) : Bugs : Tomcat78 Comment #1 : Bug #2 (blackhole) : Bugs : Tomcat
6379
64 >>> print_comments(browser.contents) #doctest: -ELLIPSIS80 >>> print_comments(browser.contents) #doctest: +ELLIPSIS
65 <div class="boardCommentBody">81 <div class="boardCommentBody">
66 <div class="comment-text" itemprop="commentText"><p>This82 <div class="editable-message-body">
67 would be a real killer feature. If there is already code83 <div class="comment-text editable-message-text"
84 itemprop="commentText"><p>This would be a real killer feature.
85 If there is already code
68 to make it possible, why aren't there tons of press announcements86 to make it possible, why aren't there tons of press announcements
69 about the secuirty possibilities. Imagine - no more embarrassing87 about the secuirty possibilities. Imagine - no more embarrassing
70 emails for Mr Gates... everything they delete would actually88 emails for ... disappear! I'm sure Redmond will switch over as soon as
71 disappear! I'm sure Redmond will switch over as soon as they hear89 they hear about this. It's not a bug, it's a feature!</p></div>
72 about this. It's not a bug, it's a feature!</p></div>90 </div>
91 <div class="editable-message-form" style="display: none">
92 <textarea rows="10" style="width: 100%">This would be a...</textarea>
93 <input class="editable-message-update-btn" type="button" value="Update"/>
94 <input class="editable-message-cancel-btn" type="button" value="Cancel"/>
95 </div>
73 </div>96 </div>
7497
75 >>> config_data = config.pop('max_comment_data')98 >>> config_data = config.pop('max_comment_data')
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
index 35d576e..ed2fd5d 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
+++ b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
@@ -84,7 +84,7 @@ bugtask directly.
84They see their comment was appended to the bug report's messages.84They see their comment was appended to the bug report's messages.
8585
86 >>> print(extract_text(86 >>> print(extract_text(
87 ... find_tags_by_class(str(content), 'boardCommentBody')[-1]))87 ... find_tags_by_class(str(content), 'editable-message-text')[-1]))
88 This bug is a question.88 This bug is a question.
8989
90No Privileges Person looks at the page heading and sees that Foo Bar is90No Privileges Person looks at the page heading and sees that Foo Bar is
diff --git a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt
index 91435b0..e92f1ef 100644
--- a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt
+++ b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.txt
@@ -78,7 +78,7 @@ Admin users will see the hidden message highlighted with an
78'adminHiddenComment' style.78'adminHiddenComment' style.
7979
80 >>> print(' '.join(last_comment.parent['class']))80 >>> print(' '.join(last_comment.parent['class']))
81 boardComment adminHiddenComment81 boardComment editable-message adminHiddenComment
8282
83Admin users can also reach the message via direct link, and it is83Admin users can also reach the message via direct link, and it is
84highlighted with the 'adminHiddenComment style there too.84highlighted with the 'adminHiddenComment style there too.
@@ -95,7 +95,7 @@ highlighted with the 'adminHiddenComment style there too.
95 >>> last_comment = main_content('div', 'boardCommentBody')[-1]95 >>> last_comment = main_content('div', 'boardCommentBody')[-1]
96 >>> last_comment_text = extract_text(last_comment.div)96 >>> last_comment_text = extract_text(last_comment.div)
97 >>> print(' '.join(last_comment.parent['class']))97 >>> print(' '.join(last_comment.parent['class']))
98 boardComment adminHiddenComment98 boardComment editable-message adminHiddenComment
9999
100Also for the owner of comment the message is still visible in the bug page.100Also for the owner of comment the message is still visible in the bug page.
101101
@@ -112,7 +112,7 @@ Owner of the comment will see the hidden message highlighted with an
112'adminHiddenComment' style.112'adminHiddenComment' style.
113113
114 >>> print(' '.join(last_comment.parent['class']))114 >>> print(' '.join(last_comment.parent['class']))
115 boardComment adminHiddenComment115 boardComment editable-message adminHiddenComment
116116
117Owner of the comment can also reach the message via direct link, and it is117Owner of the comment can also reach the message via direct link, and it is
118highlighted with the 'adminHiddenComment style there too.118highlighted with the 'adminHiddenComment style there too.
@@ -129,4 +129,4 @@ highlighted with the 'adminHiddenComment style there too.
129 >>> last_comment = main_content('div', 'boardCommentBody')[-1]129 >>> last_comment = main_content('div', 'boardCommentBody')[-1]
130 >>> last_comment_text = extract_text(last_comment.div)130 >>> last_comment_text = extract_text(last_comment.div)
131 >>> print(' '.join(last_comment.parent['class']))131 >>> print(' '.join(last_comment.parent['class']))
132 boardComment adminHiddenComment132 boardComment editable-message adminHiddenComment
diff --git a/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt b/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt
index b1e9221..576043d 100644
--- a/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt
+++ b/lib/lp/bugs/stories/bugwatches/xx-bugwatch-comments.txt
@@ -7,19 +7,25 @@ These comments can be displayed like any other comments on a bug. Bug
77
8 >>> user_browser.open('http://launchpad.test/bugs/15')8 >>> user_browser.open('http://launchpad.test/bugs/15')
9 >>> print_comments(user_browser.contents)9 >>> print_comments(user_browser.contents)
10 <p>Package: gnome-volume...manager...10 <div class="comment-text editable-message-text"
11 itemprop="commentText"><p>Package: gnome-volume...manager...
11 ----------------------------------------12 ----------------------------------------
12 <p>reassign 308994 pmount...13 <div class="comment-text editable-message-text"
14 itemprop="commentText"><p>reassign 308994 pmount...
13 ----------------------------------------15 ----------------------------------------
14 <p>reassign 308994 gnome-volume-...16 <div class="comment-text editable-message-text"
17 itemprop="commentText"><p>reassign 308994 gnome-volume-...
15 ----------------------------------------18 ----------------------------------------
16 <p>reassign 308994 pmount...19 <div class="comment-text editable-message-text"
20 itemprop="commentText"><p>reassign 308994 pmount...
17 ----------------------------------------21 ----------------------------------------
18 <p>Hi!...Usually CD-ROMs are handled in /etc/fstab, so this might22 <div class="comment-text editable-message-text"
19 not even be a...pmount bug...23 itemprop="commentText"><p>Hi!...Usually CD-ROMs are
24 handled in /etc/fstab, so this might not even be a...pmount bug...
20 ----------------------------------------25 ----------------------------------------
21 <p>I'll be happy to add the info you request to the bug report26 <div class="comment-text editable-message-text"
22 if it will...27 itemprop="commentText"><p>I'll be happy to add the info you request to
28 the bug report if it will...
23 ----------------------------------------29 ----------------------------------------
2430
25The comments imported for a watch can be seen on that watch's +comments31The comments imported for a watch can be seen on that watch's +comments
@@ -32,17 +38,23 @@ page. This page isn't linked to, so we need to browse to it directly.
32The ordinary user can't see these comments:38The ordinary user can't see these comments:
3339
34 >>> print_comments(user_browser.contents)40 >>> print_comments(user_browser.contents)
35 <p>Package: gnome-volume...manager...41 <div class="comment-text editable-message-text"
42 itemprop="commentText"><p>Package: gnome-volume...manager...
36 ----------------------------------------43 ----------------------------------------
37 <p>reassign 308994 pmount...44 <div class="comment-text editable-message-text"
45 itemprop="commentText"><p>reassign 308994 pmount...
38 ----------------------------------------46 ----------------------------------------
39 <p>reassign 308994 gnome-volume-...47 <div class="comment-text editable-message-text"
48 itemprop="commentText"><p>reassign 308994 gnome-volume-...
40 ----------------------------------------49 ----------------------------------------
41 <p>reassign 308994 pmount...50 <div class="comment-text editable-message-text"
51 itemprop="commentText"><p>reassign 308994 pmount...
42 ----------------------------------------52 ----------------------------------------
43 <p>Hi!...Usually CD-ROMs are handled in /etc/fstab, so this might53 <div class="comment-text editable-message-text"
44 not even be a...pmount bug...54 itemprop="commentText"><p>Hi!...Usually CD-ROMs are handled
55 in /etc/fstab, so this might not even be a...pmount bug...
45 ----------------------------------------56 ----------------------------------------
46 <p>I'll be happy to add the info you request to the bug report57 <div class="comment-text editable-message-text"
47 if it will...58 itemprop="commentText"><p>I'll be happy to add the info you request to
59 the bug report if it will...
48 ----------------------------------------60 ----------------------------------------
diff --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
index ba8dda6..e9629f2 100644
--- a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt
+++ b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.txt
@@ -142,12 +142,13 @@ And three comments were added, including the empty comment that was
142created for the attachments.142created for the attachments.
143143
144 >>> print_comments(user_browser.contents)144 >>> print_comments(user_browser.contents)
145 <p>This should be added as a comment.</p>145 <div...><p>This should be added as a comment.</p></div>
146 ----------------------------------------146 ----------------------------------------
147 <p>This should be added as another comment.</p>147 <div...><p>This should be added as another comment.</p></div>
148 ----------------------------------------148 ----------------------------------------
149 Attachment: attachment1149 Attachment: attachment1
150 Attachment: Attachment description.150 Attachment: Attachment description.
151 <div class="comment-text editable-message-text"...></div>
151 ----------------------------------------152 ----------------------------------------
152153
153154
diff --git a/lib/lp/bugs/templates/bugcomment-box.pt b/lib/lp/bugs/templates/bugcomment-box.pt
index 1b087d7..83befd7 100644
--- a/lib/lp/bugs/templates/bugcomment-box.pt
+++ b/lib/lp/bugs/templates/bugcomment-box.pt
@@ -9,8 +9,9 @@
9 python: comment.bugwatch and 'remoteBugComment' or '';9 python: comment.bugwatch and 'remoteBugComment' or '';
10 admin_comment_hidden_class10 admin_comment_hidden_class
11 python: comment.show_for_admin and 'adminHiddenComment' or ''"11 python: comment.show_for_admin and 'adminHiddenComment' or ''"
12 tal:attributes="class string:boardComment ${remote_bug_comment_class}12 tal:attributes="class string:boardComment editable-message
13 ${admin_comment_hidden_class}">13 ${remote_bug_comment_class} ${admin_comment_hidden_class};
14 data-baseurl comment/fmt:url">
1415
15 <div class="boardCommentDetails">16 <div class="boardCommentDetails">
16 <table>17 <table>
@@ -26,7 +27,13 @@
26 datetime comment/datecreated/fmt:isodate"27 datetime comment/datecreated/fmt:isodate"
27 tal:content="comment/datecreated/fmt:displaydate">28 tal:content="comment/datecreated/fmt:displaydate">
28 7 minutes ago29 7 minutes ago
29 </time>:30 </time><span class="editable-message-last-edit-date"><tal:last-edit condition="context/date_last_edited">
31 (last edit <time
32 itemprop="editTime"
33 tal:attributes="title context/date_last_edited/fmt:datetime;
34 datetime context/date_last_edited/fmt:isodate"
35 tal:content="context/date_last_edited/fmt:displaydate"/>)</tal:last-edit>:
36 </span>
30 <a tal:attributes="href comment/fmt:url"37 <a tal:attributes="href comment/fmt:url"
31 tal:condition="comment/display_title">38 tal:condition="comment/display_title">
32 <strong tal:content="comment/title" />39 <strong tal:content="comment/title" />
@@ -47,13 +54,24 @@
47 datetime comment/datecreated/fmt:isodate"54 datetime comment/datecreated/fmt:isodate"
48 tal:content="comment/datecreated/fmt:displaydate">55 tal:content="comment/datecreated/fmt:displaydate">
49 7 minutes ago56 7 minutes ago
50 </time>:57 </time><span class="editable-message-last-edit-date"><tal:last-edit condition="context/date_last_edited">
58 (last edit <time
59 itemprop="editTime"
60 tal:attributes="title context/date_last_edited/fmt:datetime;
61 datetime context/date_last_edited/fmt:isodate"
62 tal:content="context/date_last_edited/fmt:displaydate"/>)</tal:last-edit>:
63 </span>
51 <a tal:attributes="href comment/fmt:url">64 <a tal:attributes="href comment/fmt:url">
52 <strong tal:condition="comment/display_title"65 <strong tal:condition="comment/display_title"
53 tal:content="comment/title" />66 tal:content="comment/title" />
54 </a>67 </a>
55 </td>68 </td>
5669
70 <td>
71 <img class="sprite edit action-icon editable-message-edit-btn"
72 tal:condition="view/can_edit"/>
73 </td>
74
57 <td class="bug-comment-index">75 <td class="bug-comment-index">
58 <a itemprop="url"76 <a itemprop="url"
59 tal:attributes="href comment/fmt:url"77 tal:attributes="href comment/fmt:url"
diff --git a/lib/lp/bugs/templates/bugtask-index.pt b/lib/lp/bugs/templates/bugtask-index.pt
index 2e4fb91..8517916 100644
--- a/lib/lp/bugs/templates/bugtask-index.pt
+++ b/lib/lp/bugs/templates/bugtask-index.pt
@@ -12,7 +12,7 @@
12 <script type="text/javascript">12 <script type="text/javascript">
13 LPJS.use('base', 'node', 'oop', 'event', 'lp.bugs.bugtask_index',13 LPJS.use('base', 'node', 'oop', 'event', 'lp.bugs.bugtask_index',
14 'lp.bugs.subscribers', 'lp.code.branchmergeproposal.diff',14 'lp.bugs.subscribers', 'lp.code.branchmergeproposal.diff',
15 'lp.app.comment', function(Y) {15 'lp.app.comment', 'lp.services.messages.edit', function(Y) {
16 Y.on('domready', function() {16 Y.on('domready', function() {
17 Y.lp.code.branchmergeproposal.diff.connect_diff_links();17 Y.lp.code.branchmergeproposal.diff.connect_diff_links();
18 Y.lp.bugs.bugtask_index.setup_bugtask_index();18 Y.lp.bugs.bugtask_index.setup_bugtask_index();
@@ -26,6 +26,8 @@
26 '/+bug-portlet-subscribers-details',26 '/+bug-portlet-subscribers-details',
27 subscribe_someone_else_link: '.menu-link-addsubscriber'27 subscribe_someone_else_link: '.menu-link-addsubscriber'
28 }, window);28 }, window);
29
30 Y.lp.services.messages.edit.setup();
29 });31 });
30 });32 });
31 </script>33 </script>
diff --git a/lib/lp/services/comments/templates/comment-body.pt b/lib/lp/services/comments/templates/comment-body.pt
index d68be76..cce285b 100644
--- a/lib/lp/services/comments/templates/comment-body.pt
+++ b/lib/lp/services/comments/templates/comment-body.pt
@@ -5,11 +5,22 @@
55
6 <a tal:replace="structure view/download_link"6 <a tal:replace="structure view/download_link"
7 tal:condition="context/too_long">Download full text</a>7 tal:condition="context/too_long">Download full text</a>
8 <div class="comment-text" itemprop="commentText" tal:content="structure8 <div class="editable-message-body">
9 context/text_for_display/fmt:obfuscate-email/fmt:email-to-html" />9 <div class="comment-text editable-message-text" itemprop="commentText"
10 <tal:renderable condition="not: context/too_long_to_render">10 tal:content="structure
11 <p tal:condition="context/too_long">11 context/text_for_display/fmt:obfuscate-email/fmt:email-to-html" />
12 <a tal:attributes="href context/fmt:url">Read more...</a>12 <tal:renderable condition="not: context/too_long_to_render">
13 </p>13 <p tal:condition="context/too_long">
14 </tal:renderable >14 <a tal:attributes="href context/fmt:url">Read more...</a>
15 </p>
16 </tal:renderable >
17 </div>
18
19 <div class="editable-message-form" style="display: none"
20 tal:condition="python: not getattr(context, 'hide_text', False)">
21 <textarea style="width: 100%" rows="10"
22 tal:content="context/text_contents" />
23 <input type="button" value="Update" class="editable-message-update-btn" />
24 <input type="button" value="Cancel" class="editable-message-cancel-btn" />
25 </div>
15</tal:root>26</tal:root>
diff --git a/lib/lp/services/messages/javascript/tests/test_messages.edit.html b/lib/lp/services/messages/javascript/tests/test_messages.edit.html
index 483f425..94c60ea 100644
--- a/lib/lp/services/messages/javascript/tests/test_messages.edit.html
+++ b/lib/lp/services/messages/javascript/tests/test_messages.edit.html
@@ -62,7 +62,7 @@ GNU Affero General Public License version 3 (see the file LICENSE).
62 <div class="editable-message-text"></div>62 <div class="editable-message-text"></div>
63 The message is above :)63 The message is above :)
64 </div>64 </div>
65 <img class="sprite edit action-icon editable-message-edit-btn">65 <img class="sprite edit action-icon editable-message-edit-btn" />
6666
67 <div class="editable-message-form">67 <div class="editable-message-form">
68 <textarea></textarea>68 <textarea></textarea>
@@ -83,7 +83,7 @@ GNU Affero General Public License version 3 (see the file LICENSE).
83 <div class="editable-message-text"></div>83 <div class="editable-message-text"></div>
84 The message is above :)84 The message is above :)
85 </div>85 </div>
86 <img class="sprite edit action-icon editable-message-edit-btn">86 <img class="sprite edit action-icon editable-message-edit-btn" />
8787
88 <div class="editable-message-form">88 <div class="editable-message-form">
89 <textarea></textarea>89 <textarea></textarea>