Merge lp:~deryck/launchpad/person-bug-page-ui-update-434794 into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~deryck/launchpad/person-bug-page-ui-update-434794
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~deryck/launchpad/person-bug-page-ui-update-434794
Reviewer Review Type Date Requested Status
Brad Crittenden (community) release-critical Approve
Graham Binns (community) code Approve
Jeroen T. Vermeulen (community) Needs Fixing
Review via email: mp+12275@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

The final template converted! w00t!

This converts the template for displaying a person's bug page and
related bug pages (assigned bugs, commented bugs, etc.) These are just
mechanical changes.

This is tracked at bug 434794.

To demo, visit https://bugs.launchpad.dev/~name16
(or any other user bug page).

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/stories/foaf/xx-person-bugs.txt
  lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt
  lib/lp/bugs/browser/bugtask.py
  lib/lp/registry/browser/person.py

== Pylint notices ==

lib/lp/bugs/browser/bugtask.py
    73: [F0401] Unable to import 'lazr.delegates' (No module named
delegates)
    74: [F0401] Unable to import 'lazr.enum' (No module named enum)
    76: [F0401] Unable to import 'lazr.lifecycle.event' (No module named
lifecycle)
    77: [F0401] Unable to import 'lazr.lifecycle.snapshot' (No module
named lifecycle)
    78: [F0401] Unable to import 'lazr.restful.interface' (No module
named restful)
    79: [F0401] Unable to import 'lazr.restful.interfaces' (No module
named restful)
    149: [F0401] Unable to import 'lazr.restful.interfaces' (No module
named restful)

lib/lp/registry/browser/person.py
    117: [F0401] Unable to import 'lazr.delegates' (No module named
delegates)
    118: [F0401] Unable to import 'lazr.config' (No module named config)
    119: [F0401] Unable to import 'lazr.restful.interface' (No module
named restful)

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Several problems, as discussed on IRC:

 * Don't fill the heading slot. Let the h1 be generated from your view's label, and the title from your breadcrumbs.

 * getSearchPageHeading now provides completely wrong page_title values, so don't use those strings for that. The page_title now goes into the breadcrumbs, so it shouldn't repeat the context it's in. Usually the page_title should be a name ("Deryck H") *or* an action/page type ("Bugs"). It should not repeat anything, so if your breadcrumbs already say "Deryck H » Bugs" then say "Assigned," not "Bugs assigned to Deryck H" in the next one.

 * The getSearchPageHeading strings do look good for labels.

 * I guess there's no time to change this now, but the actions menu is basically a related-pages menu. I don't think it belongs in the sidebar in the new design; it probably ought to be a horizontal line of links at the top or bottom, with an info icon for each.

review: Needs Fixing
Revision history for this message
Deryck Hodge (deryck) wrote :
Download full text (6.6 KiB)

On Wed, Sep 23, 2009 at 7:50 AM, Jeroen T. Vermeulen <email address hidden> wrote:
>  * I guess there's no time to change this now, but the actions menu is basically a related-pages menu.  I don't think it belongs in the sidebar in the new design; it probably ought to be a horizontal line of links at the top or bottom, with an info icon for each.

I thought I followed examples in registry templates for this. If this
needs to be in a grid above the results I can file a bug, but it seems
fine to me as a side bar set. I do know people pages have related
pages in the side in other templates.

Here's an updated diff for everything else:

=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2009-09-23 12:13:38 +0000
+++ lib/lp/bugs/browser/bugtask.py 2009-09-23 13:01:20 +0000
@@ -3325,6 +3325,7 @@
                        "importance", "status"]
     schema = IFrontPageBugTaskSearch
     custom_widget('scope', ProjectScopeWidget)
+ page_title = 'Search'

     def initialize(self):
         """Initialize the view for the request."""
@@ -3359,7 +3360,7 @@
         return "Search all bug reports"

     @property
- def page_title(self):
+ def label(self):
         return self.getSearchPageHeading()

