Merge lp:~wgrant/launchpad/kill-excessive-facets into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 16942
Proposed branch: lp:~wgrant/launchpad/kill-excessive-facets
Merge into: lp:launchpad
Diff against target: 499 lines (+10/-180)
16 files modified
lib/lp/blueprints/browser/configure.zcml (+0/-1)
lib/lp/blueprints/browser/sprint.py (+0/-8)
lib/lp/bugs/browser/bug.py (+4/-2)
lib/lp/buildmaster/browser/builder.py (+0/-17)
lib/lp/buildmaster/browser/configure.zcml (+2/-6)
lib/lp/registry/browser/configure.zcml (+0/-2)
lib/lp/registry/browser/distribution.py (+0/-8)
lib/lp/registry/browser/product.py (+0/-9)
lib/lp/services/statistics/browser/launchpadstatistic.py (+1/-16)
lib/lp/soyuz/browser/build.py (+0/-9)
lib/lp/soyuz/browser/configure.zcml (+0/-4)
lib/lp/soyuz/browser/distroseriesbinarypackage.py (+0/-10)
lib/lp/translations/browser/configure.zcml (+3/-9)
lib/lp/translations/browser/pofile.py (+0/-9)
lib/lp/translations/browser/potemplate.py (+0/-61)
lib/lp/translations/browser/translationmessage.py (+0/-9)
To merge this branch: bzr merge lp:~wgrant/launchpad/kill-excessive-facets
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+208265@code.launchpad.net

Commit message

Drop pointless facet menu overrides -- they should mostly only exist on structural objects nowadays, so subordinate objects fall back to the object named in the watermark title.

Description of the change

Drop pointless facet menu overrides -- they should mostly only exist on structural objects nowadays, so subordinate objects fall back to the object named in the watermark title. This fixes various bugs about erroneously disabled tabs (eg. for Builder, BuilderSet, ProductSet), and removes a lot of useless code (eg. POTemplateFacets and the other translations bits were deleted with no functional change whatsoever).

The only modification to existing working functionality is that ProductSet's Code facet link no longer links to the project cloud, but rather to the global Code homepage. There was a bug filed about that inconsistency, so this seems like a net improvement.

