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
=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-01 11:09:53 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-01 19:43:30 +0000
@@ -1177,12 +1177,6 @@
11771177
1178standardshipitrequest_edit = 'Edit standard option'1178standardshipitrequest_edit = 'Edit standard option'
11791179
1180team_addmember = ContextBrowsername('Add members to %s')
1181
1182team_add_my_teams = 'Propose/add one of your teams to another one'
1183
1184team_editproposed = ContextBrowsername('Proposed members of %s')
1185
1186team_index = ContextBrowsername('%s in Launchpad')1180team_index = ContextBrowsername('%s in Launchpad')
11871181
1188team_invitations = ContextBrowsername("Invitations sent to %s")1182team_invitations = ContextBrowsername("Invitations sent to %s")
11891183
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2009-09-01 00:21:10 +0000
+++ lib/lp/registry/browser/configure.zcml 2009-09-01 18:39:43 +0000
@@ -1152,7 +1152,7 @@
1152 for="lp.registry.interfaces.person.ITeam"1152 for="lp.registry.interfaces.person.ITeam"
1153 class="canonical.launchpad.browser.TeamMemberAddView"1153 class="canonical.launchpad.browser.TeamMemberAddView"
1154 permission="launchpad.Edit"1154 permission="launchpad.Edit"
1155 template="../templates/team-addmember.pt"/>1155 template="../../app/templates/generic-edit.pt"/>
1156 <browser:page1156 <browser:page
1157 name="+editproposedmembers"1157 name="+editproposedmembers"
1158 for="lp.registry.interfaces.person.ITeam"1158 for="lp.registry.interfaces.person.ITeam"
11591159
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2009-08-31 22:11:14 +0000
+++ lib/lp/registry/browser/person.py 2009-09-01 19:43:30 +0000
@@ -3791,6 +3791,7 @@
3791class TeamAddMyTeamsView(LaunchpadFormView):3791class TeamAddMyTeamsView(LaunchpadFormView):
3792 """Propose/add to this team any team that you're an administrator of."""3792 """Propose/add to this team any team that you're an administrator of."""
37933793
3794 page_title = 'Propose/add one of your teams to another one'
3794 custom_widget('teams', LabeledMultiCheckBoxWidget)3795 custom_widget('teams', LabeledMultiCheckBoxWidget)
37953796
3796 def initialize(self):3797 def initialize(self):
@@ -3838,11 +3839,10 @@
3838 candidates.append(team)3839 candidates.append(team)
3839 return candidates3840 return candidates
38403841
3841 @action(_("Cancel"), name="cancel",3842 @property
3842 validator=LaunchpadFormView.validate_none)3843 def cancel_url(self):
3843 def cancel_action(self, action, data):3844 """The return URL."""
3844 """Simply redirect to the team's page."""3845 return canonical_url(self.context)
3845 pass
38463846
3847 def validate(self, data):3847 def validate(self, data):
3848 if len(data.get('teams', [])) == 0:3848 if len(data.get('teams', [])) == 0:
38493849
=== modified file 'lib/lp/registry/browser/team.py'
--- lib/lp/registry/browser/team.py 2009-08-31 20:16:30 +0000
+++ lib/lp/registry/browser/team.py 2009-09-01 19:43:30 +0000
@@ -918,9 +918,15 @@
918 comment=self.request.form.get('comment'))918 comment=self.request.form.get('comment'))
919919
920 @property920 @property
921 def page_title(self):
922 return 'Proposed members of %s' % self.context.displayname
923
924 @property
921 def next_url(self):925 def next_url(self):
922 return '%s/+members' % canonical_url(self.context)926 return '%s/+members' % canonical_url(self.context)
923927
928 cancel_url = next_url
929
924930
925class TeamBrandingView(BrandingChangeView):931class TeamBrandingView(BrandingChangeView):
926932
@@ -943,6 +949,14 @@
943 schema = ITeamMember949 schema = ITeamMember
944 label = "Select the new member"950 label = "Select the new member"
945951
952 @property
953 def page_title(self):
954 return 'Add members to %s' % self.context.displayname
955
956 @property
957 def cancel_url(self):
958 return canonical_url(self.context)
959
946 def validate(self, data):960 def validate(self, data):
947 """Verify new member.961 """Verify new member.
948962
949963
=== modified file 'lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt'
--- lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt 2009-06-16 20:17:00 +0000
+++ lib/lp/registry/stories/foaf/xx-team-add-my-teams.txt 2009-09-01 19:49:25 +0000
@@ -16,12 +16,14 @@
16The proposal will have to be reviewed by a team administrator.16The proposal will have to be reviewed by a team administrator.
1717
18 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))18 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
19 Ubuntu Team
19 Propose these teams as members20 Propose these teams as members
20 This is a moderated team, so one of its administrators will have21 This is a moderated team, so one of its administrators will have
21 to review any memberships you propose.22 to review any memberships you propose.
22 Launchpad Administrators23 Launchpad Administrators
23 Mailing List Experts24 Mailing List Experts
24 Rosetta Administrators25 Rosetta Administrators
26 or Cancel
2527
26We'll now propose Launchpad Administrators as a member of Ubuntu Team.28We'll now propose Launchpad Administrators as a member of Ubuntu Team.
2729
@@ -78,6 +80,7 @@
7880
79 >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams')81 >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams')
80 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))82 >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent'))
83 Ubuntu Team
81 This is a restricted team84 This is a restricted team
82 New members can not be proposed&mdash;they can only be added by one85 New members can not be proposed&mdash;they can only be added by one
83 of the team's administrators.86 of the team's administrators.
@@ -122,5 +125,5 @@
122125
123 >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams')126 >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams')
124 >>> print extract_text(find_main_content(browser.contents))127 >>> print extract_text(find_main_content(browser.contents))
128 Ubuntu Team
125 None of the teams you administer can be added to this team.129 None of the teams you administer can be added to this team.
126
127130
=== modified file 'lib/lp/registry/templates/team-add-my-teams.pt'
--- lib/lp/registry/templates/team-add-my-teams.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/registry/templates/team-add-my-teams.pt 2009-09-01 19:43:30 +0000
@@ -3,15 +3,10 @@
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="context/@@main_template/master"
10 i18n:domain="launchpad"7 i18n:domain="launchpad"
11>8>
12<body>9<body>
13 <metal:portlets fill-slot="portlets" />
14
15 <div metal:fill-slot="main">10 <div metal:fill-slot="main">
16 <p tal:condition="not: view/candidate_teams">11 <p tal:condition="not: view/candidate_teams">
17 None of the teams you administer can be added to this team.12 None of the teams you administer can be added to this team.
1813
=== removed file 'lib/lp/registry/templates/team-addmember.pt'
--- lib/lp/registry/templates/team-addmember.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/registry/templates/team-addmember.pt 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="context/@@main_template/master"
10 i18n:domain="launchpad"
11>
12
13 <body>
14 <div metal:fill-slot="main">
15 <div metal:use-macro="context/@@launchpad_form/form" />
16 </div>
17 </body>
18
19</html>
20
210
=== modified file 'lib/lp/registry/templates/team-editproposed.pt'
--- lib/lp/registry/templates/team-editproposed.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/registry/templates/team-editproposed.pt 2009-09-01 19:43:30 +0000
@@ -1,18 +1,9 @@
1<tal:root
2 xmlns:tal="http://xml.zope.org/namespaces/tal"
3 xmlns:metal="http://xml.zope.org/namespaces/metal"
4 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
5 omit-tag="">
6
7<html1<html
8 xmlns="http://www.w3.org/1999/xhtml"2 xmlns="http://www.w3.org/1999/xhtml"
9 xmlns:tal="http://xml.zope.org/namespaces/tal"3 xmlns:tal="http://xml.zope.org/namespaces/tal"
10 xmlns:metal="http://xml.zope.org/namespaces/metal"4 xmlns:metal="http://xml.zope.org/namespaces/metal"
11 xmlns:i18n="http://xml.zope.org/namespaces/i18n"5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
12 xml:lang="en"6 metal:use-macro="view/macro:page/main_only"
13 lang="en"
14 dir="ltr"
15 metal:use-macro="context/@@main_template/master"
16 i18n:domain="launchpad"7 i18n:domain="launchpad"
17>8>
189
@@ -20,7 +11,7 @@
2011
21<div metal:fill-slot="main">12<div metal:fill-slot="main">
2213
23 <h1><span tal:replace="context/displayname" />: Proposed Members</h1>14 <h1>Proposed members</h1>
2415
25 <tal:block tal:define="memberships context/getProposedMemberships">16 <tal:block tal:define="memberships context/getProposedMemberships">
2617
@@ -38,7 +29,7 @@
38 decline_id string:decline_${member/id};29 decline_id string:decline_${member/id};
39 hold_id string:hold${member/id}">30 hold_id string:hold${member/id}">
4031
41 <td style="text-align: right">32 <td style="text-align: left">
42 <span tal:replace="structure member/fmt:link" />33 <span tal:replace="structure member/fmt:link" />
43 <br />34 <br />
44 <span class="extra-discreet">35 <span class="extra-discreet">
@@ -68,15 +59,17 @@
68 </tr>59 </tr>
69 </table>60 </table>
7061
62 <br />
71 <p>63 <p>
72 Comment:64 Comment:
65 <textarea name="comment" id="comment"></textarea>
73 <span class="formHelp">This comment will be sent together with the66 <span class="formHelp">This comment will be sent together with the
74 notification of this change to all the approved or declined67 notification of this change to all the approved or declined
75 users and all the team administrators.</span>68 users and all the team administrators.</span>
76 <textarea name="comment" id="comment"></textarea>
77 </p>69 </p>
7870
79 <input tal:replace="structure view/action_save/render" />71 <input tal:replace="structure view/action_save/render" />
72 or&nbsp; <a tal:attributes="href view/cancel_url">Cancel</a>
80 </form>73 </form>
81 </div>74 </div>
8275
@@ -99,4 +92,3 @@
9992
100</body>93</body>
101</html>94</html>
102</tal:root>
10395