~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/bugtask.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-07-17 01:36:13 UTC
  • mfrom: (11118.3.7 delete-unused-0)
  • Revision ID: launchpad@pqm.canonical.com-20100717013613-83swqs1b4046fjpw
[r=bac][ui=none][bug 241631,
        605084] Delete unused images and support code from Lp 1.0 and 2.0.
        Delete delete StructuralObject*. Delete unused pagetitles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    'BugTaskPortletView',
26
26
    'BugTaskPrivacyAdapter',
27
27
    'BugTaskRemoveQuestionView',
28
 
    'BugTaskSOP',
29
28
    'BugTaskSearchListingView',
30
29
    'BugTaskSetNavigation',
31
30
    'BugTaskStatusView',
123
122
    IDistributionSourcePackage)
124
123
from lp.registry.interfaces.distroseries import IDistroSeries
125
124
from canonical.launchpad.interfaces.launchpad import (
126
 
    ILaunchpadCelebrities, IStructuralObjectPresentation)
 
125
    ILaunchpadCelebrities)
127
126
from lp.registry.interfaces.person import IPerson, IPersonSet
128
127
from lp.registry.interfaces.product import IProduct
129
128
from lp.registry.interfaces.productseries import IProductSeries
144
143
from canonical.launchpad.browser.feeds import (
145
144
    BugTargetLatestBugsFeedLink, FeedsMixin)
146
145
from lp.registry.browser.mentoringoffer import CanBeMentoredView
147
 
from canonical.launchpad.browser.launchpad import StructuralObjectPresentation
148
146
 
149
147
from canonical.launchpad.webapp.authorization import check_permission
150
148
from canonical.launchpad.webapp.batching import TableBatchNavigator
543
541
 
544
542
    @property
545
543
    def page_title(self):
546
 
        return smartquote('%s: "%s"') % (
547
 
            IStructuralObjectPresentation(self.context).getMainHeading(),
548
 
            self.context.bug.title)
 
544
        bugtask = self.context
 
545
        if INullBugTask.providedBy(bugtask):
 
546
            heading = 'Bug #%s is not in %s' % (
 
547
                bugtask.bug.id, bugtask.bugtargetdisplayname)
 
548
        else:
 
549
            heading = 'Bug #%s in %s' % (
 
550
                bugtask.bug.id, bugtask.bugtargetdisplayname)
 
551
        return smartquote('%s: "%s"') % (heading, self.context.bug.title)
549
552
 
550
553
    def initialize(self):
551
554
        """Set up the needed widgets."""
1317
1320
        if self.user_is_subscribed is None:
1318
1321
            self.user_is_subscribed = self.context.bug.isSubscribed(self.user)
1319
1322
 
 
1323
    page_title = 'Edit status'
1320
1324
 
1321
1325
    @cachedproperty
1322
1326
    def field_names(self):
1780
1784
class BugTaskStatusView(LaunchpadView):
1781
1785
    """Viewing the status of a bug task."""
1782
1786
 
 
1787
    page_title = 'View status'
 
1788
 
1783
1789
    def initialize(self):
1784
1790
        """Set up the appropriate widgets.
1785
1791
 
3653
3659
        return self.context.bug.private
3654
3660
 
3655
3661
 
3656
 
# XXX mars 2008-08-25 bug=261188
3657
 
# This whole class hierarchy should be replaced with something more
3658
 
# specific, ie. a class that generates BugTask page titles.
3659
 
class BugTaskSOP(StructuralObjectPresentation):
3660
 
    """Provides the structural heading for `IBugTask`."""
3661
 
 
3662
 
    def getIntroHeading(self):
3663
 
        """Return None."""
3664
 
        return None
3665
 
 
3666
 
    def getMainHeading(self):
3667
 
        """Return the heading using the BugTask."""
3668
 
        bugtask = self.context
3669
 
        if INullBugTask.providedBy(bugtask):
3670
 
            return 'Bug #%s is not in %s' % (
3671
 
                bugtask.bug.id, bugtask.bugtargetdisplayname)
3672
 
        else:
3673
 
            return 'Bug #%s in %s' % (
3674
 
                bugtask.bug.id, bugtask.bugtargetdisplayname)
3675
 
 
3676
 
    def listChildren(self, num):
3677
 
        """Return an empty list."""
3678
 
        return []
3679
 
 
3680
 
    def listAltChildren(self, num):
3681
 
        """Return None."""
3682
 
        return None
3683
 
 
3684
 
 
3685
3662
class BugTaskCreateQuestionView(LaunchpadFormView):
3686
3663
    """View for creating a question from a bug."""
3687
3664
    schema = ICreateQuestionFromBugTaskForm