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

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 8e40b52d7712b477e0802561e55c62e5745e72ed
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:comment-editing-ui-list-revisions-bugcomment
Merge into: launchpad:master
Prerequisite: ~pappacena/launchpad:comment-editing-ui-list-revisions
Diff against target: 173 lines (+37/-5)
5 files modified
lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt (+2/-0)
lib/lp/bugs/stories/bugs/xx-bug-activity.txt (+5/-0)
lib/lp/bugs/stories/bugs/xx-bug-create-question.txt (+1/-0)
lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt (+4/-1)
lib/lp/bugs/templates/bugcomment-box.pt (+25/-4)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+403279@code.launchpad.net

Commit message

Adding message revision list to bug comment

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt b/lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt
2index 2bf6a34..9016ea8 100644
3--- a/lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt
4+++ b/lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt
5@@ -12,6 +12,7 @@ of bug #11 is:
6 >>> browser.open("http://bugs.launchpad.test/redfish/+bug/11")
7 >>> comment_1 = find_tags_by_class(browser.contents, 'boardComment')[0]
8 >>> print(extract_text(comment_1))
9+ Revision history for this message
10 Valentina Commissari (tsukimi)
11 wrote
12 on 2007-03-15:
13@@ -43,6 +44,7 @@ displayed as the bug report).
14 >>> browser.open("http://bugs.launchpad.test/redfish/+bug/11")
15 >>> comment_0 = find_tags_by_class(browser.contents, 'boardComment')[0]
16 >>> print(extract_text(comment_0))
17+ Revision history for this message
18 Daniel Silverstone (kinnison)
19 wrote
20 on 2007-03-15:
21diff --git a/lib/lp/bugs/stories/bugs/xx-bug-activity.txt b/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
22index 95d0d4f..1d75aa4 100644
23--- a/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
24+++ b/lib/lp/bugs/stories/bugs/xx-bug-activity.txt
25@@ -63,6 +63,7 @@ page.
26 ... "Here's a comment for testing, like.")
27 >>> user_browser.getControl('Post Comment').click()
28 >>> print_comments(user_browser.contents, slice(None))
29+ Revision history for this message
30 In...
31 Bug Watch Updater (bug-watch-updater)
32 on 2007-12-18
33@@ -70,6 +71,7 @@ page.
34 status:
35 Unknown → New
36 --------
37+ Revision history for this message
38 No Privileges Person (no-priv)
39 ...
40 #7
41@@ -88,6 +90,7 @@ that have been added.
42
43 >>> user_browser.open('http://launchpad.test/bugs/15')
44 >>> print_comments(user_browser.contents, slice(None))
45+ Revision history for this message
46 In...
47 Bug
48 ...
49@@ -226,6 +229,7 @@ bundled with that comment in the UI.
50 Note that "Lookit, a change!" appears twice: once displaying the message
51 itself, and once again inside the textarea to edit the message.
52 >>> print_comments(admin_browser.contents)
53+ Revision history for this message
54 Foo Bar (name16)
55 wrote
56 ... ago:
57@@ -252,6 +256,7 @@ If a target of a bug task is changed the old and new value will be shown.
58 ... ).value = 'linux-source-2.6.15'
59 >>> admin_browser.getControl("Save Changes").click()
60 >>> print_comments(admin_browser.contents)
61+ Revision history for this message
62 Foo Bar (name16)
63 wrote
64 ... ago:
65diff --git a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
66index ed2fd5d..b094569 100644
67--- a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
68+++ b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt
69@@ -271,6 +271,7 @@ They read their comment that was appended to the bug report's messages.
70
71 >>> print(extract_text(
72 ... find_tags_by_class(str(content), 'boardComment')[-1]))
73+ Revision history for this message
74 No Privileges Person (no-priv)
75 wrote
76 ...
77diff --git a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt
78index 7fa1e82..59e338d 100644
79--- a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt
80+++ b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.txt
81@@ -11,6 +11,7 @@ entered within Launchpad itself.
82 >>> details = remote_bug_comment.find(
83 ... attrs={'class': 'boardCommentDetails'})
84 >>> print(extract_text(details))
85+ Revision history for this message
86 In
87 Debian Bug tracker #308994,
88 josh (jbuhl-nospam)
89@@ -21,7 +22,7 @@ entered within Launchpad itself.
90 Remote comments are decorated with the bug watch icon, to distinguish
91 them from comments posted directly by Launchpad users.
92
93- >>> print(details.find('img')['src'])
94+ >>> print(details.find_all('img')[1]['src'])
95 /@@/bug-remote
96
97 Since it's possible to reply to imported comments and have them
98@@ -52,6 +53,7 @@ The new comment appears, formatted as a remote bug comment.
99 >>> new_bug_comment = find_tags_by_class(
100 ... user_browser.contents, 'remoteBugComment')[-1]
101 >>> print(extract_text(new_bug_comment))
102+ Revision history for this message
103 In
104 Debian Bug tracker #308994,
105 ...
106@@ -91,6 +93,7 @@ the 'awaiting synchronization' mark goes away.
107 >>> last_bug_comment = find_tags_by_class(
108 ... user_browser.contents, 'remoteBugComment')[-1]
109 >>> print(extract_text(last_bug_comment))
110+ Revision history for this message
111 In
112 Debian Bug tracker #308994,
113 ...
114diff --git a/lib/lp/bugs/templates/bugcomment-box.pt b/lib/lp/bugs/templates/bugcomment-box.pt
115index 83befd7..34e5789 100644
116--- a/lib/lp/bugs/templates/bugcomment-box.pt
117+++ b/lib/lp/bugs/templates/bugcomment-box.pt
118@@ -14,6 +14,25 @@
119 data-baseurl comment/fmt:url">
120
121 <div class="boardCommentDetails">
122+ <div class="message-revision-container">
123+ <div class="message-revision-container-header">
124+ <span>Revision history for this message</span>
125+ <img src="/+icing/build/overlay/assets/skins/sam/images/close.gif"
126+ class="message-revision-close"/>
127+ </div>
128+ <script type="text/template">
129+ <div class='message-revision-item'>
130+ <div class='message-revision-title'>
131+ <a class="js-action">
132+ Revision #{revision}, created at {date_created}
133+ </a>
134+ </div>
135+ <div class='message-revision-body'>{content}</div>
136+ </div>
137+ </script>
138+ <div class="message-revision-list"></div>
139+ </div>
140+
141 <table>
142 <tbody>
143 <tr>
144@@ -28,11 +47,12 @@
145 tal:content="comment/datecreated/fmt:displaydate">
146 7 minutes ago
147 </time><span class="editable-message-last-edit-date"><tal:last-edit condition="context/date_last_edited">
148- (last edit <time
149+ <a href="#" class="editable-message-last-edit-link"
150+ tal:condition="context/date_last_edited">(last edit <time
151 itemprop="editTime"
152 tal:attributes="title context/date_last_edited/fmt:datetime;
153 datetime context/date_last_edited/fmt:isodate"
154- tal:content="context/date_last_edited/fmt:displaydate"/>)</tal:last-edit>:
155+ tal:content="context/date_last_edited/fmt:displaydate"/>)</a></tal:last-edit>:
156 </span>
157 <a tal:attributes="href comment/fmt:url"
158 tal:condition="comment/display_title">
159@@ -55,11 +75,12 @@
160 tal:content="comment/datecreated/fmt:displaydate">
161 7 minutes ago
162 </time><span class="editable-message-last-edit-date"><tal:last-edit condition="context/date_last_edited">
163- (last edit <time
164+ <a href="#" class="editable-message-last-edit-link"
165+ tal:condition="context/date_last_edited">(last edit <time
166 itemprop="editTime"
167 tal:attributes="title context/date_last_edited/fmt:datetime;
168 datetime context/date_last_edited/fmt:isodate"
169- tal:content="context/date_last_edited/fmt:displaydate"/>)</tal:last-edit>:
170+ tal:content="context/date_last_edited/fmt:displaydate"/>)</a></tal:last-edit>:
171 </span>
172 <a tal:attributes="href comment/fmt:url">
173 <strong tal:condition="comment/display_title"