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).
4
4
"""Project-related View Classes"""
43
43
from zope.schema import Choice
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 (
70
70
LaunchpadEditFormView,
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,
79
from lp.bugs.browser.structuralsubscription import (
80
expose_structural_subscription_data_to_js,
81
StructuralSubscriptionMenuMixin,
82
StructuralSubscriptionTargetTraversalMixin,
84
77
from lp.registry.browser import (
85
78
add_subscribe_link,
93
from lp.bugs.browser.structuralsubscription import (
94
expose_structural_subscription_data_to_js,
95
StructuralSubscriptionMenuMixin,
96
StructuralSubscriptionTargetTraversalMixin,
100
98
from lp.registry.interfaces.product import IProductSet
101
99
from lp.registry.interfaces.projectgroup import (
350
348
class ProjectView(HasAnnouncementsView, FeedsMixin):
352
349
implements(IProjectGroupActionMenu)
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")
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")
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)
379
def page_title(self):
380
return '%s in Launchpad' % self.context.displayname
383
357
def has_many_projects(self):
384
358
"""Does the projectgroup have many sub projects.