← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/code-headings into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/code-headings into lp:launchpad.

Commit message:
Drop unnecessary information from +branches/+activereviews in-page headings. A lot of the headings die entirely, as the watemark says everything.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/code-headings/+merge/243933

Drop unnecessary information from +branches/+activereviews in-page headings. A lot of the headings die entirely, as the watemark says everything.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/code-headings into lp:launchpad.
=== modified file 'lib/lp/code/browser/branchlisting.py'
--- lib/lp/code/browser/branchlisting.py	2014-12-06 12:53:32 +0000
+++ lib/lp/code/browser/branchlisting.py	2014-12-08 01:32:36 +0000
@@ -533,7 +533,6 @@
     # shown in the branch listings.
     show_series_links = False
     extra_columns = []
-    label_template = 'Bazaar branches for %(displayname)s'
     # no_sort_by is a sequence of items from the BranchListingSort
     # enumeration to not offer in the sort_by widget.
     no_sort_by = ()
@@ -550,18 +549,6 @@
         PersonRevisionsFeedLink,
         )
 
-    @property
-    def label(self):
-        return self.label_template % {
-            'displayname': self.context.displayname,
-            'title': getattr(self.context, 'title', 'no-title')}
-
-    @property
-    def page_title(self):
-        """Provide a default for distros and other things without breadcrumbs.
-        """
-        return self.label
-
     table_only_template = ViewPageTemplateFile(
         '../templates/branches-table-include.pt')
 
@@ -949,7 +936,6 @@
     field_names = ['category', 'lifecycle', 'sort_by']
     custom_widget('category', LaunchpadDropdownWidget)
 
-    page_title = label = None
     no_sort_by = (BranchListingSort.DEFAULT, BranchListingSort.OWNER)
 
     @property
@@ -970,7 +956,6 @@
 class PersonProductBranchesView(PersonBranchesView):
     """Branch listing for a person's branches of a product."""
 
-    label_template = 'Branches of %(product)s for %(person)s'
     no_sort_by = (
         BranchListingSort.DEFAULT, BranchListingSort.OWNER,
         BranchListingSort.PRODUCT)
@@ -983,9 +968,7 @@
 
     @property
     def label(self):
-        return self.label_template % {
-            'person': self.context.person.displayname,
-            'product': self.context.product.displayname}
+        return 'Branches of %s' % self.context.product.displayname
 
     @property
     def no_branch_message(self):
@@ -1102,7 +1085,6 @@
 
     show_series_links = True
     no_sort_by = (BranchListingSort.PRODUCT, )
-    label_template = 'Bazaar branches of %(displayname)s'
 
     def _getCollection(self):
         return getUtility(IAllBranches).inProduct(self.context)
@@ -1351,7 +1333,6 @@
 
     no_sort_by = (BranchListingSort.DEFAULT, )
     extra_columns = ('author', 'product')
-    label_template = 'Bazaar branches of %(displayname)s'
     show_series_links = True
 
     def _getCollection(self):
@@ -1391,8 +1372,6 @@
 class DistributionSourcePackageBranchesView(BaseSourcePackageBranchesView):
     """A general listing of all branches in the distro source package."""
 
-    label_template = 'Bazaar branches for %(title)s'
-
     def _getCollection(self):
         return getUtility(IAllBranches).inDistributionSourcePackage(
             self.context)
@@ -1408,6 +1387,10 @@
 class DistroSeriesBranchListingView(BaseSourcePackageBranchesView):
     """A general listing of all branches in the distro source package."""
 
+    @property
+    def label(self):
+        return 'Branches for %s' % self.context.displayname
+
     def _getCollection(self):
         return getUtility(IAllBranches).inDistroSeries(self.context)
 
@@ -1416,12 +1399,6 @@
                                                    BranchListingItemsMixin):
     """A view that groups branches into distro series."""
 
-    @property
-    def label(self):
-        return 'Bazaar branches for %s' % self.context.title
-
-    page_title = label
-
     def __init__(self, context, request):
         LaunchpadView.__init__(self, context, request)
         BranchListingItemsMixin.__init__(self, self.user)
@@ -1575,7 +1552,9 @@
 
 class SourcePackageBranchesView(BranchListingView):
 
-    label_template = 'Bazaar branches of %(displayname)s'
+    @property
+    def label(self):
+        return 'Branches for %s' % self.context.distroseries.displayname
 
     # XXX: JonathanLange 2009-03-03 spec=package-branches: This page has no
     # menu yet -- do we need one?