=== modified file 'lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt'
--- lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt 2009-09-23
04:31:16 +0000
+++ lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt 2009-09-23
12:45:16 +0000
@@ -7,8 +7,6 @@
   i18n:domain="launchpad">

 <body>
- <h1 metal:fill-slot="heading" tal:content="view/page_title" />
-
   <div metal:fill-slot="side">
     <tal:menu replace="structure context/@@+global-actions" />
     <div tal:condition="view/shouldShowAssignedToTeamPortlet|nothing"

=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2009-09-23 04:38:00 +0000
+++ lib/lp/registry/browser/person.py 2009-09-23 13:04:10 +0000
@@ -1820,6 +1820,7 @@
     """Bugs reported on packages for a bug subscriber."""

     columns_to_show = ["id", "summary", "importance", "status"]
+ page_title = 'Package bugs'

     @property
     def current_package(self):
@@ -2013,6 +2014,10 @@
     def getSimpleSearchURL(self):
         return self.getBugSubscriberPackageSearchURL()

+ @property
+ def label(self):
+ return self.getSearchPageHeading()
+

 class RelevantMilestonesMixin:
     """Mixin to narrow the milestone list to only relevant milestones."""
@@ -2033,6 +2038,7 @@

     columns_to_show = ["id", "summary", "bugtargetdisplayname",
                        "importance", "status"]
+ page_title = 'Related bugs'

     def searchUnbatched(self, searchtext=None, context=None,
                         extra_params=None):
@@ -2082,7 +2088,7 @@
         return canonical_url(self.context, view_name="+bugs")

     @property
- def page_title(self):
+ def label(self):
         return self.getSearchPageHeading()

@@ -2092,6 +2098,7 @@

     columns_to_show = ["id", "summary", "bugtargetdisplayname",
                        "importance", "status"]
