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
1=== modified file 'lib/canonical/launchpad/pagetitles.py'
2--- lib/canonical/launchpad/pagetitles.py 2009-09-02 18:02:53 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-09-02 20:25:33 +0000
4@@ -817,9 +817,6 @@
5
6 person_uploaded_packages = ContextDisplayName('Software uploaded by %s')
7
8-person_vouchers = ContextDisplayName(
9- 'Commercial subscription vouchers for %s')
10-
11 pofile_filter = FilteredTranslationsTitle(
12 smartquote('Translations by %(person)s in "%(title)s"'))
13
14@@ -876,10 +873,6 @@
15 """Return the view's heading."""
16 return view.heading
17
18-def product_new(context, view):
19- """Return the view's heading."""
20- return view.heading
21-
22 product_new_guided = 'Before you register your project...'
23
24 product_packages = ContextDisplayName('%s packages in Launchpad')
25
26=== modified file 'lib/lp/registry/browser/person.py'
27--- lib/lp/registry/browser/person.py 2009-09-02 13:28:19 +0000
28+++ lib/lp/registry/browser/person.py 2009-09-02 20:29:13 +0000
29@@ -1191,7 +1191,8 @@
30 target = '+add-my-teams'
31 text = 'Add one of my teams'
32 enabled = True
33- if self.person.subscriptionpolicy == TeamSubscriptionPolicy.RESTRICTED:
34+ restricted = TeamSubscriptionPolicy.RESTRICTED
35+ if self.person.subscriptionpolicy == restricted:
36 # This is a restricted team; users can't join.
37 enabled = False
38 return Link(target, text, icon='add', enabled=enabled)
39@@ -1276,9 +1277,10 @@
40
41 def join(self):
42 enabled = True
43- if userIsActiveTeamMember(self.person):
44+ person = self.person
45+ if userIsActiveTeamMember(person):
46 enabled = False
47- if self.person.subscriptionpolicy == TeamSubscriptionPolicy.RESTRICTED:
48+ if person.subscriptionpolicy == TeamSubscriptionPolicy.RESTRICTED:
49 # This is a restricted team; users can't join.
50 enabled = False
51 target = '+join'
52@@ -2303,6 +2305,11 @@
53
54 custom_widget('voucher', LaunchpadDropdownWidget)
55
56+ @property
57+ def page_title(self):
58+ return ('Commercial subscription vouchers for %s'
59+ % self.context.displayname)
60+
61 def setUpFields(self):
62 """Set up the fields for this view."""
63
64@@ -3125,11 +3132,11 @@
65 link so that the invitation can be accepted.
66 """
67 try:
68- return (self.context.super_teams.count() > 0
69- or (self.context.open_membership_invitations
70- and check_permission('launchpad.Edit', self.context)))
71+ return (self.context.super_teams.count() > 0
72+ or (self.context.open_membership_invitations
73+ and check_permission('launchpad.Edit', self.context)))
74 except AttributeError, e:
75- raise AssertionError(e)
76+ raise AssertionError(e)
77
78 @property
79 def visibility(self):
80
81=== modified file 'lib/lp/registry/browser/product.py'
82--- lib/lp/registry/browser/product.py 2009-08-31 23:45:03 +0000
83+++ lib/lp/registry/browser/product.py 2009-09-02 20:25:33 +0000
84@@ -1518,7 +1518,7 @@
85 schema = IProduct
86 step_name = 'projectaddstep1'
87 template = ViewPageTemplateFile('../templates/product-new.pt')
88- heading = "Register a project in Launchpad"
89+ page_title = "Register a project in Launchpad"
90
91 custom_widget('displayname', TextWidget, displayWidth=50, label='Name')
92 custom_widget('name', ProductNameWidget, label='URL')
93@@ -1553,7 +1553,7 @@
94 schema = IProduct
95 step_name = 'projectaddstep2'
96 template = ViewPageTemplateFile('../templates/product-new.pt')
97- heading = "Register a project in Launchpad"
98+ page_title = "Register a project in Launchpad"
99
100 product = None
101
102
103=== modified file 'lib/lp/registry/templates/person-vouchers.pt'
104--- lib/lp/registry/templates/person-vouchers.pt 2009-07-17 17:59:07 +0000
105+++ lib/lp/registry/templates/person-vouchers.pt 2009-09-02 20:25:33 +0000
106@@ -3,20 +3,18 @@
107 xmlns:tal="http://xml.zope.org/namespaces/tal"
108 xmlns:metal="http://xml.zope.org/namespaces/metal"
109 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
110- xml:lang="en"
111- lang="en"
112- dir="ltr"
113- metal:use-macro="view/macro:page/onecolumn"
114+ metal:use-macro="view/macro:page/main_only"
115 i18n:domain="launchpad"
116 >
117 <body>
118+ <h1 metal:fill-slot="heading">
119+ Redeem Vouchers for Commercial Subscriptions</h1>
120+
121 <div metal:fill-slot="main"
122 tal:define="
123 commercial_projects view/has_commercial_projects;
124 config modules/canonical.config/config">
125
126- <h1>Redeem Vouchers for Commercial Subscriptions</h1>
127-
128 <tal:not_commercial condition="not: commercial_projects">
129 <tal:name replace="context/fmt:displayname"/>
130 does not own any commercial projects. Only project owners can redeem
131
132=== modified file 'lib/lp/registry/templates/product-new.pt'
133--- lib/lp/registry/templates/product-new.pt 2009-07-17 17:59:07 +0000
134+++ lib/lp/registry/templates/product-new.pt 2009-09-02 20:25:33 +0000
135@@ -3,10 +3,7 @@
136 xmlns:tal="http://xml.zope.org/namespaces/tal"
137 xmlns:metal="http://xml.zope.org/namespaces/metal"
138 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
139- xml:lang="en"
140- lang="en"
141- dir="ltr"
142- metal:use-macro="view/macro:page/onecolumn"
143+ metal:use-macro="view/macro:page/main_only"
144 >
145 <body>
146 <div metal:fill-slot="main">
147@@ -256,10 +253,6 @@
148 <div metal:use-macro="context/@@launchpad_form/form">
149 <metal:step fill-slot="extra_info">
150 <div style="text-align: right;">Not sure what to do?
151- <tal:comment condition="nothing">
152- XXX BarryWarsaw 28-Apr-2009 bug 368910
153- REMOVE THE FOLLOWING BEFORE 2.2.5 PRODUCTION ROLLOUT
154- </tal:comment>
155 <a href="mailto:feedback@launchpad.net">Contact us</a>
156 </div>
157 <h2 class="legend" id="step-title">Step
158
159=== modified file 'lib/lp/registry/templates/product-purchase-subscription.pt'
160--- lib/lp/registry/templates/product-purchase-subscription.pt 2009-07-17 17:59:07 +0000
161+++ lib/lp/registry/templates/product-purchase-subscription.pt 2009-09-02 20:25:33 +0000
162@@ -3,18 +3,15 @@
163 xmlns:tal="http://xml.zope.org/namespaces/tal"
164 xmlns:metal="http://xml.zope.org/namespaces/metal"
165 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
166- xml:lang="en"
167- lang="en"
168- dir="ltr"
169- metal:use-macro="view/macro:page/onecolumn"
170+ metal:use-macro="view/macro:page/main_only"
171 i18n:domain="launchpad"
172 >
173
174 <body>
175
176+<h1 metal:fill-slot="heading">Purchase Project Subscription</h1>
177
178 <div metal:fill-slot="main">
179- <h1>Purchase Project Subscription</h1>
180 <div class="error message" id="free-hosting-error"
181 tal:condition="context/qualifies_for_free_hosting">
182 This project does not require a commercial subscription to be purchased.
183