Merge lp:~thumper/launchpad/branch-breadcrumbs into lp:launchpad
- branch-breadcrumbs
- Merge into devel
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~thumper/launchpad/branch-breadcrumbs |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~thumper/launchpad/branch-breadcrumbs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+11945@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote : | # |
Revision history for this message
Paul Hummer (rockstar) : | # |
review:
Approve
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-09-03 15:04:13 +0000 |
3 | +++ lib/canonical/launchpad/webapp/breadcrumb.py 2009-09-17 02:17:15 +0000 |
4 | @@ -8,6 +8,7 @@ |
5 | __all__ = [ |
6 | 'Breadcrumb', |
7 | 'DisplaynameBreadcrumb', |
8 | + 'NameBreadcrumb', |
9 | 'TitleBreadcrumb', |
10 | ] |
11 | |
12 | @@ -71,6 +72,14 @@ |
13 | self.__class__.__name__, self.url, self.text, icon_repr) |
14 | |
15 | |
16 | +class NameBreadcrumb(Breadcrumb): |
17 | + """An `IBreadcrumb` that uses the context's name as its text.""" |
18 | + |
19 | + @property |
20 | + def text(self): |
21 | + return self.context.name |
22 | + |
23 | + |
24 | class DisplaynameBreadcrumb(Breadcrumb): |
25 | """An `IBreadcrumb` that uses the context's displayname as its text.""" |
26 | |
27 | |
28 | === modified file 'lib/lp/code/browser/branch.py' |
29 | --- lib/lp/code/browser/branch.py 2009-09-16 04:28:40 +0000 |
30 | +++ lib/lp/code/browser/branch.py 2009-09-17 03:25:05 +0000 |
31 | @@ -86,7 +86,6 @@ |
32 | CodeImportJobState, ICodeImportJobWorkflow) |
33 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment |
34 | from lp.code.interfaces.branchnamespace import IBranchNamespacePolicy |
35 | -from lp.code.interfaces.branchtarget import IHasBranchTarget |
36 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference |
37 | from lp.registry.interfaces.person import IPerson, IPersonSet |
38 | from lp.registry.interfaces.productseries import IProductSeries |
39 | @@ -123,7 +122,21 @@ |
40 | @property |
41 | def objects(self): |
42 | """See `Hierarchy`.""" |
43 | - return IHasBranchTarget(self.context).target.components |
44 | + traversed = list(self.request.traversed_objects) |
45 | + # Pass back the root object. |
46 | + yield traversed.pop(0) |
47 | + # Now pop until we find the branch. |
48 | + branch = traversed.pop(0) |
49 | + while not IBranch.providedBy(branch): |
50 | + branch = traversed.pop(0) |
51 | + # Now pass back the branch components. |
52 | + for component in branch.target.components: |
53 | + yield component |
54 | + # Now the branch. |
55 | + yield branch |
56 | + # Now whatever is left. |
57 | + for obj in traversed: |
58 | + yield obj |
59 | |
60 | |
61 | class BranchNavigation(Navigation): |
62 | |
63 | === modified file 'lib/lp/code/browser/branchlisting.py' |
64 | --- lib/lp/code/browser/branchlisting.py 2009-09-09 05:07:24 +0000 |
65 | +++ lib/lp/code/browser/branchlisting.py 2009-09-17 01:48:50 +0000 |
66 | @@ -12,6 +12,7 @@ |
67 | 'DistributionSourcePackageBranchesView', |
68 | 'DistroSeriesBranchListingView', |
69 | 'GroupedDistributionSourcePackageBranchesView', |
70 | + 'HasBranchesBreadcrumb', |
71 | 'PersonBranchesMenu', |
72 | 'PersonCodeSummaryView', |
73 | 'PersonOwnedBranchesView', |
74 | @@ -63,6 +64,7 @@ |
75 | check_permission, precache_permission_for_objects) |
76 | from canonical.launchpad.webapp.badge import Badge, HasBadgeBase |
77 | from canonical.launchpad.webapp.batching import TableBatchNavigator |
78 | +from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
79 | from canonical.launchpad.webapp.publisher import LaunchpadView |
80 | from canonical.widgets import LaunchpadDropdownWidget |
81 | |
82 | @@ -86,10 +88,10 @@ |
83 | from lp.registry.interfaces.distroseries import DistroSeriesStatus |
84 | from lp.registry.interfaces.person import IPerson, IPersonSet |
85 | from lp.registry.interfaces.product import IProduct |
86 | -from lp.registry.interfaces.productseries import IProductSeriesSet |
87 | from lp.registry.interfaces.sourcepackage import ISourcePackageFactory |
88 | from lp.registry.model.sourcepackage import SourcePackage |
89 | |
90 | + |
91 | def get_plural_text(count, singular, plural): |
92 | """Return 'singular' if 'count' is 1, 'plural' otherwise.""" |
93 | if count == 1: |
94 | @@ -98,6 +100,14 @@ |
95 | return plural |
96 | |
97 | |
98 | +class HasBranchesBreadcrumb(Breadcrumb): |
99 | + rootsite = 'code' |
100 | + |
101 | + @property |
102 | + def text(self): |
103 | + return 'Branches for %s' % self.context.displayname |
104 | + |
105 | + |
106 | class BranchBadges(HasBadgeBase): |
107 | badges = "private", "bug", "blueprint", "warning", "mergeproposal" |
108 | |
109 | @@ -494,7 +504,7 @@ |
110 | # shown in the branch listings. |
111 | show_series_links = False |
112 | extra_columns = [] |
113 | - heading_template = 'Bazaar branches for %(displayname)s' |
114 | + label_template = 'Bazaar branches for %(displayname)s' |
115 | # no_sort_by is a sequence of items from the BranchListingSort |
116 | # enumeration to not offer in the sort_by widget. |
117 | no_sort_by = () |
118 | @@ -512,15 +522,14 @@ |
119 | ) |
120 | |
121 | @property |
122 | - def heading(self): |
123 | - return self.heading_template % { |
124 | + def label(self): |
125 | + return self.label_template % { |
126 | 'displayname': self.context.displayname, |
127 | 'title': getattr(self.context, 'title', 'no-title')} |
128 | |
129 | - @property |
130 | - def page_title(self): |
131 | - # The page title uses the view heading. |
132 | - return self.heading |
133 | + # Provide a default page_title for distros and other things without |
134 | + # breadcrumbs.. |
135 | + page_title = label |
136 | |
137 | @property |
138 | def initial_values(self): |
139 | @@ -948,7 +957,8 @@ |
140 | class PersonRegisteredBranchesView(PersonBaseBranchListingView): |
141 | """View for branch listing for a person's registered branches.""" |
142 | |
143 | - heading_template = 'Bazaar branches registered by %(displayname)s' |
144 | + page_title = _('Registered') |
145 | + label_template = 'Bazaar branches registered by %(displayname)s' |
146 | no_sort_by = (BranchListingSort.DEFAULT, BranchListingSort.OWNER) |
147 | |
148 | def _getCollection(self): |
149 | @@ -958,7 +968,8 @@ |
150 | class PersonOwnedBranchesView(PersonBaseBranchListingView): |
151 | """View for branch listing for a person's owned branches.""" |
152 | |
153 | - heading_template = 'Bazaar branches owned by %(displayname)s' |
154 | + page_title = _('Owned') |
155 | + label_template = 'Bazaar branches owned by %(displayname)s' |
156 | no_sort_by = (BranchListingSort.DEFAULT, BranchListingSort.OWNER) |
157 | |
158 | def _getCollection(self): |
159 | @@ -968,7 +979,8 @@ |
160 | class PersonSubscribedBranchesView(PersonBaseBranchListingView): |
161 | """View for branch listing for a person's subscribed branches.""" |
162 | |
163 | - heading_template = 'Bazaar branches subscribed to by %(displayname)s' |
164 | + page_title = _('Subscribed') |
165 | + label_template = 'Bazaar branches subscribed to by %(displayname)s' |
166 | no_sort_by = (BranchListingSort.DEFAULT,) |
167 | |
168 | def _getCollection(self): |
169 | @@ -1092,7 +1104,7 @@ |
170 | |
171 | show_series_links = True |
172 | no_sort_by = (BranchListingSort.PRODUCT,) |
173 | - heading_template = 'Bazaar branches of %(displayname)s' |
174 | + label_template = 'Bazaar branches of %(displayname)s' |
175 | |
176 | def _getCollection(self): |
177 | return getUtility(IAllBranches).inProduct(self.context) |
178 | @@ -1306,7 +1318,7 @@ |
179 | |
180 | no_sort_by = (BranchListingSort.DEFAULT,) |
181 | extra_columns = ('author', 'product') |
182 | - heading_template = 'Bazaar branches of %(displayname)s' |
183 | + label_template = 'Bazaar branches of %(displayname)s' |
184 | |
185 | def _getCollection(self): |
186 | return getUtility(IAllBranches).inProject(self.context) |
187 | @@ -1345,7 +1357,7 @@ |
188 | class DistributionSourcePackageBranchesView(BaseSourcePackageBranchesView): |
189 | """A general listing of all branches in the distro source package.""" |
190 | |
191 | - heading_template = 'Bazaar branches for %(title)s' |
192 | + label_template = 'Bazaar branches for %(title)s' |
193 | |
194 | def _getCollection(self): |
195 | return getUtility(IAllBranches).inDistributionSourcePackage( |
196 | @@ -1371,10 +1383,10 @@ |
197 | """A view that groups branches into distro series.""" |
198 | |
199 | @property |
200 | - def heading(self): |
201 | + def label(self): |
202 | return 'Bazaar branches for %s' % self.context.title |
203 | |
204 | - page_title = heading |
205 | + page_title = label |
206 | |
207 | def __init__(self, context, request): |
208 | LaunchpadView.__init__(self, context, request) |
209 | @@ -1529,7 +1541,7 @@ |
210 | |
211 | class SourcePackageBranchesView(BranchListingView): |
212 | |
213 | - heading_template = 'Bazaar branches of %(displayname)s' |
214 | + label_template = 'Bazaar branches of %(displayname)s' |
215 | |
216 | # XXX: JonathanLange 2009-03-03 spec=package-branches: This page has no |
217 | # menu yet -- do we need one? |
218 | @@ -1594,8 +1606,8 @@ |
219 | return self.context.person |
220 | |
221 | @property |
222 | - def heading(self): |
223 | - return self.heading_template % { |
224 | + def label(self): |
225 | + return self.label_template % { |
226 | 'person': self.context.person.displayname, |
227 | 'product': self.context.product.displayname} |
228 | |
229 | @@ -1622,7 +1634,7 @@ |
230 | BranchListingSort.OWNER, |
231 | BranchListingSort.PRODUCT) |
232 | |
233 | - heading_template = 'Bazaar Branches of %(product)s owned by %(person)s' |
234 | + label_template = 'Bazaar Branches of %(product)s owned by %(person)s' |
235 | |
236 | def _getCollection(self): |
237 | return getUtility(IAllBranches).ownedBy( |
238 | @@ -1632,7 +1644,7 @@ |
239 | class PersonProductRegisteredBranchesView(PersonProductBaseBranchesView): |
240 | """Branch listing for a person's registered branches of a product.""" |
241 | |
242 | - heading_template = ( |
243 | + label_template = ( |
244 | 'Bazaar Branches of %(product)s registered by %(person)s') |
245 | |
246 | def _getCollection(self): |
247 | @@ -1643,7 +1655,7 @@ |
248 | class PersonProductSubscribedBranchesView(PersonProductBaseBranchesView): |
249 | """Branch listing for a person's subscribed branches of a product.""" |
250 | |
251 | - heading_template = ( |
252 | + label_template = ( |
253 | 'Bazaar Branches of %(product)s subscribed to by %(person)s') |
254 | |
255 | def _getCollection(self): |
256 | |
257 | === modified file 'lib/lp/code/browser/branchmergeproposal.py' |
258 | --- lib/lp/code/browser/branchmergeproposal.py 2009-09-08 15:52:12 +0000 |
259 | +++ lib/lp/code/browser/branchmergeproposal.py 2009-09-17 02:17:15 +0000 |
260 | @@ -8,6 +8,7 @@ |
261 | __metaclass__ = type |
262 | __all__ = [ |
263 | 'BranchMergeCandidateView', |
264 | + 'BranchMergeProposalActionNavigationMenu', |
265 | 'BranchMergeProposalAddVoteView', |
266 | 'BranchMergeProposalChangeStatusView', |
267 | 'BranchMergeProposalCommitMessageEditView', |
268 | @@ -44,10 +45,19 @@ |
269 | from canonical.config import config |
270 | |
271 | from canonical.launchpad import _ |
272 | +from canonical.launchpad.fields import Summary, Whiteboard |
273 | +from canonical.launchpad.interfaces.message import IMessageSet |
274 | +from canonical.launchpad.webapp import ( |
275 | + canonical_url, ContextMenu, custom_widget, Link, enabled_with_permission, |
276 | + LaunchpadEditFormView, LaunchpadFormView, LaunchpadView, action, |
277 | + stepthrough, stepto, Navigation) |
278 | +from canonical.launchpad.webapp.authorization import check_permission |
279 | +from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
280 | +from canonical.launchpad.webapp.interfaces import IPrimaryContext |
281 | +from canonical.launchpad.webapp.menu import NavigationMenu |
282 | + |
283 | from lp.code.adapters.branch import BranchMergeProposalDelta |
284 | from lp.code.browser.codereviewcomment import CodeReviewDisplayComment |
285 | -from canonical.launchpad.fields import Summary, Whiteboard |
286 | -from canonical.launchpad.interfaces.message import IMessageSet |
287 | from lp.code.enums import ( |
288 | BranchMergeProposalStatus, BranchType, CodeReviewNotificationLevel, |
289 | CodeReviewVote) |
290 | @@ -58,12 +68,6 @@ |
291 | ICodeReviewVoteReference) |
292 | from lp.registry.interfaces.person import IPersonSet |
293 | from lp.services.comments.interfaces.conversation import IConversation |
294 | -from canonical.launchpad.webapp import ( |
295 | - canonical_url, ContextMenu, custom_widget, Link, enabled_with_permission, |
296 | - LaunchpadEditFormView, LaunchpadFormView, LaunchpadView, action, |
297 | - stepthrough, stepto, Navigation) |
298 | -from canonical.launchpad.webapp.authorization import check_permission |
299 | -from canonical.launchpad.webapp.interfaces import IPrimaryContext |
300 | |
301 | from lazr.delegates import delegates |
302 | from lazr.restful.interface import copy_field |
303 | @@ -79,6 +83,14 @@ |
304 | branch_merge_proposal.source_branch).context |
305 | |
306 | |
307 | +class BranchMergeProposalBreadcrumb(Breadcrumb): |
308 | + """An `IBreadcrumb` for a merge proposal.""" |
309 | + |
310 | + @property |
311 | + def text(self): |
312 | + return 'Merge into %s' % self.context.target_branch.name |
313 | + |
314 | + |
315 | def notify(func): |
316 | """Decorate a view method to send a notification.""" |
317 | def decorator(view, *args, **kwargs): |
318 | @@ -119,23 +131,8 @@ |
319 | return friendly_texts[self.context.queue_status] |
320 | |
321 | |
322 | -class BranchMergeProposalContextMenu(ContextMenu): |
323 | - """Context menu for branches.""" |
324 | - |
325 | - usedfor = IBranchMergeProposal |
326 | - links = [ |
327 | - 'edit', |
328 | - 'edit_commit_message', |
329 | - 'delete', |
330 | - 'request_review', |
331 | - 'add_comment', |
332 | - 'merge', |
333 | - 'enqueue', |
334 | - 'dequeue', |
335 | - 'resubmit', |
336 | - 'update_merge_revno', |
337 | - 'edit_status', |
338 | - ] |
339 | +class BranchMergeProposalMenuMixin: |
340 | + """Mixin class for merge proposal menus.""" |
341 | |
342 | @enabled_with_permission('launchpad.AnyPerson') |
343 | def add_comment(self): |
344 | @@ -166,18 +163,19 @@ |
345 | @enabled_with_permission('launchpad.Edit') |
346 | def delete(self): |
347 | text = 'Delete proposal to merge' |
348 | - return Link('+delete', text, icon='remove') |
349 | + return Link('+delete', text, icon='trash-icon') |
350 | |
351 | def _enabledForStatus(self, next_state): |
352 | """True if the next_state is a valid transition for the current user. |
353 | |
354 | Return False if the current state is next_state. |
355 | """ |
356 | - status = self.context.queue_status |
357 | + bmp = self.branch_merge_proposal |
358 | + status = bmp.queue_status |
359 | if status == next_state: |
360 | return False |
361 | else: |
362 | - return self.context.isValidTransition(next_state, self.user) |
363 | + return bmp.isValidTransition(next_state, self.user) |
364 | |
365 | @enabled_with_permission('launchpad.Edit') |
366 | def request_review(self): |
367 | @@ -225,6 +223,48 @@ |
368 | return Link('+resubmit', text, enabled=enabled, icon='edit') |
369 | |
370 | |
371 | +class BranchMergeProposalContextMenu(ContextMenu, |
372 | + BranchMergeProposalMenuMixin): |
373 | + """Context menu for merge proposals.""" |
374 | + |
375 | + usedfor = IBranchMergeProposal |
376 | + links = [ |
377 | + 'edit', |
378 | + 'edit_commit_message', |
379 | + 'delete', |
380 | + 'request_review', |
381 | + 'add_comment', |
382 | + 'merge', |
383 | + 'enqueue', |
384 | + 'dequeue', |
385 | + 'resubmit', |
386 | + 'update_merge_revno', |
387 | + 'edit_status', |
388 | + ] |
389 | + |
390 | + @property |
391 | + def branch_merge_proposal(self): |
392 | + return self.context |
393 | + |
394 | + |
395 | +class IBranchMergeProposalActionMenu(Interface): |
396 | + """A marker interface for the global action navigation menu.""" |
397 | + |
398 | + |
399 | +class BranchMergeProposalActionNavigationMenu(NavigationMenu, |
400 | + BranchMergeProposalMenuMixin): |
401 | + """A sub-menu for acting upon a Product.""" |
402 | + |
403 | + usedfor = IBranchMergeProposalActionMenu |
404 | + facet = 'branches' |
405 | + links = ('resubmit', 'delete') |
406 | + |
407 | + @property |
408 | + def branch_merge_proposal(self): |
409 | + # This context is the view, the view's context is the bmp. |
410 | + return self.context.context |
411 | + |
412 | + |
413 | class UnmergedRevisionsMixin: |
414 | """Provides the methods needed to show unmerged revisions.""" |
415 | |
416 | @@ -339,6 +379,7 @@ |
417 | def __init__(self, comments): |
418 | self.comments = comments |
419 | |
420 | + |
421 | class ClaimButton(Interface): |
422 | """A simple interface to populate the form to enqueue a proposal.""" |
423 | |
424 | @@ -349,7 +390,9 @@ |
425 | BranchMergeProposalRevisionIdMixin): |
426 | """A basic view used for the index page.""" |
427 | |
428 | - label = "Proposal to merge branches" |
429 | + implements(IBranchMergeProposalActionMenu) |
430 | + |
431 | + label = "Proposal to merge branch" |
432 | __used_for__ = IBranchMergeProposal |
433 | schema = ClaimButton |
434 | |
435 | |
436 | === modified file 'lib/lp/code/browser/configure.zcml' |
437 | --- lib/lp/code/browser/configure.zcml 2009-09-16 05:18:47 +0000 |
438 | +++ lib/lp/code/browser/configure.zcml 2009-09-17 03:25:05 +0000 |
439 | @@ -315,7 +315,8 @@ |
440 | template="../templates/branchmergeproposal-macros.pt"/> |
441 | <browser:menus |
442 | classes=" |
443 | - BranchMergeProposalContextMenu" |
444 | + BranchMergeProposalContextMenu |
445 | + BranchMergeProposalActionNavigationMenu" |
446 | module="lp.code.browser.branchmergeproposal"/> |
447 | <browser:page |
448 | for="lp.code.interfaces.branchsubscription.IBranchSubscription" |
449 | @@ -887,4 +888,23 @@ |
450 | name="+activereviews" |
451 | template="../templates/active-reviews.pt"/> |
452 | |
453 | + <adapter |
454 | + name="code" |
455 | + provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
456 | + for="lp.code.interfaces.hasbranches.IHasBranches" |
457 | + factory="lp.code.browser.branchlisting.HasBranchesBreadcrumb" |
458 | + permission="zope.Public"/> |
459 | + |
460 | + <adapter |
461 | + provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
462 | + for="lp.code.interfaces.branch.IBranch" |
463 | + factory="canonical.launchpad.webapp.breadcrumb.NameBreadcrumb" |
464 | + permission="zope.Public"/> |
465 | + |
466 | + <adapter |
467 | + provides="canonical.launchpad.webapp.interfaces.IBreadcrumb" |
468 | + for="lp.code.interfaces.branchmergeproposal.IBranchMergeProposal" |
469 | + factory="lp.code.browser.branchmergeproposal.BranchMergeProposalBreadcrumb" |
470 | + permission="zope.Public"/> |
471 | + |
472 | </configure> |
473 | |
474 | === modified file 'lib/lp/code/stories/branches/package-branch-merge-proposals.txt' |
475 | --- lib/lp/code/stories/branches/package-branch-merge-proposals.txt 2009-09-10 20:12:12 +0000 |
476 | +++ lib/lp/code/stories/branches/package-branch-merge-proposals.txt 2009-09-17 03:12:08 +0000 |
477 | @@ -20,6 +20,3 @@ |
478 | >>> browser.getControl( |
479 | ... name="field.target_branch.target_branch").value = b2_name |
480 | >>> browser.getControl('Propose Merge').click() |
481 | - |
482 | - >>> browser.title |
483 | - '\xe2\x80\x9cgeneric-string1\xe2\x80\x9d package : 13.0 : generic-string3' |
484 | |
485 | === modified file 'lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt' |
486 | --- lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt 2009-09-10 20:12:12 +0000 |
487 | +++ lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt 2009-09-17 03:12:08 +0000 |
488 | @@ -47,6 +47,3 @@ |
489 | >>> browser.getControl( |
490 | ... name="field.target_branch.target_branch").value = b2_name |
491 | >>> browser.getControl('Propose Merge').click() |
492 | - |
493 | - >>> browser.title |
494 | - '\xe2\x80\x9cgeneric-string1\xe2\x80\x9d package : 13.0 : generic-string3' |
495 | |
496 | === modified file 'lib/lp/code/stories/branches/xx-branch-deletion.txt' |
497 | --- lib/lp/code/stories/branches/xx-branch-deletion.txt 2009-09-04 07:29:56 +0000 |
498 | +++ lib/lp/code/stories/branches/xx-branch-deletion.txt 2009-09-17 03:12:08 +0000 |
499 | @@ -10,8 +10,8 @@ |
500 | >>> browser.getControl('Branch URL').value = 'http://foo.bar.com/oops' |
501 | >>> browser.getControl('Name').value = 'to-delete' |
502 | >>> browser.getControl('Register Branch').click() |
503 | - >>> browser.title |
504 | - '...~name12/firefox/to-delete... branch in Launchpad' |
505 | + >>> print browser.title |
506 | + to-delete : Branches for Mozilla Firefox : Mozilla Firefox |
507 | |
508 | The newly created branch has an action 'Delete branch'. |
509 | |
510 | |
511 | === modified file 'lib/lp/code/stories/branches/xx-branch-index.txt' |
512 | --- lib/lp/code/stories/branches/xx-branch-index.txt 2009-09-02 18:03:30 +0000 |
513 | +++ lib/lp/code/stories/branches/xx-branch-index.txt 2009-09-17 03:12:08 +0000 |
514 | @@ -408,7 +408,7 @@ |
515 | >>> browser.open( |
516 | ... 'http://code.launchpad.dev/~name12/gnome-terminal/scanned') |
517 | >>> print_location(browser.contents) |
518 | - Hierarchy: None displayed |
519 | + Hierarchy: GNOME Terminal > Branches for GNOME Terminal > scanned |
520 | Tabs: |
521 | * Overview - http://launchpad.dev/gnome-terminal |
522 | * Code (selected) - http://code.launchpad.dev/gnome-terminal |
523 | @@ -420,7 +420,7 @@ |
524 | |
525 | >>> browser.open('http://code.launchpad.dev/~name12/+junk/junk.dev') |
526 | >>> print_location(browser.contents) |
527 | - Hierarchy: None displayed |
528 | + Hierarchy: Sample Person > Branches for Sample Person > junk.dev |
529 | Tabs: |
530 | * Overview - http://launchpad.dev/~name12 |
531 | * Code (selected) - http://code.launchpad.dev/~name12 |
532 | |
533 | === modified file 'lib/lp/code/stories/branches/xx-branch-merge-proposals.txt' |
534 | --- lib/lp/code/stories/branches/xx-branch-merge-proposals.txt 2009-09-16 23:02:43 +0000 |
535 | +++ lib/lp/code/stories/branches/xx-branch-merge-proposals.txt 2009-09-17 03:44:41 +0000 |
536 | @@ -324,9 +324,6 @@ |
537 | |
538 | This takes the user to the resubmission page. |
539 | |
540 | - >>> print eric_browser.title |
541 | - +resubmit : Fooix |
542 | - |
543 | >>> eric_browser.getControl('Resubmit').click() |
544 | |
545 | The new merge proposal is created as needs review, and there is |
546 | |
547 | === modified file 'lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt' |
548 | --- lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt 2009-09-09 06:37:22 +0000 |
549 | +++ lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt 2009-09-17 03:12:08 +0000 |
550 | @@ -69,7 +69,7 @@ |
551 | |
552 | >>> browser.getLink('active reviews or unmerged proposals').click() |
553 | >>> print browser.title |
554 | - +activereviews : Fooix |
555 | + +activereviews : Branches for Fooix : Fooix |
556 | |
557 | The proposals are listed in a table that shows the source and target branches, |
558 | who requested the merge, the date the review was requested, and the vote |
559 | |
560 | === modified file 'lib/lp/code/stories/branches/xx-bug-branch-links.txt' |
561 | --- lib/lp/code/stories/branches/xx-bug-branch-links.txt 2009-09-09 06:37:22 +0000 |
562 | +++ lib/lp/code/stories/branches/xx-bug-branch-links.txt 2009-09-17 03:12:08 +0000 |
563 | @@ -45,7 +45,7 @@ |
564 | |
565 | >>> browser.getLink('Link to a bug report').click() |
566 | >>> print browser.title |
567 | - +linkbug : GNOME Terminal |
568 | + +linkbug : klingon : Branches for GNOME Terminal : GNOME Terminal |
569 | |
570 | When linking from a branch to a bug, the bug widget is used. This |
571 | requires the user to enter a bug number. |
572 | |
573 | === modified file 'lib/lp/code/stories/branches/xx-creating-branches.txt' |
574 | --- lib/lp/code/stories/branches/xx-creating-branches.txt 2009-09-02 18:03:30 +0000 |
575 | +++ lib/lp/code/stories/branches/xx-creating-branches.txt 2009-09-17 03:12:08 +0000 |
576 | @@ -144,6 +144,7 @@ |
577 | >>> print extract_text(find_tag_by_id(user_browser.contents, 'privacy')) |
578 | This branch is public |
579 | >>> print extract_text(find_main_content(user_browser.contents)) |
580 | + Gnome Applets ... |
581 | lp://dev/~no-priv/applets/main ... |
582 | ...http://example.com/applets/main... |
583 | |
584 | |
585 | === modified file 'lib/lp/code/stories/branches/xx-person-branches.txt' |
586 | --- lib/lp/code/stories/branches/xx-person-branches.txt 2009-09-16 21:22:12 +0000 |
587 | +++ lib/lp/code/stories/branches/xx-person-branches.txt 2009-09-17 03:12:08 +0000 |
588 | @@ -9,7 +9,7 @@ |
589 | >>> browser = setupBrowser(auth='Basic test@canonical.com:test') |
590 | >>> browser.open('http://code.launchpad.dev/~name12') |
591 | >>> print browser.title |
592 | - Bazaar branches owned by Sample Person |
593 | + Branches for Sample Person : Sample Person |
594 | |
595 | The heading in the main content is the same as the page title text. |
596 | |
597 | @@ -39,8 +39,6 @@ |
598 | A person's owned branches are shown on their code application overview page. |
599 | |
600 | >>> browser.open('http://code.launchpad.dev/~name12') |
601 | - >>> print browser.title |
602 | - Bazaar branches owned by Sample Person |
603 | >>> table = find_tag_by_id(browser.contents, 'branchtable') |
604 | >>> for row in table.tbody.fetch('tr'): |
605 | ... print extract_text(row) |
606 | @@ -56,7 +54,7 @@ |
607 | >>> browser.open('http://code.launchpad.dev/~name12') |
608 | >>> browser.getLink('registered').click() |
609 | >>> print browser.title |
610 | - +registeredbranches : Sample Person |
611 | + +registeredbranches : Branches for Sample Person : Sample Person |
612 | >>> table = find_tag_by_id(browser.contents, 'branchtable') |
613 | >>> for row in table.tbody.fetch('tr'): |
614 | ... print extract_text(row) |
615 | @@ -73,7 +71,7 @@ |
616 | >>> browser.open('http://code.launchpad.dev/~name12') |
617 | >>> browser.getLink('subscribed').click() |
618 | >>> print browser.title |
619 | - +subscribedbranches : Sample Person |
620 | + +subscribedbranches : Branches for Sample Person : Sample Person |
621 | >>> table = find_tag_by_id(browser.contents, 'branchtable') |
622 | >>> for row in table.tbody.fetch('tr'): |
623 | ... print extract_text(row) |
624 | |
625 | === modified file 'lib/lp/code/stories/branches/xx-product-branches.txt' |
626 | --- lib/lp/code/stories/branches/xx-product-branches.txt 2009-09-01 22:48:24 +0000 |
627 | +++ lib/lp/code/stories/branches/xx-product-branches.txt 2009-09-17 03:12:08 +0000 |
628 | @@ -29,7 +29,7 @@ |
629 | |
630 | >>> browser.open('http://code.launchpad.dev/applets') |
631 | >>> print browser.title |
632 | - Bazaar branches of Gnome Applets |
633 | + Branches for Gnome Applets : Gnome Applets |
634 | |
635 | If there are not any branches, a helpful message is shown. |
636 | |
637 | |
638 | === modified file 'lib/lp/code/stories/branches/xx-project-branches.txt' |
639 | --- lib/lp/code/stories/branches/xx-project-branches.txt 2009-08-17 12:00:46 +0000 |
640 | +++ lib/lp/code/stories/branches/xx-project-branches.txt 2009-09-17 03:12:08 +0000 |
641 | @@ -10,7 +10,7 @@ |
642 | >>> browser.open('http://launchpad.dev/mozilla') |
643 | >>> browser.getLink('Code').click() |
644 | >>> print browser.title |
645 | - Bazaar branches of the Mozilla Project |
646 | + Branches for the Mozilla Project : the Mozilla Project |
647 | |
648 | |
649 | == Default page for code site == |
650 | @@ -35,7 +35,7 @@ |
651 | |
652 | >>> browser.open('http://code.launchpad.dev/aaa') |
653 | >>> print browser.title |
654 | - Bazaar branches of the Test Project |
655 | + Branches for the Test Project : the Test Project |
656 | >>> message = find_tag_by_id(browser.contents, 'no-branch-message') |
657 | >>> print extract_text(message) |
658 | There are no branches registered for the Test Project in Launchpad... |
659 | |
660 | === modified file 'lib/lp/code/stories/branches/xx-register-a-branch.txt' |
661 | --- lib/lp/code/stories/branches/xx-register-a-branch.txt 2009-09-10 20:12:12 +0000 |
662 | +++ lib/lp/code/stories/branches/xx-register-a-branch.txt 2009-09-17 03:12:08 +0000 |
663 | @@ -7,7 +7,7 @@ |
664 | >>> browser.open('http://code.launchpad.dev/') |
665 | >>> browser.getLink('Register a branch').click() |
666 | >>> print browser.title |
667 | - +addbranch : Sample Person |
668 | + +addbranch : Branches for Sample Person : Sample Person |
669 | |
670 | Clicking the link as an anonymous user should take you to a login page. Once |
671 | you've logged in, you should be redirected to the registration page. |
672 | @@ -22,4 +22,4 @@ |
673 | >>> anon_browser.getControl('Password').value = 'test' |
674 | >>> anon_browser.getControl('Log In').click() |
675 | >>> print anon_browser.title |
676 | - +addbranch : Sample Person |
677 | + +addbranch : Branches for Sample Person : Sample Person |
678 | |
679 | === modified file 'lib/lp/code/stories/branches/xx-source-package-branches-empty.txt' |
680 | --- lib/lp/code/stories/branches/xx-source-package-branches-empty.txt 2009-09-10 20:12:12 +0000 |
681 | +++ lib/lp/code/stories/branches/xx-source-package-branches-empty.txt 2009-09-17 03:44:41 +0000 |
682 | @@ -22,8 +22,6 @@ |
683 | This takes us to the branch listing for that source package |
684 | |
685 | >>> browser.open(source_package_url) |
686 | - >>> browser.title |
687 | - '\xe2\x80\x9cfoo\xe2\x80\x9d package : 9.0 : distro' |
688 | |
689 | Since there are no branches, there is no branch listing table: |
690 | |
691 | @@ -36,8 +34,6 @@ |
692 | Listings of distribution source packages also just show a message. |
693 | |
694 | >>> browser.open("http://code.launchpad.dev/distro/+source/foo") |
695 | - >>> browser.title |
696 | - '\xe2\x80\x9cfoo\xe2\x80\x9d package : distro' |
697 | |
698 | Since there are no branches, there is no branch listing table: |
699 | |
700 | |
701 | === modified file 'lib/lp/code/stories/branches/xx-source-package-branches-listing.txt' |
702 | --- lib/lp/code/stories/branches/xx-source-package-branches-listing.txt 2009-09-10 20:12:12 +0000 |
703 | +++ lib/lp/code/stories/branches/xx-source-package-branches-listing.txt 2009-09-17 03:44:41 +0000 |
704 | @@ -27,8 +27,6 @@ |
705 | This takes us to the branch listing for that source package |
706 | |
707 | >>> browser.open(source_package_url) |
708 | - >>> browser.title |
709 | - '\xe2\x80\x9cfoo\xe2\x80\x9d package : 9.0 : distro' |
710 | |
711 | Both of the branches we made appear in the listing. |
712 | |
713 | |
714 | === modified file 'lib/lp/code/templates/branchmergeproposal-index.pt' |
715 | --- lib/lp/code/templates/branchmergeproposal-index.pt 2009-09-04 15:51:56 +0000 |
716 | +++ lib/lp/code/templates/branchmergeproposal-index.pt 2009-09-17 02:17:15 +0000 |
717 | @@ -23,26 +23,15 @@ |
718 | </metal:block> |
719 | |
720 | |
721 | -<metal:side fill-slot="side"> |
722 | - <div class="portlet" tal:define="link context/menu:context/resubmit" |
723 | - tal:condition="link/enabled" |
724 | - tal:content="structure link/render"> |
725 | - Resubmit proposal |
726 | - </div> |
727 | +<metal:side fill-slot="side" |
728 | + tal:define="context_menu context/menu:context"> |
729 | + |
730 | + <tal:menu replace="structure view/@@+global-actions" /> |
731 | <div tal:replace="structure context/@@+pagelet-subscribers" /> |
732 | </metal:side> |
733 | |
734 | |
735 | -<div metal:fill-slot="main" |
736 | - tal:define="context_menu context/menu:context"> |
737 | - |
738 | - <h1>Proposal to merge branch |
739 | - <a tal:define="link context_menu/delete" |
740 | - tal:condition="link/enabled" |
741 | - tal:attributes="href link/url" |
742 | - ><img src="/@@/trash-icon" tal:attributes="title link/text; alt link/text" /> |
743 | - </a> |
744 | -</h1> |
745 | +<div metal:fill-slot="main"> |
746 | |
747 | <div id="nonportlets"> |
748 | |
749 | |
750 | === modified file 'lib/lp/code/templates/distributionsourcepackage-branches-grouped.pt' |
751 | --- lib/lp/code/templates/distributionsourcepackage-branches-grouped.pt 2009-08-13 04:08:38 +0000 |
752 | +++ lib/lp/code/templates/distributionsourcepackage-branches-grouped.pt 2009-09-17 02:17:15 +0000 |
753 | @@ -8,9 +8,6 @@ |
754 | |
755 | <body> |
756 | |
757 | - <h1 metal:fill-slot="heading" |
758 | - tal:content="view/heading">Bazaar branches</h1> |
759 | - |
760 | <div metal:fill-slot="main"> |
761 | |
762 | <tal:no-branches condition="not: view/branch_count"> |
763 | |
764 | === modified file 'lib/lp/code/templates/generic-branch-listing.pt' |
765 | --- lib/lp/code/templates/generic-branch-listing.pt 2009-08-13 04:08:38 +0000 |
766 | +++ lib/lp/code/templates/generic-branch-listing.pt 2009-09-17 00:27:40 +0000 |
767 | @@ -8,9 +8,6 @@ |
768 | |
769 | <body> |
770 | |
771 | - <h1 metal:fill-slot="heading" |
772 | - tal:content="view/heading">Bazaar branches</h1> |
773 | - |
774 | <div metal:fill-slot="main"> |
775 | |
776 | <tal:no-branches condition="not: view/branch_count"> |
777 | |
778 | === modified file 'lib/lp/code/templates/person-branches.pt' |
779 | --- lib/lp/code/templates/person-branches.pt 2009-08-27 05:42:10 +0000 |
780 | +++ lib/lp/code/templates/person-branches.pt 2009-09-17 00:27:40 +0000 |
781 | @@ -9,9 +9,6 @@ |
782 | <body> |
783 | |
784 | |
785 | -<h1 metal:fill-slot="heading" |
786 | - tal:content="view/heading">Bazaar branches</h1> |
787 | - |
788 | <div metal:fill-slot="main" |
789 | tal:define="branches view/branches"> |
790 | |
791 | |
792 | === modified file 'lib/lp/code/templates/personproduct-branches.pt' |
793 | --- lib/lp/code/templates/personproduct-branches.pt 2009-08-27 05:42:10 +0000 |
794 | +++ lib/lp/code/templates/personproduct-branches.pt 2009-09-17 00:27:40 +0000 |
795 | @@ -8,9 +8,6 @@ |
796 | |
797 | <body> |
798 | |
799 | -<h1 metal:fill-slot="heading" |
800 | - tal:content="view/heading">Bazaar branches</h1> |
801 | - |
802 | <div metal:fill-slot="main" |
803 | tal:define="branches view/branches"> |
804 | |
805 | |
806 | === modified file 'lib/lp/code/templates/product-branches.pt' |
807 | --- lib/lp/code/templates/product-branches.pt 2009-08-13 03:27:47 +0000 |
808 | +++ lib/lp/code/templates/product-branches.pt 2009-09-17 00:27:40 +0000 |
809 | @@ -9,9 +9,6 @@ |
810 | |
811 | <body> |
812 | |
813 | -<h1 metal:fill-slot="heading" |
814 | - tal:content="view/heading">Bazaar branches</h1> |
815 | - |
816 | <div metal:fill-slot="main"> |
817 | |
818 | <div style="float:right" id="floating-links" |
819 | |
820 | === modified file 'lib/lp/code/templates/project-branches.pt' |
821 | --- lib/lp/code/templates/project-branches.pt 2009-08-16 02:37:06 +0000 |
822 | +++ lib/lp/code/templates/project-branches.pt 2009-09-17 00:27:40 +0000 |
823 | @@ -8,9 +8,6 @@ |
824 | |
825 | <body> |
826 | |
827 | - <h1 metal:fill-slot="heading" |
828 | - tal:content="view/heading">Bazaar branches</h1> |
829 | - |
830 | <div metal:fill-slot="main" |
831 | tal:define="branches view/branches"> |
832 | |
833 | |
834 | === modified file 'lib/lp/code/templates/sourcepackage-branches.pt' |
835 | --- lib/lp/code/templates/sourcepackage-branches.pt 2009-08-13 04:08:38 +0000 |
836 | +++ lib/lp/code/templates/sourcepackage-branches.pt 2009-09-17 00:27:40 +0000 |
837 | @@ -8,9 +8,6 @@ |
838 | |
839 | <body> |
840 | |
841 | - <h1 metal:fill-slot="heading" |
842 | - tal:content="view/heading">Bazaar branches</h1> |
843 | - |
844 | <div metal:fill-slot="main"> |
845 | |
846 | <tal:branchlisting |
Adds breadcrumbs for anything that IHasBranches, and also breadcrumbs for IBranch and IBranchMergePro posal.
Fixed the Hierarchy so it is more flexible for other objects that use it.
Many story fixes for things that look at the titles.