+ page_title = 'Assigned bugs'

     def searchUnbatched(self, search...

Read more...

Revision history for this message
Graham Binns (gmb) :
review: Approve (code)
Revision history for this message
Brad Crittenden (bac) wrote :

Hi Deryck,

Thanks for getting this template converted. The changes Martin suggested are ones we definitely need to include but there is no time to make the current release schedule.

r9566 of your branch is approved for release-critical submission. We'll tackle the other issues immediately afterwards.

Thanks for the hard work.

review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2009-09-20 20:46:39 +0000
+++ lib/lp/bugs/browser/bugtask.py 2009-09-23 12:13:38 +0000
@@ -155,8 +155,8 @@
155 NewLineToSpacesWidget, NominationReviewActionWidget)155 NewLineToSpacesWidget, NominationReviewActionWidget)
156from canonical.widgets.itemswidgets import LabeledMultiCheckBoxWidget156from canonical.widgets.itemswidgets import LabeledMultiCheckBoxWidget
157from canonical.widgets.lazrjs import (157from canonical.widgets.lazrjs import (
158 InlineEditPickerWidget, TextAreaEditorWidget,158 TextAreaEditorWidget, TextLineEditorWidget,
159 TextLineEditorWidget, vocabulary_to_choice_edit_items)159 vocabulary_to_choice_edit_items)
160from canonical.widgets.project import ProjectScopeWidget160from canonical.widgets.project import ProjectScopeWidget
161161
162from lp.registry.vocabularies import MilestoneVocabulary162from lp.registry.vocabularies import MilestoneVocabulary
@@ -1961,7 +1961,8 @@
19611961
1962 @enabled_with_permission('launchpad.Edit')1962 @enabled_with_permission('launchpad.Edit')
1963 def securitycontact(self):1963 def securitycontact(self):
1964 return Link('+securitycontact', 'Change security contact', icon='edit')1964 return Link(
1965 '+securitycontact', 'Change security contact', icon='edit')
19651966
1966 def subscribe(self):1967 def subscribe(self):
1967 return Link('+subscribe', 'Subscribe to bug mail', icon='edit')1968 return Link('+subscribe', 'Subscribe to bug mail', icon='edit')
@@ -3357,6 +3358,10 @@
3357 """Return the heading to search all Bugs."""3358 """Return the heading to search all Bugs."""
3358 return "Search all bug reports"3359 return "Search all bug reports"
33593360
3361 @property
3362 def page_title(self):
3363 return self.getSearchPageHeading()
3364
33603365
3361class BugTaskPrivacyAdapter:3366class BugTaskPrivacyAdapter:
3362 """Provides `IObjectPrivacy` for `IBugTask`."""3367 """Provides `IObjectPrivacy` for `IBugTask`."""
33633368
=== modified file 'lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt'
--- lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/buglisting-embedded-advanced-search.pt 2009-09-23 04:31:16 +0000
@@ -3,23 +3,17 @@
3 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"6 metal:use-macro="view/macro:page/main_side"
7 lang="en"7 i18n:domain="launchpad">
8 dir="ltr"
9 metal:use-macro="context/@@main_template/master"
10 i18n:domain="malone"
11>
128
13<body>9<body>
1410 <h1 metal:fill-slot="heading" tal:content="view/page_title" />
15 <metal:heading fill-slot="pageheading">11
16 <h1 tal:content="view/getSearchPageHeading"></h1>12 <div metal:fill-slot="side">
17 </metal:heading>13 <tal:menu replace="structure context/@@+global-actions" />
1814 <div tal:condition="view/shouldShowAssignedToTeamPortlet|nothing"
19 <metal:leftportlets fill-slot="portlets_one">
20 <div tal:condition="view/shouldShowAssignedToTeamPortlet|nothing"
21 tal:content="structure context/@@+portlet-team-assignedbugs" />15 tal:content="structure context/@@+portlet-team-assignedbugs" />
22 </metal:leftportlets>16 </div>
2317
24 <div metal:fill-slot="main">18 <div metal:fill-slot="main">
25 <tal:do_not_show_advanced_form19 <tal:do_not_show_advanced_form
@@ -36,8 +30,6 @@
36 use-macro="context/@@+bugtask-macros-tableview/advanced_search_form" />30 use-macro="context/@@+bugtask-macros-tableview/advanced_search_form" />
37 </tal:show_advanced>31 </tal:show_advanced>
38 <div class="visualClear">&nbsp;</div>32 <div class="visualClear">&nbsp;</div>
39
40 </div>33 </div>
41
42</body>34</body>
43</html>35</html>
4436
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2009-09-22 15:02:41 +0000
+++ lib/lp/registry/browser/person.py 2009-09-23 04:38:00 +0000
@@ -2081,6 +2081,10 @@
2081 def getSimpleSearchURL(self):2081 def getSimpleSearchURL(self):
2082 return canonical_url(self.context, view_name="+bugs")2082 return canonical_url(self.context, view_name="+bugs")
20832083
2084 @property
2085 def page_title(self):
2086 return self.getSearchPageHeading()
2087
20842088
2085class PersonAssignedBugTaskSearchListingView(RelevantMilestonesMixin,2089class PersonAssignedBugTaskSearchListingView(RelevantMilestonesMixin,
2086 BugTaskSearchListingView):2090 BugTaskSearchListingView):
@@ -2133,6 +2137,10 @@
2133 """Return a URL that can be usedas an href to the simple search."""2137 """Return a URL that can be usedas an href to the simple search."""
2134 return canonical_url(self.context, view_name="+assignedbugs")2138 return canonical_url(self.context, view_name="+assignedbugs")
21352139
2140 @property
2141 def page_title(self):
2142 return self.getSearchPageHeading()
2143
21362144
2137class PersonCommentedBugTaskSearchListingView(RelevantMilestonesMixin,2145class PersonCommentedBugTaskSearchListingView(RelevantMilestonesMixin,
2138 BugTaskSearchListingView):2146 BugTaskSearchListingView):
@@ -2173,6 +2181,10 @@
2173 """Return a URL that can be used as an href to the simple search."""2181 """Return a URL that can be used as an href to the simple search."""
2174 return canonical_url(self.context, view_name="+commentedbugs")2182 return canonical_url(self.context, view_name="+commentedbugs")
21752183
2184 @property
2185 def page_title(self):
2186 return self.getSearchPageHeading()
2187
21762188
2177class PersonReportedBugTaskSearchListingView(RelevantMilestonesMixin,2189class PersonReportedBugTaskSearchListingView(RelevantMilestonesMixin,
2178 BugTaskSearchListingView):2190 BugTaskSearchListingView):
@@ -2224,6 +2236,10 @@
2224 """Should the tags combinator widget show on the search page?"""2236 """Should the tags combinator widget show on the search page?"""
2225 return False2237 return False
22262238
2239 @property
2240 def page_title(self):
2241 return self.getSearchPageHeading()
2242
22272243
2228class PersonSubscribedBugTaskSearchListingView(RelevantMilestonesMixin,2244class PersonSubscribedBugTaskSearchListingView(RelevantMilestonesMixin,
2229 BugTaskSearchListingView):2245 BugTaskSearchListingView):
@@ -2264,6 +2280,10 @@
2264 """Return a URL that can be used as an href to the simple search."""2280 """Return a URL that can be used as an href to the simple search."""
2265 return canonical_url(self.context, view_name="+subscribedbugs")2281 return canonical_url(self.context, view_name="+subscribedbugs")
22662282
2283 @property
2284 def page_title(self):
2285 return self.getSearchPageHeading()
2286
22672287
2268class PersonVouchersView(LaunchpadFormView):2288class PersonVouchersView(LaunchpadFormView):
2269 """Form for displaying and redeeming commercial subscription vouchers."""2289 """Form for displaying and redeeming commercial subscription vouchers."""
22702290
=== modified file 'lib/lp/registry/stories/foaf/xx-person-bugs.txt'
--- lib/lp/registry/stories/foaf/xx-person-bugs.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/registry/stories/foaf/xx-person-bugs.txt 2009-09-23 04:36:10 +0000
@@ -60,7 +60,7 @@
6060
61 >>> anon_browser.getLink('List assigned bugs').click()61 >>> anon_browser.getLink('List assigned bugs').click()
62 >>> print anon_browser.title62 >>> print anon_browser.title
63 Bugs assigned to Sample Person63 Bugs assigned to Sample Person : Sample Person
64 >>> print anon_browser.url64 >>> print anon_browser.url
65 http://bugs.launchpad.dev/~name12/+assignedbugs65 http://bugs.launchpad.dev/~name12/+assignedbugs
6666
@@ -77,7 +77,7 @@
7777
78 >>> anon_browser.getLink('List commented bugs').click()78 >>> anon_browser.getLink('List commented bugs').click()
79 >>> print anon_browser.title79 >>> print anon_browser.title
80 Bugs commented on by Sample Person80 Bugs commented on by Sample Person : Sample Person
81 >>> print anon_browser.url81 >>> print anon_browser.url
82 http://bugs.launchpad.dev/~name12/+commentedbugs82 http://bugs.launchpad.dev/~name12/+commentedbugs
8383
@@ -98,7 +98,7 @@
9898
99 >>> anon_browser.getLink('List reported bugs').click()99 >>> anon_browser.getLink('List reported bugs').click()
100 >>> print anon_browser.title100 >>> print anon_browser.title
101 Bugs reported by Sample Person101 Bugs reported by Sample Person : Sample Person
102 >>> print anon_browser.url102 >>> print anon_browser.url
103 http://bugs.launchpad.dev/~name12/+reportedbugs103 http://bugs.launchpad.dev/~name12/+reportedbugs
104104
@@ -127,7 +127,7 @@
127127
128 >>> anon_browser.getLink('List subscribed bugs').click()128 >>> anon_browser.getLink('List subscribed bugs').click()
129 >>> print anon_browser.title129 >>> print anon_browser.title
130 Bugs Sample Person is subscribed to130 Bugs Sample Person is subscribed to : Sample Person
131 >>> print anon_browser.url131 >>> print anon_browser.url
132 http://bugs.launchpad.dev/~name12/+subscribedbugs132 http://bugs.launchpad.dev/~name12/+subscribedbugs
133133