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
1=== modified file 'lib/lp/bugs/browser/bugsubscription.py'
2--- lib/lp/bugs/browser/bugsubscription.py 2011-02-04 01:15:13 +0000
3+++ lib/lp/bugs/browser/bugsubscription.py 2011-02-11 12:45:46 +0000
4@@ -9,6 +9,7 @@
5 'BugPortletDuplicateSubcribersContents',
6 'BugPortletSubcribersContents',
7 'BugSubscriptionAddView',
8+ 'BugSubscriptionListView',
9 ]
10
11 import cgi
12@@ -542,3 +543,14 @@
13 @property
14 def css_name(self):
15 return 'subscriber-%s' % self.subscription.person.id
16+
17+
18+class BugSubscriptionListView(LaunchpadView):
19+ """A view to show all a person's subscriptions to a bug."""
20+
21+ @property
22+ def label(self):
23+ return "%s's subscriptions to bug %d" % (
24+ self.user.displayname, self.context.bug.id)
25+
26+ page_title = label
27
28=== modified file 'lib/lp/bugs/browser/configure.zcml'
29--- lib/lp/bugs/browser/configure.zcml 2011-02-04 06:30:13 +0000
30+++ lib/lp/bugs/browser/configure.zcml 2011-02-11 12:45:46 +0000
31@@ -724,6 +724,12 @@
32 template="../templates/bug-remove-question.pt"/>
33 <browser:page
34 for="lp.bugs.interfaces.bugtask.IBugTask"
35+ name="+subscriptions"
36+ class="lp.bugs.browser.bugsubscription.BugSubscriptionListView"
37+ permission="launchpad.AnyPerson"
38+ template="../templates/bug-subscription-list.pt"/>
39+ <browser:page
40+ for="lp.bugs.interfaces.bugtask.IBugTask"
41 name="+subscribe"
42 class="lp.bugs.browser.bugsubscription.BugSubscriptionSubscribeSelfView"
43 permission="launchpad.AnyPerson"
44
45=== modified file 'lib/lp/bugs/browser/tests/test_bugsubscription_views.py'
46--- lib/lp/bugs/browser/tests/test_bugsubscription_views.py 2011-02-04 01:15:13 +0000
47+++ lib/lp/bugs/browser/tests/test_bugsubscription_views.py 2011-02-11 12:45:46 +0000
48@@ -266,3 +266,14 @@
49 self.assertEqual(
50 harness.request.response.getHeader('content-type'),
51 'application/json')
52+
53+
54+class BugSubscriptionsListViewTestCase(TestCaseWithFactory):
55+ """Tests for the BugSubscriptionsListView."""
56+
57+ layer = LaunchpadFunctionalLayer
58+
59+ def setUp(self):
60+ super(BugSubscriptionsListViewTestCase, self).setUp()
61+ self.bug = self.factory.makeBug()
62+ self.subscriber = self.factory.makePerson()
63
64=== added file 'lib/lp/bugs/templates/bug-subscription-list.pt'
65--- lib/lp/bugs/templates/bug-subscription-list.pt 1970-01-01 00:00:00 +0000
66+++ lib/lp/bugs/templates/bug-subscription-list.pt 2011-02-11 12:45:46 +0000
67@@ -0,0 +1,25 @@
68+<html
69+ xmlns="http://www.w3.org/1999/xhtml"
70+ xmlns:tal="http://xml.zope.org/namespaces/tal"
71+ xmlns:metal="http://xml.zope.org/namespaces/metal"
72+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
73+ xml:lang="en"
74+ lang="en"
75+ dir="ltr"
76+ metal:use-macro="view/macro:page/main_only"
77+ i18n:domain="malone"
78+>
79+
80+<body>
81+ <div metal:fill-slot="main">
82+
83+ <div id="maincontent">
84+ <div id="nonportlets" class="readable">
85+
86+ </div>
87+ </div>
88+
89+ </div>
90+
91+</body>
92+</html>