~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/project.py

  • Committer: Julian Edwards
  • Date: 2011-07-28 20:46:18 UTC
  • mfrom: (13553 devel)
  • mto: This revision was merged to the branch mainline in revision 13555.
  • Revision ID: julian.edwards@canonical.com-20110728204618-tivj2wx2oa9s32bx
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Project-related View Classes"""
43
43
from zope.schema import Choice
44
44
 
45
45
from canonical.launchpad import _
46
 
from lp.services.feeds.browser import FeedsMixin
 
46
from canonical.launchpad.browser.feeds import FeedsMixin
47
47
from canonical.launchpad.webapp import (
48
48
    ApplicationMenu,
49
49
    canonical_url,
70
70
    LaunchpadEditFormView,
71
71
    LaunchpadFormView,
72
72
    )
73
 
from lp.app.browser.lazrjs import InlinePersonEditPickerWidget
74
 
from lp.app.browser.tales import format_link
75
73
from lp.app.errors import NotFoundError
76
74
from lp.blueprints.browser.specificationtarget import (
77
75
    HasSpecificationsMenuMixin,
78
76
    )
79
 
from lp.bugs.browser.structuralsubscription import (
80
 
    expose_structural_subscription_data_to_js,
81
 
    StructuralSubscriptionMenuMixin,
82
 
    StructuralSubscriptionTargetTraversalMixin,
83
 
    )
84
77
from lp.registry.browser import (
85
78
    add_subscribe_link,
86
79
    BaseRdfView,
97
90
    ProjectAddStepOne,
98
91
    ProjectAddStepTwo,
99
92
    )
 
93
from lp.bugs.browser.structuralsubscription import (
 
94
    expose_structural_subscription_data_to_js,
 
95
    StructuralSubscriptionMenuMixin,
 
96
    StructuralSubscriptionTargetTraversalMixin,
 
97
    )
100
98
from lp.registry.interfaces.product import IProductSet
101
99
from lp.registry.interfaces.projectgroup import (
102
100
    IProjectGroup,
348
346
 
349
347
 
350
348
class ProjectView(HasAnnouncementsView, FeedsMixin):
351
 
 
352
349
    implements(IProjectGroupActionMenu)
353
350
 
354
 
    @property
355
 
    def maintainer_widget(self):
356
 
        return InlinePersonEditPickerWidget(
357
 
            self.context, IProjectGroup['owner'],
358
 
            format_link(self.context.owner, empty_value="Not yet selected"),
359
 
            header='Change maintainer', edit_view='+reassign',
360
 
            step_title='Select a new maintainer',
361
 
            null_display_value="Not yet selected")
362
 
 
363
 
    @property
364
 
    def driver_widget(self):
365
 
        return InlinePersonEditPickerWidget(
366
 
            self.context, IProjectGroup['driver'],
367
 
            format_link(self.context.driver, empty_value="Not yet selected"),
368
 
            header='Change driver', edit_view='+driver',
369
 
            step_title='Select a new driver',
370
 
            null_display_value="Not yet selected",
371
 
            help_link="/+help-registry/driver.html")
372
 
 
373
351
    def initialize(self):
374
352
        super(ProjectView, self).initialize()
375
353
        expose_structural_subscription_data_to_js(
376
354
            self.context, self.request, self.user)
377
355
 
378
 
    @property
379
 
    def page_title(self):
380
 
        return '%s in Launchpad' % self.context.displayname
381
 
 
382
356
    @cachedproperty
383
357
    def has_many_projects(self):
384
358
        """Does the projectgroup have many sub projects.