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
Gavin Panella (community) code Approve
Review via email: mp+11008@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

= Summary =

Convert form pages to add/edit members of a team.

== Proposed fix ==

JFD the mechanical conversion. Screenshots at
http://people.canonical.com/~salgado/members/
UI already reviewed by Martin 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/lp/registry/browser/configure.zcml
  lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt
  lib/canonical/launchpad/pagetitles.py
  lib/lp/registry/templates/team-editproposed.pt
  lib/lp/registry/templates/team-add-my-teams.pt
  lib/lp/registry/browser/team.py
  lib/lp/registry/browser/person.py

== Pylint notices ==

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

Revision history for this message
Gavin Panella (allenap) :
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-01 11:09:53 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-09-01 19:43:30 +0000
4@@ -1177,12 +1177,6 @@
5
6 standardshipitrequest_edit = 'Edit standard option'
7
8-team_addmember = ContextBrowsername('Add members to %s')
9-
10-team_add_my_teams = 'Propose/add one of your teams to another one'
11-
12-team_editproposed = ContextBrowsername('Proposed members of %s')
13-
14 team_index = ContextBrowsername('%s in Launchpad')
15
16 team_invitations = ContextBrowsername("Invitations sent to %s")
17
18=== modified file 'lib/lp/registry/browser/configure.zcml'
19--- lib/lp/registry/browser/configure.zcml 2009-09-01 00:21:10 +0000
20+++ lib/lp/registry/browser/configure.zcml 2009-09-01 18:39:43 +0000
21@@ -1152,7 +1152,7 @@
22 for="lp.registry.interfaces.person.ITeam"
23 class="canonical.launchpad.browser.TeamMemberAddView"
24 permission="launchpad.Edit"
25- template="../templates/team-addmember.pt"/>
26+ template="../../app/templates/generic-edit.pt"/>
27 <browser:page
28 name="+editproposedmembers"
29 for="lp.registry.interfaces.person.ITeam"
30
31=== modified file 'lib/lp/registry/browser/person.py'
32--- lib/lp/registry/browser/person.py 2009-08-31 22:11:14 +0000
33+++ lib/lp/registry/browser/person.py 2009-09-01 19:43:30 +0000
34@@ -3791,6 +3791,7 @@
35 class TeamAddMyTeamsView(LaunchpadFormView):
36 """Propose/add to this team any team that you're an administrator of."""
37
38+ page_title = 'Propose/add one of your teams to another one'
39 custom_widget('teams', LabeledMultiCheckBoxWidget)
40
41 def initialize(self):
42@@ -3838,11 +3839,10 @@
43 candidates.append(team)
44 return candidates
45
46- @action(_("Cancel"), name="cancel",
47- validator=LaunchpadFormView.validate_none)
48- def cancel_action(self, action, data):
49- """Simply redirect to the team's page."""
50- pass
51+ @property
52+ def cancel_url(self):
53+ """The return URL."""
54+ return canonical_url(self.context)
55
56 def validate(self, data):
57 if len(data.get('teams', [])) == 0:
58
59=== modified file 'lib/lp/registry/browser/team.py'
60--- lib/lp/registry/browser/team.py 2009-08-31 20:16:30 +0000
61+++ lib/lp/registry/browser/team.py 2009-09-01 19:43:30 +0000
62@@ -918,9 +918,15 @@
63 comment=self.request.form.get('comment'))
64
65 @property
66+ def page_title(self):
67+ return 'Proposed members of %s' % self.context.displayname
68+
69+ @property
70 def next_url(self):
71 return '%s/+members' % canonical_url(self.context)
72
73+ cancel_url = next_url
74+
75
76 class TeamBrandingView(BrandingChangeView):
77
78@@ -943,6 +949,14 @@
79 schema = ITeamMember
80 label = "Select the new member"
81
82+ @property
83+ def page_title(self):
84+ return 'Add members to %s' % self.context.displayname
85+
86+ @property
87+ def cancel_url(self):
88+ return canonical_url(self.context)
89+
90 def validate(self, data):
91 """Verify new member.
92
93
94=== modified file 'lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt'
95--- lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt 2009-06-16 20:17:00 +0000
96+++ lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt 2009-09-01 19:49:25 +0000
97@@ -16,12 +16,14 @@
98 The proposal will have to be reviewed by a team administrator.
99
100 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
101+ Ubuntu Team
102 Propose these teams as members
103 This is a moderated team, so one of its administrators will have
104 to review any memberships you propose.
105 Launchpad Administrators
106 Mailing List Experts
107 Rosetta Administrators
108+ or Cancel
109
110 We'll now propose Launchpad Administrators as a member of Ubuntu Team.
111
112@@ -78,6 +80,7 @@
113
114 >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams')
115 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
116+ Ubuntu Team
117 This is a restricted team
118 New members can not be proposed&mdash;they can only be added by one
119 of the team's administrators.
120@@ -122,5 +125,5 @@
121
122 >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams')
123 >>> print extract_text(find_main_content(browser.contents))
124+ Ubuntu Team
125 None of the teams you administer can be added to this team.
126-
127
128=== modified file 'lib/lp/registry/templates/team-add-my-teams.pt'
129--- lib/lp/registry/templates/team-add-my-teams.pt 2009-07-17 17:59:07 +0000
130+++ lib/lp/registry/templates/team-add-my-teams.pt 2009-09-01 19:43:30 +0000
131@@ -3,15 +3,10 @@
132 xmlns:tal="http://xml.zope.org/namespaces/tal"
133 xmlns:metal="http://xml.zope.org/namespaces/metal"
134 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
135- xml:lang="en"
136- lang="en"
137- dir="ltr"
138- metal:use-macro="context/@@main_template/master"
139+ metal:use-macro="view/macro:page/main_only"
140 i18n:domain="launchpad"
141 >
142 <body>
143- <metal:portlets fill-slot="portlets" />
144-
145 <div metal:fill-slot="main">
146 <p tal:condition="not: view/candidate_teams">
147 None of the teams you administer can be added to this team.
148
149=== removed file 'lib/lp/registry/templates/team-addmember.pt'
150--- lib/lp/registry/templates/team-addmember.pt 2009-07-17 17:59:07 +0000
151+++ lib/lp/registry/templates/team-addmember.pt 1970-01-01 00:00:00 +0000
152@@ -1,20 +0,0 @@
153-<html
154- xmlns="http://www.w3.org/1999/xhtml"
155- xmlns:tal="http://xml.zope.org/namespaces/tal"
156- xmlns:metal="http://xml.zope.org/namespaces/metal"
157- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
158- xml:lang="en"
159- lang="en"
160- dir="ltr"
161- metal:use-macro="context/@@main_template/master"
162- i18n:domain="launchpad"
163->
164-
165- <body>
166- <div metal:fill-slot="main">
167- <div metal:use-macro="context/@@launchpad_form/form" />
168- </div>
169- </body>
170-
171-</html>
172-
173
174=== modified file 'lib/lp/registry/templates/team-editproposed.pt'
175--- lib/lp/registry/templates/team-editproposed.pt 2009-07-17 17:59:07 +0000
176+++ lib/lp/registry/templates/team-editproposed.pt 2009-09-01 19:43:30 +0000
177@@ -1,18 +1,9 @@
178-<tal:root
179- xmlns:tal="http://xml.zope.org/namespaces/tal"
180- xmlns:metal="http://xml.zope.org/namespaces/metal"
181- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
182- omit-tag="">
183-
184 <html
185 xmlns="http://www.w3.org/1999/xhtml"
186 xmlns:tal="http://xml.zope.org/namespaces/tal"
187 xmlns:metal="http://xml.zope.org/namespaces/metal"
188 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
189- xml:lang="en"
190- lang="en"
191- dir="ltr"
192- metal:use-macro="context/@@main_template/master"
193+ metal:use-macro="view/macro:page/main_only"
194 i18n:domain="launchpad"
195 >
196
197@@ -20,7 +11,7 @@
198
199 <div metal:fill-slot="main">
200
201- <h1><span tal:replace="context/displayname" />: Proposed Members</h1>
202+ <h1>Proposed members</h1>
203
204 <tal:block tal:define="memberships context/getProposedMemberships">
205
206@@ -38,7 +29,7 @@
207 decline_id string:decline_${member/id};
208 hold_id string:hold${member/id}">
209
210- <td style="text-align: right">
211+ <td style="text-align: left">
212 <span tal:replace="structure member/fmt:link" />
213 <br />
214 <span class="extra-discreet">
215@@ -68,15 +59,17 @@
216 </tr>
217 </table>
218
219+ <br />
220 <p>
221 Comment:
222+ <textarea name="comment" id="comment"></textarea>
223 <span class="formHelp">This comment will be sent together with the
224 notification of this change to all the approved or declined
225 users and all the team administrators.</span>
226- <textarea name="comment" id="comment"></textarea>
227 </p>
228
229 <input tal:replace="structure view/action_save/render" />
230+ or&nbsp; <a tal:attributes="href view/cancel_url">Cancel</a>
231 </form>
232 </div>
233
234@@ -99,4 +92,3 @@
235
236 </body>
237 </html>
238-</tal:root>
239