=== modified file 'lib/lp/code/browser/branchmergeproposallisting.py'
--- lib/lp/code/browser/branchmergeproposallisting.py	2013-03-04 04:17:17 +0000
+++ lib/lp/code/browser/branchmergeproposallisting.py	2014-12-08 01:32:36 +0000
@@ -34,6 +34,7 @@
     custom_widget,
     LaunchpadFormView,
     )
+from lp.app.interfaces.launchpad import IHeadingContext
 from lp.app.widgets.itemswidgets import LaunchpadDropdownWidget
 from lp.code.enums import (
     BranchMergeProposalStatus,
@@ -209,10 +210,14 @@
     extra_columns = []
     _queue_status = None
 
+    page_title = 'Merge proposals'
+
     @property
-    def page_title(self):
-        return "Merge Proposals for %s" % self.context.displayname
-    label = page_title
+    def label(self):
+        if IHeadingContext.providedBy(self.context):
+            return self.page_title
+        else:
+            return "%s for %s" % (self.page_title, self.context.displayname)
 
     @property
     def initial_values(self):
@@ -267,6 +272,8 @@
 class ActiveReviewsView(BranchMergeProposalListingView):
     """Branch merge proposals for a context that are needing review."""
 
+    page_title = "Active reviews"
+
     show_diffs = False
 
     # The grouping classifications.
@@ -405,12 +412,6 @@
         return headings
 
     @property
-    def heading(self):
-        return "Active code reviews for %s" % self.context.displayname
-
-    page_title = heading
-
-    @property
     def no_proposal_message(self):
         """Shown when there is no table to show."""
         return "%s has no active code reviews." % self.context.displayname
@@ -450,6 +451,11 @@
 class PersonProductActiveReviewsView(PersonActiveReviewsView):
     """Active reviews for a person in a product."""
 
+    @property
+    def label(self):
+        return '%s for %s' % (
+            self.page_title, self.context.product.displayname)
+
     def _getReviewer(self):
         return self.context.person
 
@@ -457,13 +463,6 @@
         return getUtility(IAllBranches).inProduct(self.context.product)
 
     @property
-    def heading(self):
-        return "Active code reviews of %s for %s" % (
-            self.context.product.displayname, self.context.person.displayname)
-
-    page_title = heading
-
-    @property
     def no_proposal_message(self):
         """Shown when there is no table to show."""
         return "%s has no active code reviews for %s." % (

=== modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
--- lib/lp/code/browser/tests/test_branchlisting.py	2014-12-06 10:45:17 +0000
+++ lib/lp/code/browser/tests/test_branchlisting.py	2014-12-08 01:32:36 +0000
@@ -404,9 +404,7 @@
         self.makeABranch()
         page = self.get_branch_list_page()
         h1_matcher = soupmatchers.HTMLContains(
-            soupmatchers.Tag(
-                'Title', 'h1',
-                text='Branches of Bambam for Barney'))
+            soupmatchers.Tag('Title', 'h1', text='Branches of Bambam'))
         self.assertThat(page, h1_matcher)
 
     def test_branch_list_empty(self):

=== modified file 'lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt'
--- lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt	2014-12-06 10:45:17 +0000
+++ lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt	2014-12-08 01:32:36 +0000
@@ -17,7 +17,7 @@
 
 Make a trunk branch and set as the development focus branch.
 
-    >>> trunk = factory.makeProductBranch(product=fooix)
+    >>> trunk = factory.makeProductBranch(product=fooix, name='trunk')
     >>> fooix.development_focus.branch = trunk
 
 Make a single proposal for albert that is needing review by robert.
@@ -69,7 +69,7 @@
 
     >>> browser.getLink('active reviews').click()
     >>> print browser.title
-    Active code reviews for Fooix...
+    Active reviews : Code : Fooix
 
 The proposals are listed in a table that shows the source and target branches,
 who requested the merge, the date the review was requested, and the vote
@@ -147,7 +147,7 @@
 
     >>> browser.getLink('3 branches').click()
     >>> print browser.title
-    Active code reviews for lp://dev/fooix ...
+    Active reviews : trunk : Code : Fooix
 
 
 Line counts

=== modified file 'lib/lp/code/templates/active-reviews.pt'
--- lib/lp/code/templates/active-reviews.pt	2010-01-14 23:19:13 +0000
+++ lib/lp/code/templates/active-reviews.pt	2014-12-08 01:32:36 +0000
@@ -8,8 +8,6 @@
 
 <body>
 
-<h1 metal:fill-slot="heading" tal:content="view/heading" />
-
 <div metal:fill-slot="main">
 
   <tal:has-proposals condition="view/proposal_count"


Follow ups