Merge lp:~salgado/launchpad/person-edit-pages into lp:launchpad

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/person-edit-pages
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~salgado/launchpad/person-edit-pages
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+11089@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

= Summary =

https://bugs.edge.launchpad.net/launchpad-registry/+bug/421978

== Proposed fix ==

Mechanical changes to convert the pages. Screenshots:
http://people.canonical.com/~salgado/project

The UI has been approved by Martin A. already.

== Pre-implementation notes ==

== Implementation details ==

== Tests ==

== 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:
  lib/canonical/launchpad/pagetitles.py
  lib/lp/registry/templates/product-purchase-subscription.pt
  lib/lp/registry/browser/product.py
  lib/lp/registry/templates/product-new.pt
  lib/lp/registry/browser/person.py
  lib/lp/registry/templates/person-vouchers.pt

== Pylint notices ==

lib/lp/registry/browser/product.py
    55: [F0401] Unable to import 'lazr.delegates' (No module named delegates)

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

Revision history for this message
Michael Nelson (michael.nelson) wrote :

r=me

The changes look straight-forward.

I noticed that there are breadcrumbs present for:

https://launchpad.dev/projects/+new

that were not present in your screenshots? Displaying like:

Projects >> +new

I'm not sure why they're not in your screenshots, or whether the +new is the correct way they should display? (I would have expected Projects >> New - if anything) But I'm guessing its a result of something else that you've landed recently, so it's probably right - just check if it's what you expected. I can see even this MP page now has: 'Launchpad itself >> +reply'. (I'll try to catch up on my email and see where it was mentioned!)

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-02 18:02:53 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-02 20:25:33 +0000
@@ -817,9 +817,6 @@
817817
818person_uploaded_packages = ContextDisplayName('Software uploaded by %s')818person_uploaded_packages = ContextDisplayName('Software uploaded by %s')
819819
820person_vouchers = ContextDisplayName(
821 'Commercial subscription vouchers for %s')
822
823pofile_filter = FilteredTranslationsTitle(820pofile_filter = FilteredTranslationsTitle(
824 smartquote('Translations by %(person)s in "%(title)s"'))821 smartquote('Translations by %(person)s in "%(title)s"'))
825822
@@ -876,10 +873,6 @@
876 """Return the view's heading."""873 """Return the view's heading."""
877 return view.heading874 return view.heading
878875
879def product_new(context, view):
880 """Return the view's heading."""
881 return view.heading
882
883product_new_guided = 'Before you register your project...'876product_new_guided = 'Before you register your project...'
884877
885product_packages = ContextDisplayName('%s packages in Launchpad')878product_packages = ContextDisplayName('%s packages in Launchpad')
886879
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2009-09-02 13:28:19 +0000
+++ lib/lp/registry/browser/person.py 2009-09-02 20:29:13 +0000
@@ -1191,7 +1191,8 @@
1191 target = '+add-my-teams'1191 target = '+add-my-teams'
1192 text = 'Add one of my teams'1192 text = 'Add one of my teams'
1193 enabled = True1193 enabled = True
1194 if self.person.subscriptionpolicy == TeamSubscriptionPolicy.RESTRICTED:1194 restricted = TeamSubscriptionPolicy.RESTRICTED
1195 if self.person.subscriptionpolicy == restricted:
1195 # This is a restricted team; users can't join.1196 # This is a restricted team; users can't join.
1196 enabled = False1197 enabled = False
1197 return Link(target, text, icon='add', enabled=enabled)1198 return Link(target, text, icon='add', enabled=enabled)
@@ -1276,9 +1277,10 @@
12761277
1277 def join(self):1278 def join(self):
1278 enabled = True1279 enabled = True
1279 if userIsActiveTeamMember(self.person):1280 person = self.person
1281 if userIsActiveTeamMember(person):
1280 enabled = False1282 enabled = False
1281 if self.person.subscriptionpolicy == TeamSubscriptionPolicy.RESTRICTED:1283 if person.subscriptionpolicy == TeamSubscriptionPolicy.RESTRICTED:
1282 # This is a restricted team; users can't join.1284 # This is a restricted team; users can't join.
1283 enabled = False1285 enabled = False
1284 target = '+join'1286 target = '+join'
@@ -2303,6 +2305,11 @@
23032305
2304 custom_widget('voucher', LaunchpadDropdownWidget)2306 custom_widget('voucher', LaunchpadDropdownWidget)
23052307
2308 @property
2309 def page_title(self):
2310 return ('Commercial subscription vouchers for %s'
2311 % self.context.displayname)
2312
2306 def setUpFields(self):2313 def setUpFields(self):
2307 """Set up the fields for this view."""2314 """Set up the fields for this view."""
23082315
@@ -3125,11 +3132,11 @@
3125 link so that the invitation can be accepted.3132 link so that the invitation can be accepted.
3126 """3133 """
3127 try:3134 try:
3128 return (self.context.super_teams.count() > 03135 return (self.context.super_teams.count() > 0
3129 or (self.context.open_membership_invitations3136 or (self.context.open_membership_invitations
3130 and check_permission('launchpad.Edit', self.context)))3137 and check_permission('launchpad.Edit', self.context)))
3131 except AttributeError, e:3138 except AttributeError, e:
3132 raise AssertionError(e)3139 raise AssertionError(e)
31333140
3134 @property3141 @property
3135 def visibility(self):3142 def visibility(self):
31363143
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2009-08-31 23:45:03 +0000
+++ lib/lp/registry/browser/product.py 2009-09-02 20:25:33 +0000
@@ -1518,7 +1518,7 @@
1518 schema = IProduct1518 schema = IProduct
1519 step_name = 'projectaddstep1'1519 step_name = 'projectaddstep1'
1520 template = ViewPageTemplateFile('../templates/product-new.pt')1520 template = ViewPageTemplateFile('../templates/product-new.pt')
1521 heading = "Register a project in Launchpad"1521 page_title = "Register a project in Launchpad"
15221522
1523 custom_widget('displayname', TextWidget, displayWidth=50, label='Name')1523 custom_widget('displayname', TextWidget, displayWidth=50, label='Name')
1524 custom_widget('name', ProductNameWidget, label='URL')1524 custom_widget('name', ProductNameWidget, label='URL')
@@ -1553,7 +1553,7 @@
1553 schema = IProduct1553 schema = IProduct
1554 step_name = 'projectaddstep2'1554 step_name = 'projectaddstep2'
1555 template = ViewPageTemplateFile('../templates/product-new.pt')1555 template = ViewPageTemplateFile('../templates/product-new.pt')
1556 heading = "Register a project in Launchpad"1556 page_title = "Register a project in Launchpad"
15571557
1558 product = None1558 product = None
15591559
15601560
=== modified file 'lib/lp/registry/templates/person-vouchers.pt'
--- lib/lp/registry/templates/person-vouchers.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/registry/templates/person-vouchers.pt 2009-09-02 20:25:33 +0000
@@ -3,20 +3,18 @@
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_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10 i18n:domain="launchpad"7 i18n:domain="launchpad"
11>8>
12 <body>9 <body>
10 <h1 metal:fill-slot="heading">
11 Redeem Vouchers for Commercial Subscriptions</h1>
12
13 <div metal:fill-slot="main"13 <div metal:fill-slot="main"
14 tal:define="14 tal:define="
15 commercial_projects view/has_commercial_projects;15 commercial_projects view/has_commercial_projects;
16 config modules/canonical.config/config">16 config modules/canonical.config/config">
1717
18 <h1>Redeem Vouchers for Commercial Subscriptions</h1>
19
20 <tal:not_commercial condition="not: commercial_projects">18 <tal:not_commercial condition="not: commercial_projects">
21 <tal:name replace="context/fmt:displayname"/>19 <tal:name replace="context/fmt:displayname"/>
22 does not own any commercial projects. Only project owners can redeem20 does not own any commercial projects. Only project owners can redeem
2321
=== modified file 'lib/lp/registry/templates/product-new.pt'
--- lib/lp/registry/templates/product-new.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/registry/templates/product-new.pt 2009-09-02 20:25:33 +0000
@@ -3,10 +3,7 @@
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_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10>7>
11<body>8<body>
12 <div metal:fill-slot="main">9 <div metal:fill-slot="main">
@@ -256,10 +253,6 @@
256 <div metal:use-macro="context/@@launchpad_form/form">253 <div metal:use-macro="context/@@launchpad_form/form">
257 <metal:step fill-slot="extra_info">254 <metal:step fill-slot="extra_info">
258 <div style="text-align: right;">Not sure what to do?255 <div style="text-align: right;">Not sure what to do?
259 <tal:comment condition="nothing">
260 XXX BarryWarsaw 28-Apr-2009 bug 368910
261 REMOVE THE FOLLOWING BEFORE 2.2.5 PRODUCTION ROLLOUT
262 </tal:comment>
263 <a href="mailto:feedback@launchpad.net">Contact us</a>256 <a href="mailto:feedback@launchpad.net">Contact us</a>
264 </div>257 </div>
265 <h2 class="legend" id="step-title">Step258 <h2 class="legend" id="step-title">Step
266259
=== modified file 'lib/lp/registry/templates/product-purchase-subscription.pt'
--- lib/lp/registry/templates/product-purchase-subscription.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/registry/templates/product-purchase-subscription.pt 2009-09-02 20:25:33 +0000
@@ -3,18 +3,15 @@
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_only"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10 i18n:domain="launchpad"7 i18n:domain="launchpad"
11>8>
129
13<body>10<body>
1411
12<h1 metal:fill-slot="heading">Purchase Project Subscription</h1>
1513
16<div metal:fill-slot="main">14<div metal:fill-slot="main">
17 <h1>Purchase Project Subscription</h1>
18 <div class="error message" id="free-hosting-error"15 <div class="error message" id="free-hosting-error"
19 tal:condition="context/qualifies_for_free_hosting">16 tal:condition="context/qualifies_for_free_hosting">
20 This project does not require a commercial subscription to be purchased.17 This project does not require a commercial subscription to be purchased.
2118