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