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
1=== modified file 'lib/lp/bugs/browser/bugcomment.py'
2--- lib/lp/bugs/browser/bugcomment.py 2012-07-11 22:21:24 +0000
3+++ lib/lp/bugs/browser/bugcomment.py 2014-05-29 16:26:56 +0000
4@@ -273,12 +273,11 @@
5 return canonical_url(self, view_name='+download')
6
7 @property
8- def show_footer(self):
9- """Return True if the footer should be shown for this comment."""
10+ def show_activity(self):
11+ """Return True if the activity should be shown for this comment."""
12 return bool(
13 len(self.activity) > 0 or
14- self.bugwatch or
15- self.show_spam_controls)
16+ self.bugwatch)
17
18
19 class BugCommentView(LaunchpadView):
20
21=== modified file 'lib/lp/bugs/doc/bugcomment.txt'
22--- lib/lp/bugs/doc/bugcomment.txt 2012-10-10 03:12:08 +0000
23+++ lib/lp/bugs/doc/bugcomment.txt 2014-05-29 16:26:56 +0000
24@@ -358,21 +358,21 @@
25 status: New → Confirmed
26
27 The activity will be inserted into the footer of the comment. If a
28-BugComment has some activity associated with it, it's show_footer
29+BugComment has some activity associated with it, it's show_activity
30 property will be True.
31
32- >>> bug_comment.show_footer
33+ >>> bug_comment.show_activity
34 True
35
36 >>> bug_comment.activity = []
37- >>> bug_comment.show_footer
38+ >>> bug_comment.show_activity
39 False
40
41-BugComment.show_footer will also be True if a BugWatch is associated
42+BugComment.show_activity will also be True if a BugWatch is associated
43 with the comment.
44
45 >>> bug_comment.bugwatch = factory.makeBugWatch()
46- >>> bug_comment.show_footer
47+ >>> bug_comment.show_activity
48 True
49
50
51
52=== modified file 'lib/lp/bugs/interfaces/bugmessage.py'
53--- lib/lp/bugs/interfaces/bugmessage.py 2013-01-07 02:40:55 +0000
54+++ lib/lp/bugs/interfaces/bugmessage.py 2014-05-29 16:26:56 +0000
55@@ -132,7 +132,9 @@
56 'The URL for submitting replies to this comment.')
57 activity = Attribute(
58 "A list of BugActivityItems associated with this comment.")
59- show_footer = Attribute(
60+ show_activity = Attribute(
61+ "Whether or not to show an activity for the comment.")
62+ show_spam_controls = Attribute(
63 "Whether or not to show a footer for the comment.")
64 patches = Attribute(
65 "Patches attched to this comment.")
66
67=== modified file 'lib/lp/bugs/templates/bugcomment-box.pt'
68--- lib/lp/bugs/templates/bugcomment-box.pt 2014-05-28 20:38:48 +0000
69+++ lib/lp/bugs/templates/bugcomment-box.pt 2014-05-29 16:26:56 +0000
70@@ -93,15 +93,7 @@
71 replace="structure comment/@@+comment-body-text" />
72 </div>
73
74- <div class="boardCommentFooter" tal:condition="comment/show_footer">
75- <a tal:attributes="id string:mark-spam-${context/index};"
76- tal:condition="view/show_spam_controls"
77- class="js-action mark-spam" href="#">
78- <tal:not-spam condition="not: context/visible"
79- >Unhide</tal:not-spam>
80- <tal:spam condition="context/visible"
81- >Hide</tal:spam>
82- </a>
83+ <div class="boardCommentActivity" tal:condition="comment/show_activity">
84 <tal:activity
85 define="activity_list comment/activity"
86 condition="comment/activity">
87@@ -159,4 +151,14 @@
88 </div>
89 </tal:bugwatch-footer>
90 </div>
91+ <div class="boardCommentFooter" tal:condition="comment/show_spam_controls">
92+ <a tal:attributes="id string:mark-spam-${context/index};"
93+ tal:condition="view/show_spam_controls"
94+ class="js-action mark-spam" href="#">
95+ <tal:not-spam condition="not: context/visible"
96+ >Unhide</tal:not-spam>
97+ <tal:spam condition="context/visible"
98+ >Hide</tal:spam>
99+ </a>
100+ </div>
101 </div>