The remaining IFacetMenus after this branch are StandardLaunchpadFacets, LaunchpadRootFacets, DistributionFacets, DistroSeriesFacets, DistributionSourcePackageFacets, SourcePackageFacets, PersonFacets, PersonProductFacets, ProductFacets, ProductSeriesFacets, SprintFacets and BugFacets. They're all structural objects except for PersonProduct, Sprint and Bug, but the first two are justified by how special they are, and Bug is necessary because it has no parent context without a BugTask (bug #182281).

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/blueprints/browser/configure.zcml'
--- lib/lp/blueprints/browser/configure.zcml 2014-02-19 00:35:25 +0000
+++ lib/lp/blueprints/browser/configure.zcml 2014-02-26 03:55:49 +0000
@@ -182,7 +182,6 @@
182 classes="182 classes="
183 SprintFacets183 SprintFacets
184 SprintOverviewMenu184 SprintOverviewMenu
185 SprintSetFacets
186 SprintSetNavigationMenu185 SprintSetNavigationMenu
187 SprintSpecificationsMenu186 SprintSpecificationsMenu
188 "187 "
189188
=== modified file 'lib/lp/blueprints/browser/sprint.py'
--- lib/lp/blueprints/browser/sprint.py 2013-04-16 01:18:10 +0000
+++ lib/lp/blueprints/browser/sprint.py 2014-02-26 03:55:49 +0000
@@ -15,7 +15,6 @@
15 'SprintNavigation',15 'SprintNavigation',
16 'SprintOverviewMenu',16 'SprintOverviewMenu',
17 'SprintSetBreadcrumb',17 'SprintSetBreadcrumb',
18 'SprintSetFacets',
19 'SprintSetNavigation',18 'SprintSetNavigation',
20 'SprintSetView',19 'SprintSetView',
21 'SprintSpecificationsMenu',20 'SprintSpecificationsMenu',
@@ -157,13 +156,6 @@
157 text = 'Meetings'156 text = 'Meetings'
158157
159158
160class SprintSetFacets(StandardLaunchpadFacets):
161 """The facet menu for an ISprintSet."""
162
163 usedfor = ISprintSet
164 enable_only = ['overview', ]
165
166
167class HasSprintsView(LaunchpadView):159class HasSprintsView(LaunchpadView):
168160
169 page_title = 'Events'161 page_title = 'Events'
170162
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2013-10-14 05:27:40 +0000
+++ lib/lp/bugs/browser/bug.py 2014-02-26 03:55:49 +0000
@@ -200,8 +200,10 @@
200class BugFacets(StandardLaunchpadFacets):200class BugFacets(StandardLaunchpadFacets):
201 """The links that will appear in the facet menu for an `IBug`.201 """The links that will appear in the facet menu for an `IBug`.
202202
203 However, we never show this, but it does apply to things like203 This is rarely seen, as most bug views are actually on BugTask. But
204 bug nominations, by 'acquisition'.204 it's inherited by views on objects subordinate to the Bug itself,
205 eg. nominations and attachments, where we don't have a pillar
206 context to switch within.
205 """207 """
206208
207 usedfor = IBug209 usedfor = IBug
208210
=== modified file 'lib/lp/buildmaster/browser/builder.py'
--- lib/lp/buildmaster/browser/builder.py 2013-12-03 09:52:27 +0000
+++ lib/lp/buildmaster/browser/builder.py 2014-02-26 03:55:49 +0000
@@ -6,12 +6,10 @@
6__metaclass__ = type6__metaclass__ = type
77
8__all__ = [8__all__ = [
9 'BuilderFacets',
10 'BuilderOverviewMenu',9 'BuilderOverviewMenu',
11 'BuilderNavigation',10 'BuilderNavigation',
12 'BuilderSetAddView',11 'BuilderSetAddView',
13 'BuilderSetBreadcrumb',12 'BuilderSetBreadcrumb',
14 'BuilderSetFacets',
15 'BuilderSetOverviewMenu',13 'BuilderSetOverviewMenu',
16 'BuilderSetNavigation',14 'BuilderSetNavigation',
17 'BuilderSetView',15 'BuilderSetView',
@@ -54,7 +52,6 @@
54 LaunchpadView,52 LaunchpadView,
55 Link,53 Link,
56 Navigation,54 Navigation,
57 StandardLaunchpadFacets,
58 stepthrough,55 stepthrough,
59 )56 )
60from lp.services.webapp.batching import StormRangeFactory57from lp.services.webapp.batching import StormRangeFactory
@@ -88,20 +85,6 @@
88 usedfor = IBuilder85 usedfor = IBuilder
8986
9087
91class BuilderSetFacets(StandardLaunchpadFacets):
92 """The links that will appear in the facet menu for an IBuilderSet."""
93 enable_only = ['overview']
94
95 usedfor = IBuilderSet
96
97
98class BuilderFacets(StandardLaunchpadFacets):
99 """The links that will appear in the facet menu for an IBuilder."""
100 enable_only = ['overview']
101
102 usedfor = IBuilder
103
104
105class BuilderSetOverviewMenu(ApplicationMenu):88class BuilderSetOverviewMenu(ApplicationMenu):
106 """Overview Menu for IBuilderSet."""89 """Overview Menu for IBuilderSet."""
107 usedfor = IBuilderSet90 usedfor = IBuilderSet
10891
=== modified file 'lib/lp/buildmaster/browser/configure.zcml'
--- lib/lp/buildmaster/browser/configure.zcml 2013-11-15 06:36:55 +0000
+++ lib/lp/buildmaster/browser/configure.zcml 2014-02-26 03:55:49 +0000
@@ -88,13 +88,9 @@
88 permission="launchpad.Edit"88 permission="launchpad.Edit"
89 template="../templates/builder-edit.pt"/>89 template="../templates/builder-edit.pt"/>
90 <browser:menus90 <browser:menus
91 classes="91 classes="BuilderSetOverviewMenu"
92 BuilderSetFacets
93 BuilderSetOverviewMenu"
94 module="lp.buildmaster.browser.builder"/>92 module="lp.buildmaster.browser.builder"/>
95 <browser:menus93 <browser:menus
96 classes="94 classes="BuilderOverviewMenu"
97 BuilderFacets
98 BuilderOverviewMenu"
99 module="lp.buildmaster.browser.builder"/>95 module="lp.buildmaster.browser.builder"/>
100</configure>96</configure>
10197
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2014-02-25 06:42:01 +0000
+++ lib/lp/registry/browser/configure.zcml 2014-02-26 03:55:49 +0000
@@ -1594,7 +1594,6 @@
1594 ProductFacets1594 ProductFacets
1595 ProductNavigationMenu1595 ProductNavigationMenu
1596 ProductOverviewMenu1596 ProductOverviewMenu
1597 ProductSetFacets
1598 ProductSetNavigationMenu1597 ProductSetNavigationMenu
1599 ProductSpecificationsMenu1598 ProductSpecificationsMenu
1600 "1599 "
@@ -1949,7 +1948,6 @@
1949 DistributionOverviewMenu1948 DistributionOverviewMenu
1950 DistributionSetActionNavigationMenu1949 DistributionSetActionNavigationMenu
1951 DistributionSetContextMenu1950 DistributionSetContextMenu
1952 DistributionSetFacets
1953 DistributionSpecificationsMenu1951 DistributionSpecificationsMenu
1954 "1952 "
1955 module="lp.registry.browser.distribution"/>1953 module="lp.registry.browser.distribution"/>
19561954
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2013-09-18 06:34:44 +0000
+++ lib/lp/registry/browser/distribution.py 2014-02-26 03:55:49 +0000
@@ -30,7 +30,6 @@
30 'DistributionSetActionNavigationMenu',30 'DistributionSetActionNavigationMenu',
31 'DistributionSetBreadcrumb',31 'DistributionSetBreadcrumb',
32 'DistributionSetContextMenu',32 'DistributionSetContextMenu',
33 'DistributionSetFacets',
34 'DistributionSetNavigation',33 'DistributionSetNavigation',
35 'DistributionSetView',34 'DistributionSetView',
36 'DistributionSpecificationsMenu',35 'DistributionSpecificationsMenu',
@@ -218,13 +217,6 @@
218 text = 'Distributions'217 text = 'Distributions'
219218
220219
221class DistributionSetFacets(StandardLaunchpadFacets):
222
223 usedfor = IDistributionSet
224
225 enable_only = ['overview', ]
226
227
228class DistributionSetContextMenu(ContextMenu):220class DistributionSetContextMenu(ContextMenu):
229221
230 usedfor = IDistributionSet222 usedfor = IDistributionSet
231223
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2013-04-10 08:35:47 +0000
+++ lib/lp/registry/browser/product.py 2014-02-26 03:55:49 +0000
@@ -31,7 +31,6 @@
31 'ProductReviewLicenseView',31 'ProductReviewLicenseView',
32 'ProductSeriesSetView',32 'ProductSeriesSetView',
33 'ProductSetBreadcrumb',33 'ProductSetBreadcrumb',
34 'ProductSetFacets',
35 'ProductSetNavigation',34 'ProductSetNavigation',
36 'ProductSetReviewLicensesView',35 'ProductSetReviewLicensesView',
37 'ProductSetView',36 'ProductSetView',
@@ -636,14 +635,6 @@
636 text = "Projects"635 text = "Projects"
637636
638637
639class ProductSetFacets(StandardLaunchpadFacets):
640 """The links that will appear in the facet menu for the IProductSet."""
641
642 usedfor = IProductSet
643
644 enable_only = ['overview', 'branches']
645
646
647class SortSeriesMixin:638class SortSeriesMixin:
648 """Provide access to helpers for series."""639 """Provide access to helpers for series."""
649640
650641
=== modified file 'lib/lp/services/statistics/browser/launchpadstatistic.py'
--- lib/lp/services/statistics/browser/launchpadstatistic.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/statistics/browser/launchpadstatistic.py 2014-02-26 03:55:49 +0000
@@ -7,24 +7,9 @@
77
8__all__ = [8__all__ = [
9 'LaunchpadStatisticSet',9 'LaunchpadStatisticSet',
10 'LaunchpadStatisticSetFacets',
11 ]10 ]
1211
13from lp.services.statistics.interfaces.statistic import ILaunchpadStatisticSet12from lp.services.webapp import LaunchpadView
14from lp.services.webapp import (
15 LaunchpadView,
16 StandardLaunchpadFacets,
17 )
18
19
20class LaunchpadStatisticSetFacets(StandardLaunchpadFacets):
21 """The links that will appear in the facet menu for the
22 ILaunchpadStatisticSet.
23 """
24
25 usedfor = ILaunchpadStatisticSet
26
27 enable_only = ['overview',]
2813
2914
30class LaunchpadStatisticSet(LaunchpadView):15class LaunchpadStatisticSet(LaunchpadView):
3116
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2013-11-26 01:44:28 +0000
+++ lib/lp/soyuz/browser/build.py 2014-02-26 03:55:49 +0000
@@ -69,7 +69,6 @@
69 GetitemNavigation,69 GetitemNavigation,
70 LaunchpadView,70 LaunchpadView,
71 Link,71 Link,
72 StandardLaunchpadFacets,
73 stepthrough,72 stepthrough,
74 )73 )
75from lp.services.webapp.authorization import check_permission74from lp.services.webapp.authorization import check_permission
@@ -151,14 +150,6 @@
151 return None150 return None
152151
153152
154class BuildFacets(StandardLaunchpadFacets):
155 """The links that will appear in the facet menu for an
156 IBinaryPackageBuild."""
157 enable_only = ['overview']
158
159 usedfor = IBinaryPackageBuild
160
161
162class BuildContextMenu(ContextMenu):153class BuildContextMenu(ContextMenu):
163 """Overview menu for build records """154 """Overview menu for build records """
164 usedfor = IBinaryPackageBuild155 usedfor = IBinaryPackageBuild
165156
=== modified file 'lib/lp/soyuz/browser/configure.zcml'
--- lib/lp/soyuz/browser/configure.zcml 2013-11-15 06:36:55 +0000
+++ lib/lp/soyuz/browser/configure.zcml 2014-02-26 03:55:49 +0000
@@ -500,10 +500,6 @@
500 name="+portlet-published"500 name="+portlet-published"
501 template="../templates/distroseriesbinarypackage-portlet-published.pt"/>501 template="../templates/distroseriesbinarypackage-portlet-published.pt"/>
502 </browser:pages>502 </browser:pages>
503 <browser:menus
504 classes="
505 DistroSeriesBinaryPackageFacets"
506 module="lp.soyuz.browser.distroseriesbinarypackage"/>
507503
508 <browser:defaultView504 <browser:defaultView
509 for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries"505 for="lp.soyuz.interfaces.distroarchseries.IDistroArchSeries"
510506
=== modified file 'lib/lp/soyuz/browser/distroseriesbinarypackage.py'
--- lib/lp/soyuz/browser/distroseriesbinarypackage.py 2011-12-24 17:49:30 +0000
+++ lib/lp/soyuz/browser/distroseriesbinarypackage.py 2014-02-26 03:55:49 +0000
@@ -5,7 +5,6 @@
55
6__all__ = [6__all__ = [
7 'DistroSeriesBinaryPackageBreadcrumb',7 'DistroSeriesBinaryPackageBreadcrumb',
8 'DistroSeriesBinaryPackageFacets',
9 'DistroSeriesBinaryPackageNavigation',8 'DistroSeriesBinaryPackageNavigation',
10 'DistroSeriesBinaryPackageView',9 'DistroSeriesBinaryPackageView',
11 ]10 ]
@@ -16,7 +15,6 @@
16 ApplicationMenu,15 ApplicationMenu,
17 LaunchpadView,16 LaunchpadView,
18 Navigation,17 Navigation,
19 StandardLaunchpadFacets,
20 )18 )
21from lp.services.webapp.breadcrumb import Breadcrumb19from lp.services.webapp.breadcrumb import Breadcrumb
22from lp.soyuz.interfaces.distroseriesbinarypackage import (20from lp.soyuz.interfaces.distroseriesbinarypackage import (
@@ -24,14 +22,6 @@
24 )22 )
2523
2624
27class DistroSeriesBinaryPackageFacets(StandardLaunchpadFacets):
28 # XXX mpt 2006-10-04: A DistroArchSeriesBinaryPackage is not a structural
29 # object. It should inherit all navigation from its distro series.
30
31 usedfor = IDistroSeriesBinaryPackage
32 enable_only = ['overview']
33
34
35class DistroSeriesBinaryPackageOverviewMenu(ApplicationMenu):25class DistroSeriesBinaryPackageOverviewMenu(ApplicationMenu):
3626
37 usedfor = IDistroSeriesBinaryPackage27 usedfor = IDistroSeriesBinaryPackage
3828
=== modified file 'lib/lp/translations/browser/configure.zcml'
--- lib/lp/translations/browser/configure.zcml 2014-02-24 06:50:46 +0000
+++ lib/lp/translations/browser/configure.zcml 2014-02-26 03:55:49 +0000
@@ -158,9 +158,7 @@
158 rootsite="translations"/>158 rootsite="translations"/>
159 <browser:menus159 <browser:menus
160 module="lp.translations.browser.pofile"160 module="lp.translations.browser.pofile"
161 classes="161 classes="POFileNavigationMenu"/>
162 POFileFacets
163 POFileNavigationMenu"/>
164 <browser:defaultView162 <browser:defaultView
165 for="lp.translations.interfaces.pofile.IPOFile"163 for="lp.translations.interfaces.pofile.IPOFile"
166 name="+translate"/>164 name="+translate"/>
@@ -358,9 +356,7 @@
358 class="lp.translations.browser.potemplate.POTemplateExportView"/>356 class="lp.translations.browser.potemplate.POTemplateExportView"/>
359 <browser:menus357 <browser:menus
360 module="lp.translations.browser.potemplate"358 module="lp.translations.browser.potemplate"
361 classes="359 classes="POTemplateMenu"/>
362 POTemplateFacets
363 POTemplateMenu"/>
364 <browser:url360 <browser:url
365 for="lp.translations.interfaces.potemplate.IPOTemplateSubset"361 for="lp.translations.interfaces.potemplate.IPOTemplateSubset"
366 urldata="lp.translations.browser.potemplate.POTemplateSubsetURL"/>362 urldata="lp.translations.browser.potemplate.POTemplateSubsetURL"/>
@@ -453,9 +449,7 @@
453 rootsite="translations"/>449 rootsite="translations"/>
454 <browser:menus450 <browser:menus
455 module="lp.translations.browser.translationmessage"451 module="lp.translations.browser.translationmessage"
456 classes="452 classes="CurrentTranslationMessageAppMenus"/>
457 CurrentTranslationMessageFacets
458 CurrentTranslationMessageAppMenus"/>
459 <browser:defaultView453 <browser:defaultView
460 for="lp.translations.interfaces.translationmessage.ITranslationMessage"454 for="lp.translations.interfaces.translationmessage.ITranslationMessage"
461 name="+index"/>455 name="+index"/>
462456
=== modified file 'lib/lp/translations/browser/pofile.py'
--- lib/lp/translations/browser/pofile.py 2012-12-10 23:41:24 +0000
+++ lib/lp/translations/browser/pofile.py 2014-02-26 03:55:49 +0000
@@ -7,7 +7,6 @@
77
8__all__ = [8__all__ = [
9 'POExportView',9 'POExportView',
10 'POFileFacets',
11 'POFileFilteredView',10 'POFileFilteredView',
12 'POFileNavigation',11 'POFileNavigation',
13 'POFileNavigationMenu',12 'POFileNavigationMenu',
@@ -44,7 +43,6 @@
44from lp.services.webapp.escaping import structured43from lp.services.webapp.escaping import structured
45from lp.services.webapp.interfaces import ILaunchBag44from lp.services.webapp.interfaces import ILaunchBag
46from lp.translations.browser.poexportrequest import BaseExportView45from lp.translations.browser.poexportrequest import BaseExportView
47from lp.translations.browser.potemplate import POTemplateFacets
48from lp.translations.browser.translationmessage import (46from lp.translations.browser.translationmessage import (
49 BaseTranslationView,47 BaseTranslationView,
50 CurrentTranslationMessageView,48 CurrentTranslationMessageView,
@@ -90,13 +88,6 @@
90 return potmsgset.getCurrentTranslationMessageOrDummy(self.context)88 return potmsgset.getCurrentTranslationMessageOrDummy(self.context)
9189
9290
93class POFileFacets(POTemplateFacets):
94 usedfor = IPOFile
95
96 def __init__(self, context):
97 POTemplateFacets.__init__(self, context.potemplate)
98
99
100class POFileMenuMixin:91class POFileMenuMixin:
101 """Mixin class to share code between navigation and action menus."""92 """Mixin class to share code between navigation and action menus."""
10293
10394
=== modified file 'lib/lp/translations/browser/potemplate.py'
--- lib/lp/translations/browser/potemplate.py 2013-10-21 01:51:13 +0000
+++ lib/lp/translations/browser/potemplate.py 2014-02-26 03:55:49 +0000
@@ -8,7 +8,6 @@
8 'POTemplateAdminView',8 'POTemplateAdminView',
9 'POTemplateBreadcrumb',9 'POTemplateBreadcrumb',
10 'POTemplateEditView',10 'POTemplateEditView',
11 'POTemplateFacets',
12 'POTemplateExportView',11 'POTemplateExportView',
13 'POTemplateMenu',12 'POTemplateMenu',
14 'POTemplateNavigation',13 'POTemplateNavigation',
@@ -52,11 +51,7 @@
52 )51 )
53from lp.app.errors import NotFoundError52from lp.app.errors import NotFoundError
54from lp.app.validators.name import valid_name53from lp.app.validators.name import valid_name
55from lp.registry.browser.productseries import ProductSeriesFacets
56from lp.registry.browser.sourcepackage import SourcePackageFacets
57from lp.registry.interfaces.productseries import IProductSeries
58from lp.registry.interfaces.role import IPersonRoles54from lp.registry.interfaces.role import IPersonRoles
59from lp.registry.interfaces.sourcepackage import ISourcePackage
60from lp.registry.model.packaging import Packaging55from lp.registry.model.packaging import Packaging
61from lp.registry.model.product import Product56from lp.registry.model.product import Product
62from lp.registry.model.productseries import ProductSeries57from lp.registry.model.productseries import ProductSeries
@@ -70,7 +65,6 @@
70 Link,65 Link,
71 Navigation,66 Navigation,
72 NavigationMenu,67 NavigationMenu,
73 StandardLaunchpadFacets,
74 )68 )
75from lp.services.webapp.authorization import check_permission69from lp.services.webapp.authorization import check_permission
76from lp.services.webapp.breadcrumb import Breadcrumb70from lp.services.webapp.breadcrumb import Breadcrumb
@@ -146,61 +140,6 @@
146 return self.context.newPOFile(name, owner=user)140 return self.context.newPOFile(name, owner=user)
147141
148142
149class POTemplateFacets(StandardLaunchpadFacets):
150 usedfor = IPOTemplate
151
152 def __init__(self, context):
153 StandardLaunchpadFacets.__init__(self, context)
154 target = context.translationtarget
155 if IProductSeries.providedBy(target):
156 self._is_product_series = True
157 self.target_facets = ProductSeriesFacets(target)
158 elif ISourcePackage.providedBy(target):
159 self._is_product_series = False
160 self.target_facets = SourcePackageFacets(target)
161 else:
162 # We don't know yet how to handle this target.
163 raise NotImplementedError
164
165 # Enable only the menus that the translation target uses.
166 self.enable_only = self.target_facets.enable_only
167
168 # From an IPOTemplate URL, we reach its translationtarget (either
169 # ISourcePackage or IProductSeries using self.target.
170 self.target = '../../'
171
172 def overview(self):
173 overview_link = self.target_facets.overview()
174 overview_link.target = self.target
175 return overview_link
176
177 def translations(self):
178 translations_link = self.target_facets.translations()
179 translations_link.target = self.target
180 return translations_link
181
182 def bugs(self):
183 bugs_link = self.target_facets.bugs()
184 bugs_link.target = self.target
185 return bugs_link
186
187 def answers(self):
188 answers_link = self.target_facets.answers()
189 answers_link.target = self.target
190 return answers_link
191
192 def specifications(self):
193 specifications_link = self.target_facets.specifications()
194 specifications_link.target = self.target
195 return specifications_link
196
197 def branches(self):
198 branches_link = self.target_facets.branches()
199 if not self._is_product_series:
200 branches_link.target = self.target
201 return branches_link
202
203
204class POTemplateMenu(NavigationMenu):143class POTemplateMenu(NavigationMenu):
205 """Navigation menus for `IPOTemplate` objects."""144 """Navigation menus for `IPOTemplate` objects."""
206 usedfor = IPOTemplate145 usedfor = IPOTemplate
207146
=== modified file 'lib/lp/translations/browser/translationmessage.py'
--- lib/lp/translations/browser/translationmessage.py 2013-04-10 08:35:47 +0000
+++ lib/lp/translations/browser/translationmessage.py 2014-02-26 03:55:49 +0000
@@ -10,7 +10,6 @@
10 'contains_translations',10 'contains_translations',
11 'convert_translationmessage_to_submission',11 'convert_translationmessage_to_submission',
12 'CurrentTranslationMessageAppMenus',12 'CurrentTranslationMessageAppMenus',
13 'CurrentTranslationMessageFacets',
14 'CurrentTranslationMessageIndexView',13 'CurrentTranslationMessageIndexView',
15 'CurrentTranslationMessagePageView',14 'CurrentTranslationMessagePageView',
16 'CurrentTranslationMessageView',15 'CurrentTranslationMessageView',
@@ -56,7 +55,6 @@
56 count_lines,55 count_lines,
57 text_to_html,56 text_to_html,
58 )57 )
59from lp.translations.browser.potemplate import POTemplateFacets
60from lp.translations.interfaces.pofile import IPOFileAlternativeLanguage58from lp.translations.interfaces.pofile import IPOFileAlternativeLanguage
61from lp.translations.interfaces.side import ITranslationSideTraitsSet59from lp.translations.interfaces.side import ITranslationSideTraitsSet
62from lp.translations.interfaces.translationmessage import (60from lp.translations.interfaces.translationmessage import (
@@ -192,13 +190,6 @@
192 return contents190 return contents
193191
194192
195class CurrentTranslationMessageFacets(POTemplateFacets):
196 usedfor = ITranslationMessage
197
198 def __init__(self, context):
199 POTemplateFacets.__init__(self, context.browser_pofile.potemplate)
200
201
202class CurrentTranslationMessageAppMenus(ApplicationMenu):193class CurrentTranslationMessageAppMenus(ApplicationMenu):
203 usedfor = ITranslationMessage194 usedfor = ITranslationMessage
204 facet = 'translations'195 facet = 'translations'