Guilherme Salgado wrote: > Review: Approve > Hi Michael, > > Your changes look good. I have a few suggestions and I'd like somebody > else to review the JS changes, as I don't feel comfortable doing so. > Great, thanks Salgado. > review approve > >> === modified file 'lib/lp/soyuz/browser/archivesubscription.py' >> --- lib/lp/soyuz/browser/archivesubscription.py 2009-08-12 08:40:41 +0000 >> +++ lib/lp/soyuz/browser/archivesubscription.py 2009-09-14 08:08:51 +0000 >> @@ -9,6 +9,8 @@ >> >> __all__ = [ >> 'ArchiveSubscribersView', >> + 'PersonalArchiveSubscriptionBreadcrumb', >> + 'PersonArchiveSubscriptionView', >> 'PersonArchiveSubscriptionsView', >> 'traverse_archive_subscription_for_subscriber' >> ] >> @@ -34,10 +36,11 @@ >> IArchiveAuthTokenSet) >> from lp.soyuz.interfaces.archivesubscriber import ( >> IArchiveSubscriberSet, IPersonalArchiveSubscription) >> +from canonical.launchpad.webapp.breadcrumb import Breadcrumb >> from canonical.launchpad.webapp.launchpadform import ( >> action, custom_widget, LaunchpadFormView, LaunchpadEditFormView) >> from canonical.launchpad.webapp.publisher import ( >> - canonical_url, LaunchpadView) >> + canonical_url, LaunchpadView, Navigation) >> from canonical.widgets import DateWidget >> from canonical.widgets.popup import PersonPickerWidget >> >> @@ -65,6 +68,20 @@ >> """See `IPersonalArchiveSubscription`.""" >> return "Access to %s" % self.archive.displayname >> >> + @property >> + def title(self): > > I know of page_title and label, which are used for this purpose, did you mean > one of them or am I not aware of this third one? No, the helper class to which this belongs (PersonalArchiveSubscription) is used as the context for these views, and so like normal content classes, it needs a title attribute for when the base template tries to access context.title. > >> + """Required for default headings in templates.""" >> + return self.displayname >> + >> + >> +class PersonalArchiveSubscriptionNavigation(Navigation): >> + """Navigation for `IPersonalArchiveSubscription`. >> + >> + Without this, a breadcrumb will not be created for personal >> + archive subscription objects. > > This is no longer needed, actually -- a fix for the bug (423898) is included > in my breadcrumbs branch that is on PQM now. Great, removed. > >> + """ >> + usedfor = IPersonalArchiveSubscription >> + >> def traverse_archive_subscription_for_subscriber(subscriber, archive_id): >> """Return the subscription for a subscriber to an archive.""" >> subscription = None >> @@ -79,6 +96,14 @@ >> return PersonalArchiveSubscription(subscriber, archive) >> >> >> +class PersonalArchiveSubscriptionBreadcrumb(Breadcrumb): >> + """Builds a breadcrumb for `PersonalArchiveSubscription`.""" >> + >> + @property >> + def text(self): >> + return self.context.displayname > > You can use webapp.breadcrumbs.DisplaynameBreadcrumb in the zcml and get rid > of this adapter altogether. It'd be great if you could do a quick check for > other places where that generic adapter could replace other specific ones. :) Done - there was only one other that I could replace in the soyuz/configure with a generic breadcrumb. Thanks! > >> + >> + >> class IArchiveSubscriberUI(Interface): >> """A custom interface for user interaction with archive subscriptions. >> >> === modified file 'lib/lp/soyuz/browser/tests/test_breadcrumbs.py' >> --- lib/lp/soyuz/browser/tests/test_breadcrumbs.py 2009-09-02 16:32:06 +0000 >> +++ lib/lp/soyuz/browser/tests/test_breadcrumbs.py 2009-09-11 10:52:54 +0000 >> @@ -11,6 +11,8 @@ >> from canonical.launchpad.webapp.tests.breadcrumbs import ( >> BaseBreadcrumbTestCase) >> from lp.registry.interfaces.distribution import IDistributionSet >> +from lp.soyuz.browser.archivesubscription import PersonalArchiveSubscription >> +from lp.testing import login, login_person >> >> >> class TestDistroArchSeriesBreadcrumb(BaseBreadcrumbTestCase): >> @@ -55,5 +57,38 @@ >> self.assertEquals(texts[-1], "0.1-1") >> >> >> +class TestArchiveSubscriptionBreadcrumb(BaseBreadcrumbTestCase): >> + >> + def setUp(self): >> + super(TestArchiveSubscriptionBreadcrumb, self).setUp() >> + >> + # Create a private ppa >> + self.ppa = self.factory.makeArchive() >> + login('