Merge lp:~salgado/launchpad/person-edit-pages into lp:launchpad
- person-edit-pages
- Merge into devel
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 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | code | Approve | |
Review via email: mp+11008@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote : | # |
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 | 1177 | 1177 | ||
6 | 1178 | standardshipitrequest_edit = 'Edit standard option' | 1178 | standardshipitrequest_edit = 'Edit standard option' |
7 | 1179 | 1179 | ||
8 | 1180 | team_addmember = ContextBrowsername('Add members to %s') | ||
9 | 1181 | |||
10 | 1182 | team_add_my_teams = 'Propose/add one of your teams to another one' | ||
11 | 1183 | |||
12 | 1184 | team_editproposed = ContextBrowsername('Proposed members of %s') | ||
13 | 1185 | |||
14 | 1186 | team_index = ContextBrowsername('%s in Launchpad') | 1180 | team_index = ContextBrowsername('%s in Launchpad') |
15 | 1187 | 1181 | ||
16 | 1188 | team_invitations = ContextBrowsername("Invitations sent to %s") | 1182 | team_invitations = ContextBrowsername("Invitations sent to %s") |
17 | 1189 | 1183 | ||
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 | 1152 | for="lp.registry.interfaces.person.ITeam" | 1152 | for="lp.registry.interfaces.person.ITeam" |
23 | 1153 | class="canonical.launchpad.browser.TeamMemberAddView" | 1153 | class="canonical.launchpad.browser.TeamMemberAddView" |
24 | 1154 | permission="launchpad.Edit" | 1154 | permission="launchpad.Edit" |
26 | 1155 | template="../templates/team-addmember.pt"/> | 1155 | template="../../app/templates/generic-edit.pt"/> |
27 | 1156 | <browser:page | 1156 | <browser:page |
28 | 1157 | name="+editproposedmembers" | 1157 | name="+editproposedmembers" |
29 | 1158 | for="lp.registry.interfaces.person.ITeam" | 1158 | for="lp.registry.interfaces.person.ITeam" |
30 | 1159 | 1159 | ||
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 | 3791 | class TeamAddMyTeamsView(LaunchpadFormView): | 3791 | class TeamAddMyTeamsView(LaunchpadFormView): |
36 | 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.""" |
37 | 3793 | 3793 | ||
38 | 3794 | page_title = 'Propose/add one of your teams to another one' | ||
39 | 3794 | custom_widget('teams', LabeledMultiCheckBoxWidget) | 3795 | custom_widget('teams', LabeledMultiCheckBoxWidget) |
40 | 3795 | 3796 | ||
41 | 3796 | def initialize(self): | 3797 | def initialize(self): |
42 | @@ -3838,11 +3839,10 @@ | |||
43 | 3838 | candidates.append(team) | 3839 | candidates.append(team) |
44 | 3839 | return candidates | 3840 | return candidates |
45 | 3840 | 3841 | ||
51 | 3841 | @action(_("Cancel"), name="cancel", | 3842 | @property |
52 | 3842 | validator=LaunchpadFormView.validate_none) | 3843 | def cancel_url(self): |
53 | 3843 | def cancel_action(self, action, data): | 3844 | """The return URL.""" |
54 | 3844 | """Simply redirect to the team's page.""" | 3845 | return canonical_url(self.context) |
50 | 3845 | pass | ||
55 | 3846 | 3846 | ||
56 | 3847 | def validate(self, data): | 3847 | def validate(self, data): |
57 | 3848 | if len(data.get('teams', [])) == 0: | 3848 | if len(data.get('teams', [])) == 0: |
58 | 3849 | 3849 | ||
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 | 918 | comment=self.request.form.get('comment')) | 918 | comment=self.request.form.get('comment')) |
64 | 919 | 919 | ||
65 | 920 | @property | 920 | @property |
66 | 921 | def page_title(self): | ||
67 | 922 | return 'Proposed members of %s' % self.context.displayname | ||
68 | 923 | |||
69 | 924 | @property | ||
70 | 921 | def next_url(self): | 925 | def next_url(self): |
71 | 922 | return '%s/+members' % canonical_url(self.context) | 926 | return '%s/+members' % canonical_url(self.context) |
72 | 923 | 927 | ||
73 | 928 | cancel_url = next_url | ||
74 | 929 | |||
75 | 924 | 930 | ||
76 | 925 | class TeamBrandingView(BrandingChangeView): | 931 | class TeamBrandingView(BrandingChangeView): |
77 | 926 | 932 | ||
78 | @@ -943,6 +949,14 @@ | |||
79 | 943 | schema = ITeamMember | 949 | schema = ITeamMember |
80 | 944 | label = "Select the new member" | 950 | label = "Select the new member" |
81 | 945 | 951 | ||
82 | 952 | @property | ||
83 | 953 | def page_title(self): | ||
84 | 954 | return 'Add members to %s' % self.context.displayname | ||
85 | 955 | |||
86 | 956 | @property | ||
87 | 957 | def cancel_url(self): | ||
88 | 958 | return canonical_url(self.context) | ||
89 | 959 | |||
90 | 946 | def validate(self, data): | 960 | def validate(self, data): |
91 | 947 | """Verify new member. | 961 | """Verify new member. |
92 | 948 | 962 | ||
93 | 949 | 963 | ||
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 | 16 | The proposal will have to be reviewed by a team administrator. | 16 | The proposal will have to be reviewed by a team administrator. |
99 | 17 | 17 | ||
100 | 18 | >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent')) | 18 | >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent')) |
101 | 19 | Ubuntu Team | ||
102 | 19 | Propose these teams as members | 20 | Propose these teams as members |
103 | 20 | This is a moderated team, so one of its administrators will have | 21 | This is a moderated team, so one of its administrators will have |
104 | 21 | to review any memberships you propose. | 22 | to review any memberships you propose. |
105 | 22 | Launchpad Administrators | 23 | Launchpad Administrators |
106 | 23 | Mailing List Experts | 24 | Mailing List Experts |
107 | 24 | Rosetta Administrators | 25 | Rosetta Administrators |
108 | 26 | or Cancel | ||
109 | 25 | 27 | ||
110 | 26 | We'll now propose Launchpad Administrators as a member of Ubuntu Team. | 28 | We'll now propose Launchpad Administrators as a member of Ubuntu Team. |
111 | 27 | 29 | ||
112 | @@ -78,6 +80,7 @@ | |||
113 | 78 | 80 | ||
114 | 79 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') | 81 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') |
115 | 80 | >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent')) | 82 | >>> print extract_text(find_tag_by_id(browser.contents, 'maincontent')) |
116 | 83 | Ubuntu Team | ||
117 | 81 | This is a restricted team | 84 | This is a restricted team |
118 | 82 | New members can not be proposed—they can only be added by one | 85 | New members can not be proposed—they can only be added by one |
119 | 83 | of the team's administrators. | 86 | of the team's administrators. |
120 | @@ -122,5 +125,5 @@ | |||
121 | 122 | 125 | ||
122 | 123 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') | 126 | >>> browser.open('http://launchpad.dev/~ubuntu-team/+add-my-teams') |
123 | 124 | >>> print extract_text(find_main_content(browser.contents)) | 127 | >>> print extract_text(find_main_content(browser.contents)) |
124 | 128 | Ubuntu Team | ||
125 | 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 | 126 | |||
127 | 127 | 130 | ||
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 | 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
133 | 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
134 | 5 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 5 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
139 | 6 | xml:lang="en" | 6 | metal:use-macro="view/macro:page/main_only" |
136 | 7 | lang="en" | ||
137 | 8 | dir="ltr" | ||
138 | 9 | metal:use-macro="context/@@main_template/master" | ||
140 | 10 | i18n:domain="launchpad" | 7 | i18n:domain="launchpad" |
141 | 11 | > | 8 | > |
142 | 12 | <body> | 9 | <body> |
143 | 13 | <metal:portlets fill-slot="portlets" /> | ||
144 | 14 | |||
145 | 15 | <div metal:fill-slot="main"> | 10 | <div metal:fill-slot="main"> |
146 | 16 | <p tal:condition="not: view/candidate_teams"> | 11 | <p tal:condition="not: view/candidate_teams"> |
147 | 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. |
148 | 18 | 13 | ||
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 | 1 | <html | ||
154 | 2 | xmlns="http://www.w3.org/1999/xhtml" | ||
155 | 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
156 | 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
157 | 5 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
158 | 6 | xml:lang="en" | ||
159 | 7 | lang="en" | ||
160 | 8 | dir="ltr" | ||
161 | 9 | metal:use-macro="context/@@main_template/master" | ||
162 | 10 | i18n:domain="launchpad" | ||
163 | 11 | > | ||
164 | 12 | |||
165 | 13 | <body> | ||
166 | 14 | <div metal:fill-slot="main"> | ||
167 | 15 | <div metal:use-macro="context/@@launchpad_form/form" /> | ||
168 | 16 | </div> | ||
169 | 17 | </body> | ||
170 | 18 | |||
171 | 19 | </html> | ||
172 | 20 | |||
173 | 21 | 0 | ||
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 | 1 | <tal:root | ||
179 | 2 | xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
180 | 3 | xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
181 | 4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
182 | 5 | omit-tag=""> | ||
183 | 6 | |||
184 | 7 | <html | 1 | <html |
185 | 8 | xmlns="http://www.w3.org/1999/xhtml" | 2 | xmlns="http://www.w3.org/1999/xhtml" |
186 | 9 | xmlns:tal="http://xml.zope.org/namespaces/tal" | 3 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
187 | 10 | xmlns:metal="http://xml.zope.org/namespaces/metal" | 4 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
188 | 11 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" | 5 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
193 | 12 | xml:lang="en" | 6 | metal:use-macro="view/macro:page/main_only" |
190 | 13 | lang="en" | ||
191 | 14 | dir="ltr" | ||
192 | 15 | metal:use-macro="context/@@main_template/master" | ||
194 | 16 | i18n:domain="launchpad" | 7 | i18n:domain="launchpad" |
195 | 17 | > | 8 | > |
196 | 18 | 9 | ||
197 | @@ -20,7 +11,7 @@ | |||
198 | 20 | 11 | ||
199 | 21 | <div metal:fill-slot="main"> | 12 | <div metal:fill-slot="main"> |
200 | 22 | 13 | ||
202 | 23 | <h1><span tal:replace="context/displayname" />: Proposed Members</h1> | 14 | <h1>Proposed members</h1> |
203 | 24 | 15 | ||
204 | 25 | <tal:block tal:define="memberships context/getProposedMemberships"> | 16 | <tal:block tal:define="memberships context/getProposedMemberships"> |
205 | 26 | 17 | ||
206 | @@ -38,7 +29,7 @@ | |||
207 | 38 | decline_id string:decline_${member/id}; | 29 | decline_id string:decline_${member/id}; |
208 | 39 | hold_id string:hold${member/id}"> | 30 | hold_id string:hold${member/id}"> |
209 | 40 | 31 | ||
211 | 41 | <td style="text-align: right"> | 32 | <td style="text-align: left"> |
212 | 42 | <span tal:replace="structure member/fmt:link" /> | 33 | <span tal:replace="structure member/fmt:link" /> |
213 | 43 | <br /> | 34 | <br /> |
214 | 44 | <span class="extra-discreet"> | 35 | <span class="extra-discreet"> |
215 | @@ -68,15 +59,17 @@ | |||
216 | 68 | </tr> | 59 | </tr> |
217 | 69 | </table> | 60 | </table> |
218 | 70 | 61 | ||
219 | 62 | <br /> | ||
220 | 71 | <p> | 63 | <p> |
221 | 72 | Comment: | 64 | Comment: |
222 | 65 | <textarea name="comment" id="comment"></textarea> | ||
223 | 73 | <span class="formHelp">This comment will be sent together with the | 66 | <span class="formHelp">This comment will be sent together with the |
224 | 74 | notification of this change to all the approved or declined | 67 | notification of this change to all the approved or declined |
225 | 75 | users and all the team administrators.</span> | 68 | users and all the team administrators.</span> |
226 | 76 | <textarea name="comment" id="comment"></textarea> | ||
227 | 77 | </p> | 69 | </p> |
228 | 78 | 70 | ||
229 | 79 | <input tal:replace="structure view/action_save/render" /> | 71 | <input tal:replace="structure view/action_save/render" /> |
230 | 72 | or <a tal:attributes="href view/cancel_url">Cancel</a> | ||
231 | 80 | </form> | 73 | </form> |
232 | 81 | </div> | 74 | </div> |
233 | 82 | 75 | ||
234 | @@ -99,4 +92,3 @@ | |||
235 | 99 | 92 | ||
236 | 100 | </body> | 93 | </body> |
237 | 101 | </html> | 94 | </html> |
238 | 102 | </tal:root> | ||
239 | 103 | 95 |
= Summary =
Convert form pages to add/edit members of a team.
== Proposed fix ==
JFD the mechanical conversion. Screenshots at people. canonical. com/~salgado/ members/
http://
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: registry/ browser/ configure. zcml registry/ stories/ foaf/xx- team-add- my-teams. txt /launchpad/ pagetitles. py registry/ templates/ team-editpropos ed.pt registry/ templates/ team-add- my-teams. pt registry/ browser/ team.py registry/ browser/ person. py
lib/lp/
lib/lp/
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ registry/ browser/ person. py interface' (No module named restful)
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.