Merge lp:~cjohnston/launchpad/boardCommentActivity into lp:launchpad

Proposed by Chris Johnston
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 17029
Proposed branch: lp:~cjohnston/launchpad/boardCommentActivity
Merge into: lp:launchpad
Diff against target: 101 lines (+22/-19)
4 files modified
lib/lp/bugs/browser/bugcomment.py (+3/-4)
lib/lp/bugs/doc/bugcomment.txt (+5/-5)
lib/lp/bugs/interfaces/bugmessage.py (+3/-1)
lib/lp/bugs/templates/bugcomment-box.pt (+11/-9)
To merge this branch: bzr merge lp:~cjohnston/launchpad/boardCommentActivity
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+221430@code.launchpad.net

Commit message

Move bug activities out of boardCommentFooter into boardCommentActivity

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugcomment.py'
--- lib/lp/bugs/browser/bugcomment.py 2012-07-11 22:21:24 +0000
+++ lib/lp/bugs/browser/bugcomment.py 2014-05-29 16:26:56 +0000
@@ -273,12 +273,11 @@
273 return canonical_url(self, view_name='+download')273 return canonical_url(self, view_name='+download')
274274
275 @property275 @property
276 def show_footer(self):276 def show_activity(self):
277 """Return True if the footer should be shown for this comment."""277 """Return True if the activity should be shown for this comment."""
278 return bool(278 return bool(
279 len(self.activity) > 0 or279 len(self.activity) > 0 or
280 self.bugwatch or280 self.bugwatch)
281 self.show_spam_controls)
282281
283282
284class BugCommentView(LaunchpadView):283class BugCommentView(LaunchpadView):
285284
=== modified file 'lib/lp/bugs/doc/bugcomment.txt'
--- lib/lp/bugs/doc/bugcomment.txt 2012-10-10 03:12:08 +0000
+++ lib/lp/bugs/doc/bugcomment.txt 2014-05-29 16:26:56 +0000
@@ -358,21 +358,21 @@
358 status: New → Confirmed358 status: New → Confirmed
359359
360The activity will be inserted into the footer of the comment. If a360The activity will be inserted into the footer of the comment. If a
361BugComment has some activity associated with it, it's show_footer361BugComment has some activity associated with it, it's show_activity
362property will be True.362property will be True.
363363
364 >>> bug_comment.show_footer364 >>> bug_comment.show_activity
365 True365 True
366366
367 >>> bug_comment.activity = []367 >>> bug_comment.activity = []
368 >>> bug_comment.show_footer368 >>> bug_comment.show_activity
369 False369 False
370370
371BugComment.show_footer will also be True if a BugWatch is associated371BugComment.show_activity will also be True if a BugWatch is associated
372with the comment.372with the comment.
373373
374 >>> bug_comment.bugwatch = factory.makeBugWatch()374 >>> bug_comment.bugwatch = factory.makeBugWatch()
375 >>> bug_comment.show_footer375 >>> bug_comment.show_activity
376 True376 True
377377
378378
379379
=== modified file 'lib/lp/bugs/interfaces/bugmessage.py'
--- lib/lp/bugs/interfaces/bugmessage.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/interfaces/bugmessage.py 2014-05-29 16:26:56 +0000
@@ -132,7 +132,9 @@
132 'The URL for submitting replies to this comment.')132 'The URL for submitting replies to this comment.')
133 activity = Attribute(133 activity = Attribute(
134 "A list of BugActivityItems associated with this comment.")134 "A list of BugActivityItems associated with this comment.")
135 show_footer = Attribute(135 show_activity = Attribute(
136 "Whether or not to show an activity for the comment.")
137 show_spam_controls = Attribute(
136 "Whether or not to show a footer for the comment.")138 "Whether or not to show a footer for the comment.")
137 patches = Attribute(139 patches = Attribute(
138 "Patches attched to this comment.")140 "Patches attched to this comment.")
139141
=== modified file 'lib/lp/bugs/templates/bugcomment-box.pt'
--- lib/lp/bugs/templates/bugcomment-box.pt 2014-05-28 20:38:48 +0000
+++ lib/lp/bugs/templates/bugcomment-box.pt 2014-05-29 16:26:56 +0000
@@ -93,15 +93,7 @@
93 replace="structure comment/@@+comment-body-text" />93 replace="structure comment/@@+comment-body-text" />
94 </div>94 </div>
9595
96 <div class="boardCommentFooter" tal:condition="comment/show_footer">96 <div class="boardCommentActivity" tal:condition="comment/show_activity">
97 <a tal:attributes="id string:mark-spam-${context/index};"
98 tal:condition="view/show_spam_controls"
99 class="js-action mark-spam" href="#">
100 <tal:not-spam condition="not: context/visible"
101 >Unhide</tal:not-spam>
102 <tal:spam condition="context/visible"
103 >Hide</tal:spam>
104 </a>
105 <tal:activity97 <tal:activity
106 define="activity_list comment/activity"98 define="activity_list comment/activity"
107 condition="comment/activity">99 condition="comment/activity">
@@ -159,4 +151,14 @@
159 </div>151 </div>
160 </tal:bugwatch-footer>152 </tal:bugwatch-footer>
161 </div>153 </div>
154 <div class="boardCommentFooter" tal:condition="comment/show_spam_controls">
155 <a tal:attributes="id string:mark-spam-${context/index};"
156 tal:condition="view/show_spam_controls"
157 class="js-action mark-spam" href="#">
158 <tal:not-spam condition="not: context/visible"
159 >Unhide</tal:not-spam>
160 <tal:spam condition="context/visible"
161 >Hide</tal:spam>
162 </a>
163 </div>
162</div>164</div>