Merge lp:~gmb/launchpad/add-+subscriptions-page-bug-715802 into lp:launchpad

Proposed by Graham Binns
Status: Merged
Merged at revision: 12382
Proposed branch: lp:~gmb/launchpad/add-+subscriptions-page-bug-715802
Merge into: lp:launchpad
Diff against target: 92 lines (+54/-0)
4 files modified
lib/lp/bugs/browser/bugsubscription.py (+12/-0)
lib/lp/bugs/browser/configure.zcml (+6/-0)
lib/lp/bugs/browser/tests/test_bugsubscription_views.py (+11/-0)
lib/lp/bugs/templates/bug-subscription-list.pt (+25/-0)
To merge this branch: bzr merge lp:~gmb/launchpad/add-+subscriptions-page-bug-715802
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+49385@code.launchpad.net

Commit message

[r=adeuring][ui=none] [r=adeuring][bug=715802] Add a vestigial page for the new Bug:+subscriptions view.

Description of the change

This branch adds a vestigial page for the new Bug:+subscriptions view. It will be fully populated in subsequent branches once user testing has been completed.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
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/bugsubscription.py'
--- lib/lp/bugs/browser/bugsubscription.py 2011-02-04 01:15:13 +0000
+++ lib/lp/bugs/browser/bugsubscription.py 2011-02-11 12:45:46 +0000
@@ -9,6 +9,7 @@
9 'BugPortletDuplicateSubcribersContents',9 'BugPortletDuplicateSubcribersContents',
10 'BugPortletSubcribersContents',10 'BugPortletSubcribersContents',
11 'BugSubscriptionAddView',11 'BugSubscriptionAddView',
12 'BugSubscriptionListView',
12 ]13 ]
1314
14import cgi15import cgi
@@ -542,3 +543,14 @@
542 @property543 @property
543 def css_name(self):544 def css_name(self):
544 return 'subscriber-%s' % self.subscription.person.id545 return 'subscriber-%s' % self.subscription.person.id
546
547
548class BugSubscriptionListView(LaunchpadView):
549 """A view to show all a person's subscriptions to a bug."""
550
551 @property
552 def label(self):
553 return "%s's subscriptions to bug %d" % (
554 self.user.displayname, self.context.bug.id)
555
556 page_title = label
545557
=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml 2011-02-04 06:30:13 +0000
+++ lib/lp/bugs/browser/configure.zcml 2011-02-11 12:45:46 +0000
@@ -724,6 +724,12 @@
724 template="../templates/bug-remove-question.pt"/>724 template="../templates/bug-remove-question.pt"/>
725 <browser:page725 <browser:page
726 for="lp.bugs.interfaces.bugtask.IBugTask"726 for="lp.bugs.interfaces.bugtask.IBugTask"
727 name="+subscriptions"
728 class="lp.bugs.browser.bugsubscription.BugSubscriptionListView"
729 permission="launchpad.AnyPerson"
730 template="../templates/bug-subscription-list.pt"/>
731 <browser:page
732 for="lp.bugs.interfaces.bugtask.IBugTask"
727 name="+subscribe"733 name="+subscribe"
728 class="lp.bugs.browser.bugsubscription.BugSubscriptionSubscribeSelfView"734 class="lp.bugs.browser.bugsubscription.BugSubscriptionSubscribeSelfView"
729 permission="launchpad.AnyPerson"735 permission="launchpad.AnyPerson"
730736
=== modified file 'lib/lp/bugs/browser/tests/test_bugsubscription_views.py'
--- lib/lp/bugs/browser/tests/test_bugsubscription_views.py 2011-02-04 01:15:13 +0000
+++ lib/lp/bugs/browser/tests/test_bugsubscription_views.py 2011-02-11 12:45:46 +0000
@@ -266,3 +266,14 @@
266 self.assertEqual(266 self.assertEqual(
267 harness.request.response.getHeader('content-type'),267 harness.request.response.getHeader('content-type'),
268 'application/json')268 'application/json')
269
270
271class BugSubscriptionsListViewTestCase(TestCaseWithFactory):
272 """Tests for the BugSubscriptionsListView."""
273
274 layer = LaunchpadFunctionalLayer
275
276 def setUp(self):
277 super(BugSubscriptionsListViewTestCase, self).setUp()
278 self.bug = self.factory.makeBug()
279 self.subscriber = self.factory.makePerson()
269280
=== added file 'lib/lp/bugs/templates/bug-subscription-list.pt'
--- lib/lp/bugs/templates/bug-subscription-list.pt 1970-01-01 00:00:00 +0000
+++ lib/lp/bugs/templates/bug-subscription-list.pt 2011-02-11 12:45:46 +0000
@@ -0,0 +1,25 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/main_only"
10 i18n:domain="malone"
11>
12
13<body>
14 <div metal:fill-slot="main">
15
16 <div id="maincontent">
17 <div id="nonportlets" class="readable">
18
19 </div>
20 </div>
21
22 </div>
23
24</body>
25</html>