Merge lp:~salgado/launchpad/cleanup-breadcrumbs into lp:launchpad
- cleanup-breadcrumbs
- Merge into devel
Proposed by
Guilherme Salgado
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~salgado/launchpad/cleanup-breadcrumbs |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~salgado/launchpad/cleanup-breadcrumbs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Celso Providelo (community) | code | Approve | |
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Guilherme Salgado (salgado) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Celso Providelo (cprov) wrote : | # |
Cool! Very nice change, Salgado.
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/webapp/breadcrumb.py' | |||
2 | --- lib/canonical/launchpad/webapp/breadcrumb.py 2009-08-31 17:40:56 +0000 | |||
3 | +++ lib/canonical/launchpad/webapp/breadcrumb.py 2009-09-03 15:04:13 +0000 | |||
4 | @@ -7,6 +7,8 @@ | |||
5 | 7 | 7 | ||
6 | 8 | __all__ = [ | 8 | __all__ = [ |
7 | 9 | 'Breadcrumb', | 9 | 'Breadcrumb', |
8 | 10 | 'DisplaynameBreadcrumb', | ||
9 | 11 | 'TitleBreadcrumb', | ||
10 | 10 | ] | 12 | ] |
11 | 11 | 13 | ||
12 | 12 | 14 | ||
13 | @@ -67,3 +69,19 @@ | |||
14 | 67 | 69 | ||
15 | 68 | return "<%s url='%s' text='%s'%s>" % ( | 70 | return "<%s url='%s' text='%s'%s>" % ( |
16 | 69 | self.__class__.__name__, self.url, self.text, icon_repr) | 71 | self.__class__.__name__, self.url, self.text, icon_repr) |
17 | 72 | |||
18 | 73 | |||
19 | 74 | class DisplaynameBreadcrumb(Breadcrumb): | ||
20 | 75 | """An `IBreadcrumb` that uses the context's displayname as its text.""" | ||
21 | 76 | |||
22 | 77 | @property | ||
23 | 78 | def text(self): | ||
24 | 79 | return self.context.displayname | ||
25 | 80 | |||
26 | 81 | |||
27 | 82 | class TitleBreadcrumb(Breadcrumb): | ||
28 | 83 | """An `IBreadcrumb` that uses the context's title as its text.""" | ||
29 | 84 | |||
30 | 85 | @property | ||
31 | 86 | def text(self): | ||
32 | 87 | return self.context.title | ||
33 | 70 | 88 | ||
34 | === modified file 'lib/lp/blueprints/browser/sprint.py' | |||
35 | --- lib/lp/blueprints/browser/sprint.py 2009-08-29 03:38:28 +0000 | |||
36 | +++ lib/lp/blueprints/browser/sprint.py 2009-09-03 15:04:13 +0000 | |||
37 | @@ -8,7 +8,6 @@ | |||
38 | 8 | 'SprintAddView', | 8 | 'SprintAddView', |
39 | 9 | 'SprintAttendeesCsvExportView', | 9 | 'SprintAttendeesCsvExportView', |
40 | 10 | 'SprintBrandingView', | 10 | 'SprintBrandingView', |
41 | 11 | 'SprintBreadcrumb', | ||
42 | 12 | 'SprintEditView', | 11 | 'SprintEditView', |
43 | 13 | 'SprintFacets', | 12 | 'SprintFacets', |
44 | 14 | 'SprintMeetingExportView', | 13 | 'SprintMeetingExportView', |
45 | @@ -70,13 +69,6 @@ | |||
46 | 70 | usedfor = ISprint | 69 | usedfor = ISprint |
47 | 71 | 70 | ||
48 | 72 | 71 | ||
49 | 73 | class SprintBreadcrumb(Breadcrumb): | ||
50 | 74 | """Builds a breadcrumb for an `ISprint`.""" | ||
51 | 75 | @property | ||
52 | 76 | def text(self): | ||
53 | 77 | return self.context.title | ||
54 | 78 | |||
55 | 79 | |||
56 | 80 | class SprintOverviewMenu(ApplicationMenu): | 72 | class SprintOverviewMenu(ApplicationMenu): |
57 | 81 | 73 | ||
58 | 82 | usedfor = ISprint | 74 | usedfor = ISprint |
59 | 83 | 75 | ||
60 | === modified file 'lib/lp/blueprints/configure.zcml' | |||
61 | --- lib/lp/blueprints/configure.zcml 2009-08-24 20:28:33 +0000 | |||
62 | +++ lib/lp/blueprints/configure.zcml 2009-09-03 15:04:13 +0000 | |||
63 | @@ -28,7 +28,7 @@ | |||
64 | 28 | <adapter | 28 | <adapter |
65 | 29 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 29 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
66 | 30 | for="lp.blueprints.interfaces.sprint.ISprint" | 30 | for="lp.blueprints.interfaces.sprint.ISprint" |
68 | 31 | factory="lp.blueprints.browser.sprint.SprintBreadcrumb" | 31 | factory="canonical.launchpad.webapp.breadcrumb.TitleBreadcrumb" |
69 | 32 | permission="zope.Public"/> | 32 | permission="zope.Public"/> |
70 | 33 | <adapter | 33 | <adapter |
71 | 34 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 34 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
72 | 35 | 35 | ||
73 | === modified file 'lib/lp/bugs/browser/bugtracker.py' | |||
74 | --- lib/lp/bugs/browser/bugtracker.py 2009-08-24 20:28:33 +0000 | |||
75 | +++ lib/lp/bugs/browser/bugtracker.py 2009-09-03 15:04:13 +0000 | |||
76 | @@ -7,7 +7,6 @@ | |||
77 | 7 | 7 | ||
78 | 8 | __all__ = [ | 8 | __all__ = [ |
79 | 9 | 'BugTrackerAddView', | 9 | 'BugTrackerAddView', |
80 | 10 | 'BugTrackerBreadcrumb', | ||
81 | 11 | 'BugTrackerContextMenu', | 10 | 'BugTrackerContextMenu', |
82 | 12 | 'BugTrackerEditView', | 11 | 'BugTrackerEditView', |
83 | 13 | 'BugTrackerNavigation', | 12 | 'BugTrackerNavigation', |
84 | @@ -41,7 +40,6 @@ | |||
85 | 41 | redirection, structured) | 40 | redirection, structured) |
86 | 42 | from canonical.launchpad.webapp.authorization import check_permission | 41 | from canonical.launchpad.webapp.authorization import check_permission |
87 | 43 | from canonical.launchpad.webapp.batching import BatchNavigator | 42 | from canonical.launchpad.webapp.batching import BatchNavigator |
88 | 44 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | ||
89 | 45 | from canonical.widgets import DelimitedListWidget, LaunchpadRadioWidget | 43 | from canonical.widgets import DelimitedListWidget, LaunchpadRadioWidget |
90 | 46 | 44 | ||
91 | 47 | 45 | ||
92 | @@ -194,10 +192,6 @@ | |||
93 | 194 | class BugTrackerEditView(LaunchpadEditFormView): | 192 | class BugTrackerEditView(LaunchpadEditFormView): |
94 | 195 | 193 | ||
95 | 196 | schema = IBugTracker | 194 | schema = IBugTracker |
96 | 197 | field_names = ['name', 'title', 'bugtrackertype', | ||
97 | 198 | 'summary', 'baseurl', 'aliases', 'contactdetails', | ||
98 | 199 | 'active'] | ||
99 | 200 | |||
100 | 201 | custom_widget('summary', TextAreaWidget, width=30, height=5) | 195 | custom_widget('summary', TextAreaWidget, width=30, height=5) |
101 | 202 | custom_widget('aliases', DelimitedListWidget, height=3) | 196 | custom_widget('aliases', DelimitedListWidget, height=3) |
102 | 203 | custom_widget('active', LaunchpadRadioWidget, orientation='vertical') | 197 | custom_widget('active', LaunchpadRadioWidget, orientation='vertical') |
103 | @@ -379,13 +373,6 @@ | |||
104 | 379 | return RemoteBug(self.context, remotebug, bugs) | 373 | return RemoteBug(self.context, remotebug, bugs) |
105 | 380 | 374 | ||
106 | 381 | 375 | ||
107 | 382 | class BugTrackerBreadcrumb(Breadcrumb): | ||
108 | 383 | """Builds a breadcrumb for an `IBugTracker`.""" | ||
109 | 384 | @property | ||
110 | 385 | def text(self): | ||
111 | 386 | return self.context.title | ||
112 | 387 | |||
113 | 388 | |||
114 | 389 | class RemoteBug: | 376 | class RemoteBug: |
115 | 390 | """Represents a bug in a remote bug tracker.""" | 377 | """Represents a bug in a remote bug tracker.""" |
116 | 391 | 378 | ||
117 | 392 | 379 | ||
118 | === modified file 'lib/lp/bugs/configure.zcml' | |||
119 | --- lib/lp/bugs/configure.zcml 2009-08-25 13:51:39 +0000 | |||
120 | +++ lib/lp/bugs/configure.zcml 2009-09-03 15:04:13 +0000 | |||
121 | @@ -384,7 +384,7 @@ | |||
122 | 384 | <adapter | 384 | <adapter |
123 | 385 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 385 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
124 | 386 | for="lp.bugs.interfaces.bugtracker.IBugTracker" | 386 | for="lp.bugs.interfaces.bugtracker.IBugTracker" |
126 | 387 | factory="lp.bugs.browser.bugtracker.BugTrackerBreadcrumb" | 387 | factory="canonical.launchpad.webapp.breadcrumb.TitleBreadcrumb" |
127 | 388 | permission="zope.Public"/> | 388 | permission="zope.Public"/> |
128 | 389 | 389 | ||
129 | 390 | <!-- BugTrackerSet --> | 390 | <!-- BugTrackerSet --> |
130 | 391 | 391 | ||
131 | === modified file 'lib/lp/registry/browser/distribution.py' | |||
132 | --- lib/lp/registry/browser/distribution.py 2009-09-02 05:37:54 +0000 | |||
133 | +++ lib/lp/registry/browser/distribution.py 2009-09-03 15:04:13 +0000 | |||
134 | @@ -11,7 +11,6 @@ | |||
135 | 11 | 'DistributionArchiveMirrorsRSSView', | 11 | 'DistributionArchiveMirrorsRSSView', |
136 | 12 | 'DistributionArchiveMirrorsView', | 12 | 'DistributionArchiveMirrorsView', |
137 | 13 | 'DistributionArchivesView', | 13 | 'DistributionArchivesView', |
138 | 14 | 'DistributionBreadcrumb', | ||
139 | 15 | 'DistributionChangeMembersView', | 14 | 'DistributionChangeMembersView', |
140 | 16 | 'DistributionChangeMirrorAdminView', | 15 | 'DistributionChangeMirrorAdminView', |
141 | 17 | 'DistributionCountryArchiveMirrorsView', | 16 | 'DistributionCountryArchiveMirrorsView', |
142 | @@ -172,13 +171,6 @@ | |||
143 | 172 | return self.redirectSubTree(canonical_url(distribution)) | 171 | return self.redirectSubTree(canonical_url(distribution)) |
144 | 173 | 172 | ||
145 | 174 | 173 | ||
146 | 175 | class DistributionBreadcrumb(Breadcrumb): | ||
147 | 176 | """Builds a breadcrumb for an `IDistribution`.""" | ||
148 | 177 | @property | ||
149 | 178 | def text(self): | ||
150 | 179 | return self.context.displayname | ||
151 | 180 | |||
152 | 181 | |||
153 | 182 | class DistributionFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets): | 174 | class DistributionFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets): |
154 | 183 | 175 | ||
155 | 184 | usedfor = IDistribution | 176 | usedfor = IDistribution |
156 | 185 | 177 | ||
157 | === modified file 'lib/lp/registry/browser/person.py' | |||
158 | --- lib/lp/registry/browser/person.py 2009-09-02 13:28:19 +0000 | |||
159 | +++ lib/lp/registry/browser/person.py 2009-09-03 15:04:13 +0000 | |||
160 | @@ -22,7 +22,6 @@ | |||
161 | 22 | 'PersonAnswersMenu', | 22 | 'PersonAnswersMenu', |
162 | 23 | 'PersonAssignedBugTaskSearchListingView', | 23 | 'PersonAssignedBugTaskSearchListingView', |
163 | 24 | 'PersonBrandingView', | 24 | 'PersonBrandingView', |
164 | 25 | 'PersonBreadcrumb', | ||
165 | 26 | 'PersonBugsMenu', | 25 | 'PersonBugsMenu', |
166 | 27 | 'PersonChangePasswordView', | 26 | 'PersonChangePasswordView', |
167 | 28 | 'PersonClaimView', | 27 | 'PersonClaimView', |
168 | @@ -662,13 +661,6 @@ | |||
169 | 662 | return Link('+adminteammerge', text, icon='edit') | 661 | return Link('+adminteammerge', text, icon='edit') |
170 | 663 | 662 | ||
171 | 664 | 663 | ||
172 | 665 | class PersonBreadcrumb(Breadcrumb): | ||
173 | 666 | """Builds a breadcrumb for an `IPerson`.""" | ||
174 | 667 | @property | ||
175 | 668 | def text(self): | ||
176 | 669 | return self.context.displayname | ||
177 | 670 | |||
178 | 671 | |||
179 | 672 | class PersonFacets(StandardLaunchpadFacets): | 664 | class PersonFacets(StandardLaunchpadFacets): |
180 | 673 | """The links that will appear in the facet menu for an IPerson.""" | 665 | """The links that will appear in the facet menu for an IPerson.""" |
181 | 674 | 666 | ||
182 | 675 | 667 | ||
183 | === modified file 'lib/lp/registry/browser/product.py' | |||
184 | --- lib/lp/registry/browser/product.py 2009-08-31 23:45:03 +0000 | |||
185 | +++ lib/lp/registry/browser/product.py 2009-09-03 15:04:13 +0000 | |||
186 | @@ -11,7 +11,6 @@ | |||
187 | 11 | 'ProductAddViewBase', | 11 | 'ProductAddViewBase', |
188 | 12 | 'ProductAdminView', | 12 | 'ProductAdminView', |
189 | 13 | 'ProductBrandingView', | 13 | 'ProductBrandingView', |
190 | 14 | 'ProductBreadcrumb', | ||
191 | 15 | 'ProductBugsMenu', | 14 | 'ProductBugsMenu', |
192 | 16 | 'ProductDownloadFileMixin', | 15 | 'ProductDownloadFileMixin', |
193 | 17 | 'ProductDownloadFilesView', | 16 | 'ProductDownloadFilesView', |
194 | @@ -245,13 +244,6 @@ | |||
195 | 245 | "you soon.")) | 244 | "you soon.")) |
196 | 246 | 245 | ||
197 | 247 | 246 | ||
198 | 248 | class ProductBreadcrumb(Breadcrumb): | ||
199 | 249 | """Builds a breadcrumb for an `IProduct`.""" | ||
200 | 250 | @property | ||
201 | 251 | def text(self): | ||
202 | 252 | return self.context.displayname | ||
203 | 253 | |||
204 | 254 | |||
205 | 255 | class ProductFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets): | 247 | class ProductFacets(QuestionTargetFacetMixin, StandardLaunchpadFacets): |
206 | 256 | """The links that will appear in the facet menu for an IProduct.""" | 248 | """The links that will appear in the facet menu for an IProduct.""" |
207 | 257 | 249 | ||
208 | 258 | 250 | ||
209 | === modified file 'lib/lp/registry/browser/project.py' | |||
210 | --- lib/lp/registry/browser/project.py 2009-09-01 15:13:46 +0000 | |||
211 | +++ lib/lp/registry/browser/project.py 2009-09-03 15:04:13 +0000 | |||
212 | @@ -12,7 +12,6 @@ | |||
213 | 12 | 'ProjectAddView', | 12 | 'ProjectAddView', |
214 | 13 | 'ProjectAnswersMenu', | 13 | 'ProjectAnswersMenu', |
215 | 14 | 'ProjectBrandingView', | 14 | 'ProjectBrandingView', |
216 | 15 | 'ProjectBreadcrumb', | ||
217 | 16 | 'ProjectBugsMenu', | 15 | 'ProjectBugsMenu', |
218 | 17 | 'ProjectEditView', | 16 | 'ProjectEditView', |
219 | 18 | 'ProjectFacets', | 17 | 'ProjectFacets', |
220 | @@ -104,13 +103,6 @@ | |||
221 | 104 | return self.redirectSubTree(canonical_url(project)) | 103 | return self.redirectSubTree(canonical_url(project)) |
222 | 105 | 104 | ||
223 | 106 | 105 | ||
224 | 107 | class ProjectBreadcrumb(Breadcrumb): | ||
225 | 108 | """Builds a breadcrumb for an `IProject`.""" | ||
226 | 109 | @property | ||
227 | 110 | def text(self): | ||
228 | 111 | return self.context.displayname | ||
229 | 112 | |||
230 | 113 | |||
231 | 114 | class ProjectSetBreadcrumb(Breadcrumb): | 106 | class ProjectSetBreadcrumb(Breadcrumb): |
232 | 115 | """Builds a breadcrumb for an `IProjectSet`.""" | 107 | """Builds a breadcrumb for an `IProjectSet`.""" |
233 | 116 | text = 'Project Groups' | 108 | text = 'Project Groups' |
234 | 117 | 109 | ||
235 | === modified file 'lib/lp/registry/configure.zcml' | |||
236 | --- lib/lp/registry/configure.zcml 2009-08-28 06:16:06 +0000 | |||
237 | +++ lib/lp/registry/configure.zcml 2009-09-03 15:04:13 +0000 | |||
238 | @@ -313,7 +313,7 @@ | |||
239 | 313 | <adapter | 313 | <adapter |
240 | 314 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 314 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
241 | 315 | for="lp.registry.interfaces.project.IProject" | 315 | for="lp.registry.interfaces.project.IProject" |
243 | 316 | factory="lp.registry.browser.project.ProjectBreadcrumb" | 316 | factory="canonical.launchpad.webapp.breadcrumb.DisplaynameBreadcrumb" |
244 | 317 | permission="zope.Public"/> | 317 | permission="zope.Public"/> |
245 | 318 | <adapter | 318 | <adapter |
246 | 319 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 319 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
247 | @@ -767,7 +767,7 @@ | |||
248 | 767 | <adapter | 767 | <adapter |
249 | 768 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 768 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
250 | 769 | for="lp.registry.interfaces.person.IPerson" | 769 | for="lp.registry.interfaces.person.IPerson" |
252 | 770 | factory="lp.registry.browser.person.PersonBreadcrumb" | 770 | factory="canonical.launchpad.webapp.breadcrumb.DisplaynameBreadcrumb" |
253 | 771 | permission="zope.Public"/> | 771 | permission="zope.Public"/> |
254 | 772 | <adapter | 772 | <adapter |
255 | 773 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 773 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
256 | @@ -1186,7 +1186,7 @@ | |||
257 | 1186 | <adapter | 1186 | <adapter |
258 | 1187 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 1187 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
259 | 1188 | for="lp.registry.interfaces.product.IProduct" | 1188 | for="lp.registry.interfaces.product.IProduct" |
261 | 1189 | factory="lp.registry.browser.product.ProductBreadcrumb" | 1189 | factory="canonical.launchpad.webapp.breadcrumb.DisplaynameBreadcrumb" |
262 | 1190 | permission="zope.Public"/> | 1190 | permission="zope.Public"/> |
263 | 1191 | <adapter | 1191 | <adapter |
264 | 1192 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 1192 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
265 | @@ -1432,7 +1432,7 @@ | |||
266 | 1432 | <adapter | 1432 | <adapter |
267 | 1433 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 1433 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
268 | 1434 | for="lp.registry.interfaces.distribution.IDistribution" | 1434 | for="lp.registry.interfaces.distribution.IDistribution" |
270 | 1435 | factory="lp.registry.browser.distribution.DistributionBreadcrumb" | 1435 | factory="canonical.launchpad.webapp.breadcrumb.DisplaynameBreadcrumb" |
271 | 1436 | permission="zope.Public"/> | 1436 | permission="zope.Public"/> |
272 | 1437 | <adapter | 1437 | <adapter |
273 | 1438 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 1438 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
274 | 1439 | 1439 | ||
275 | === modified file 'lib/lp/soyuz/browser/archive.py' | |||
276 | --- lib/lp/soyuz/browser/archive.py 2009-09-01 18:26:21 +0000 | |||
277 | +++ lib/lp/soyuz/browser/archive.py 2009-09-03 15:04:13 +0000 | |||
278 | @@ -9,7 +9,6 @@ | |||
279 | 9 | 'ArchiveAdminView', | 9 | 'ArchiveAdminView', |
280 | 10 | 'ArchiveActivateView', | 10 | 'ArchiveActivateView', |
281 | 11 | 'ArchiveBadges', | 11 | 'ArchiveBadges', |
282 | 12 | 'ArchiveBreadcrumb', | ||
283 | 13 | 'ArchiveBuildsView', | 12 | 'ArchiveBuildsView', |
284 | 14 | 'ArchiveContextMenu', | 13 | 'ArchiveContextMenu', |
285 | 15 | 'ArchiveEditDependenciesView', | 14 | 'ArchiveEditDependenciesView', |
286 | @@ -78,7 +77,6 @@ | |||
287 | 78 | from canonical.launchpad.webapp.authorization import check_permission | 77 | from canonical.launchpad.webapp.authorization import check_permission |
288 | 79 | from canonical.launchpad.webapp.badge import HasBadgeBase | 78 | from canonical.launchpad.webapp.badge import HasBadgeBase |
289 | 80 | from canonical.launchpad.webapp.batching import BatchNavigator | 79 | from canonical.launchpad.webapp.batching import BatchNavigator |
290 | 81 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | ||
291 | 82 | from canonical.launchpad.webapp.interfaces import ICanonicalUrlData | 80 | from canonical.launchpad.webapp.interfaces import ICanonicalUrlData |
292 | 83 | from canonical.launchpad.webapp.menu import structured, NavigationMenu | 81 | from canonical.launchpad.webapp.menu import structured, NavigationMenu |
293 | 84 | from canonical.widgets import ( | 82 | from canonical.widgets import ( |
294 | @@ -382,14 +380,6 @@ | |||
295 | 382 | links = [] | 380 | links = [] |
296 | 383 | 381 | ||
297 | 384 | 382 | ||
298 | 385 | class ArchiveBreadcrumb(Breadcrumb): | ||
299 | 386 | """Builds a breadcrumb for an `IArchive`.""" | ||
300 | 387 | |||
301 | 388 | @property | ||
302 | 389 | def text(self): | ||
303 | 390 | return self.context.displayname | ||
304 | 391 | |||
305 | 392 | |||
306 | 393 | class ArchiveViewBase(LaunchpadView): | 383 | class ArchiveViewBase(LaunchpadView): |
307 | 394 | """Common features for Archive view classes.""" | 384 | """Common features for Archive view classes.""" |
308 | 395 | 385 | ||
309 | 396 | 386 | ||
310 | === modified file 'lib/lp/soyuz/browser/builder.py' | |||
311 | --- lib/lp/soyuz/browser/builder.py 2009-08-27 19:22:38 +0000 | |||
312 | +++ lib/lp/soyuz/browser/builder.py 2009-09-03 15:04:13 +0000 | |||
313 | @@ -6,7 +6,6 @@ | |||
314 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
315 | 7 | 7 | ||
316 | 8 | __all__ = [ | 8 | __all__ = [ |
317 | 9 | 'BuilderBreadcrumb', | ||
318 | 10 | 'BuilderFacets', | 9 | 'BuilderFacets', |
319 | 11 | 'BuilderOverviewMenu', | 10 | 'BuilderOverviewMenu', |
320 | 12 | 'BuilderNavigation', | 11 | 'BuilderNavigation', |
321 | @@ -74,13 +73,6 @@ | |||
322 | 74 | usedfor = IBuilder | 73 | usedfor = IBuilder |
323 | 75 | 74 | ||
324 | 76 | 75 | ||
325 | 77 | class BuilderBreadcrumb(Breadcrumb): | ||
326 | 78 | """Builds a breadcrumb for an `IBuilder`.""" | ||
327 | 79 | @property | ||
328 | 80 | def text(self): | ||
329 | 81 | return self.context.title | ||
330 | 82 | |||
331 | 83 | |||
332 | 84 | class BuilderSetFacets(StandardLaunchpadFacets): | 76 | class BuilderSetFacets(StandardLaunchpadFacets): |
333 | 85 | """The links that will appear in the facet menu for an IBuilderSet.""" | 77 | """The links that will appear in the facet menu for an IBuilderSet.""" |
334 | 86 | enable_only = ['overview'] | 78 | enable_only = ['overview'] |
335 | 87 | 79 | ||
336 | === modified file 'lib/lp/soyuz/configure.zcml' | |||
337 | --- lib/lp/soyuz/configure.zcml 2009-09-02 16:30:48 +0000 | |||
338 | +++ lib/lp/soyuz/configure.zcml 2009-09-03 15:04:13 +0000 | |||
339 | @@ -416,7 +416,7 @@ | |||
340 | 416 | <adapter | 416 | <adapter |
341 | 417 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 417 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
342 | 418 | for="lp.soyuz.interfaces.archive.IArchive" | 418 | for="lp.soyuz.interfaces.archive.IArchive" |
344 | 419 | factory="lp.soyuz.browser.archive.ArchiveBreadcrumb" | 419 | factory="canonical.launchpad.webapp.breadcrumb.DisplaynameBreadcrumb" |
345 | 420 | permission="zope.Public"/> | 420 | permission="zope.Public"/> |
346 | 421 | 421 | ||
347 | 422 | <!-- ArchiveSet --> | 422 | <!-- ArchiveSet --> |
348 | @@ -522,7 +522,7 @@ | |||
349 | 522 | <adapter | 522 | <adapter |
350 | 523 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 523 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
351 | 524 | for="lp.soyuz.interfaces.builder.IBuilder" | 524 | for="lp.soyuz.interfaces.builder.IBuilder" |
353 | 525 | factory="lp.soyuz.browser.builder.BuilderBreadcrumb" | 525 | factory="canonical.launchpad.webapp.breadcrumb.TitleBreadcrumb" |
354 | 526 | permission="zope.Public"/> | 526 | permission="zope.Public"/> |
355 | 527 | <adapter | 527 | <adapter |
356 | 528 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 528 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
357 | 529 | 529 | ||
358 | === modified file 'lib/lp/translations/browser/translationgroup.py' | |||
359 | --- lib/lp/translations/browser/translationgroup.py 2009-08-25 16:44:22 +0000 | |||
360 | +++ lib/lp/translations/browser/translationgroup.py 2009-09-03 15:04:13 +0000 | |||
361 | @@ -7,7 +7,6 @@ | |||
362 | 7 | __all__ = [ | 7 | __all__ = [ |
363 | 8 | 'TranslationGroupAddTranslatorView', | 8 | 'TranslationGroupAddTranslatorView', |
364 | 9 | 'TranslationGroupAddView', | 9 | 'TranslationGroupAddView', |
365 | 10 | 'TranslationGroupBreadcrumb', | ||
366 | 11 | 'TranslationGroupEditView', | 10 | 'TranslationGroupEditView', |
367 | 12 | 'TranslationGroupNavigation', | 11 | 'TranslationGroupNavigation', |
368 | 13 | 'TranslationGroupReassignmentView', | 12 | 'TranslationGroupReassignmentView', |
369 | @@ -46,17 +45,9 @@ | |||
370 | 46 | 45 | ||
371 | 47 | class TranslationGroupSetBreadcrumb(Breadcrumb): | 46 | class TranslationGroupSetBreadcrumb(Breadcrumb): |
372 | 48 | """Builds a breadcrumb for an `ITranslationGroupSet`.""" | 47 | """Builds a breadcrumb for an `ITranslationGroupSet`.""" |
373 | 49 | |||
374 | 50 | text = u"Translation groups" | 48 | text = u"Translation groups" |
375 | 51 | 49 | ||
376 | 52 | 50 | ||
377 | 53 | class TranslationGroupBreadcrumb(Breadcrumb): | ||
378 | 54 | """Builds a breadcrumb for an `ITranslationGroup`.""" | ||
379 | 55 | |||
380 | 56 | @property | ||
381 | 57 | def text(self): | ||
382 | 58 | return self.context.title | ||
383 | 59 | |||
384 | 60 | class TranslationGroupView: | 51 | class TranslationGroupView: |
385 | 61 | 52 | ||
386 | 62 | def __init__(self, context, request): | 53 | def __init__(self, context, request): |
387 | 63 | 54 | ||
388 | === modified file 'lib/lp/translations/configure.zcml' | |||
389 | --- lib/lp/translations/configure.zcml 2009-08-25 16:44:22 +0000 | |||
390 | +++ lib/lp/translations/configure.zcml 2009-09-03 15:04:13 +0000 | |||
391 | @@ -397,7 +397,7 @@ | |||
392 | 397 | <adapter | 397 | <adapter |
393 | 398 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" | 398 | provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
394 | 399 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" | 399 | for="lp.translations.interfaces.translationgroup.ITranslationGroup" |
396 | 400 | factory="lp.translations.browser.translationgroup.TranslationGroupBreadcrumb" | 400 | factory="canonical.launchpad.webapp.breadcrumb.TitleBreadcrumb" |
397 | 401 | permission="zope.Public"/> | 401 | permission="zope.Public"/> |
398 | 402 | 402 | ||
399 | 403 | <!-- TranslationGroupSet --> | 403 | <!-- TranslationGroupSet --> |
400 | 404 | 404 |
= Summary =
Most of our IBreadcrumb adapters define just a text property that
returns the context's title or displayname, so I defined some generic
adapters that do just that and used them instead, removing the existing
ones.
The field_names variable removed is because it was redefined a few lines
below. Also, the lint issues on browser/person.py have been fixed on
another branch of mine, so I won't fix them here.
== Tests ==
./bin/test -vvt test_breadcrumbs
== Demo and Q/A ==
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: bugs/configure. zcml registry/ browser/ product. py registry/ configure. zcml /launchpad/ webapp/ breadcrumb. py soyuz/configure .zcml blueprints/ configure. zcml blueprints/ browser/ sprint. py bugs/browser/ bugtracker. py soyuz/browser/ builder. py translations/ configure. zcml translations/ browser/ translationgrou p.py registry/ browser/ person. py registry/ browser/ distribution. py registry/ browser/ project. py soyuz/browser/ archive. py
lib/lp/
lib/lp/
lib/lp/
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ registry/ browser/ product. py
54: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
lib/lp/ soyuz/browser/ builder. py
44: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
lib/lp/ registry/ browser/ person. py interface' (No module named restful)
1186: [C0301] Line too long (79/78)
1273: [C0301] Line too long (79/78)
3120: [W0311] Bad indentation. Found 10 spaces, expected 12
3124: [W0311] Bad indentation. Found 10 spaces, expected 12
119: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
120: [F0401] Unable to import 'lazr.config' (No module named config)
121: [F0401] Unable to import 'lazr.restful.