Merge lp:~salgado/launchpad/polls-three-o into lp:launchpad
- polls-three-o
- Merge into devel
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~salgado/launchpad/polls-three-o | ||||
Merge into: | lp:launchpad | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~salgado/launchpad/polls-three-o | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email:
|
This proposal supersedes a proposal from 2009-08-18.
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Guilherme Salgado (salgado) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeroen T. Vermeulen (jtv) wrote : Posted in a previous version of this proposal | # |
Hi Salgado,
I stubbed my toe a few times looking at the UI changes, until I realized
that I'm really missing a breadcrumb for the poll. Once you've drilled
down into a poll, everything you do in there refers back to the team.
On the edit-option page I found no reference to the poll whatsoever:
it's like you're editing a direct property of the team itself. Having
the poll shown as a first-class entity would make a big difference, I
think. But that's not for a template conversion to fix.
There were a few small inconsistencies, or at least things that I think
are inconsistent: adding an option gives me "Show options" and "Change
details" as related pages, plus a Save button, but editing one gives me
Save plus the Cancel link. Is there a reason why these are so
different?
Something that may force the issue is that the "Change details" link on
the new-option page is for the poll. Had I not known where this UI
element came from, I might have expected it to apply to the option I'm
adding. So I think it'd be more intuitive to remove these "related
pages" links from the new-option page and add a Cancel link back to the
poll instead.
Similarly, unless Martin has a rule against it, I think the poll edit
form should have a Cancel link. Right now there's no direct way back to
the poll page.
(The same goes for the options overview by the way, which is the only
place where I would really expect to be able to add or edit options. It
looks to me as though the options page wants to be integrated into the
poll page, with an "Add new option" link inline and without any remnants
of this old actions menu anywhere. Maybe that's what you have planned
anyway.)
Another very minor annoyance is that some of the page headings look a
little redundant. Sometimes they include the poll name, sometimes they
don't. Where they do, they duplicate the poll title displayed in small
font right above the heading. But I don't see any way of fixing that
without either removing that small title (which seems to be baked into
the application menu above it) or removing the poll name from the page
title--both of which sound like bad alternatives.
Speaking of headings: your branch sets the label for the poll edit form
to "Edit poll details." What exactly that text should read is an
ongoing discussion (started by Curtis on the mailing list), but more to
the point, I don't see it show up anywhere! If you provide a page_title
in this view it'll get picked up (and the one in pagetitles.py will no
longer be needed), but label doesn't seem to be.
Apart from that, the code as such looks good to me. Nice use of a mixin
for the navigation menu, though in this case I'd leave it out altogether
instead of migrating it to the 3.0 setup.
Jeroen
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Guilherme Salgado (salgado) wrote : Posted in a previous version of this proposal | # |
On Wed, 2009-08-19 at 08:13 +0000, Jeroen T. Vermeulen wrote:
> Review: Needs Fixing
> Hi Salgado,
>
> I stubbed my toe a few times looking at the UI changes, until I realized
> that I'm really missing a breadcrumb for the poll. Once you've drilled
> down into a poll, everything you do in there refers back to the team.
> On the edit-option page I found no reference to the poll whatsoever:
> it's like you're editing a direct property of the team itself. Having
> the poll shown as a first-class entity would make a big difference, I
> think. But that's not for a template conversion to fix.
I think everybody who's used polls had a similar experience to yours.
They were written a long time ago and were left mostly untouched since
then, even when we redesigned navigation/UI for 1.0 and 2.0
>
> There were a few small inconsistencies, or at least things that I think
> are inconsistent: adding an option gives me "Show options" and "Change
> details" as related pages, plus a Save button, but editing one gives me
> Save plus the Cancel link. Is there a reason why these are so
> different?
That's because URL of these related pages are relative, so they work on
IPoll pages (like +newoption) but not on IPollOption ones (like
+option/id). The Cancel link was added there only to make it possible
to return to the +options page, but all forms should have a Cancel link.
>
> Something that may force the issue is that the "Change details" link on
> the new-option page is for the poll. Had I not known where this UI
> element came from, I might have expected it to apply to the option I'm
> adding. So I think it'd be more intuitive to remove these "related
> pages" links from the new-option page and add a Cancel link back to the
> poll instead.
I think that's a good thing to do.
>
> Similarly, unless Martin has a rule against it, I think the poll edit
> form should have a Cancel link. Right now there's no direct way back to
> the poll page.
They all should have a Cancel button.
>
> (The same goes for the options overview by the way, which is the only
> place where I would really expect to be able to add or edit options. It
> looks to me as though the options page wants to be integrated into the
> poll page, with an "Add new option" link inline and without any remnants
> of this old actions menu anywhere. Maybe that's what you have planned
> anyway.)
In fact, my only plan is to migrate these pages without making things
any worse than they already are and spend the least possible amount of
time doing so.
But I really liked your suggestion, so I filed
https:/
>
> Another very minor annoyance is that some of the page headings look a
> little redundant. Sometimes they include the poll name, sometimes they
> don't. Where they do, they duplicate the poll title displayed in small
> font right above the heading. But I don't see any way of fixing that
> without either removing that small title (which seems to be baked into
> the application menu above it) or removing the poll name from the page
> title--both of which sound like bad alternatives.
>
> Speaking of headings: your branch sets the label for the pol...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Guilherme Salgado (salgado) wrote : | # |
I liked so much the changes proposed by Jeroen on https:/
This branch converts the pages he already reviewed on the MP above and the remaining poll-related ones. Incremental diff: http://
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jeroen T. Vermeulen (jtv) wrote : | # |
A surprise indeed! This is wonderful. It looks gorgeous, it's not as crowded as it was, even more pages go to 3.0, and it all works sensibly. I had to force myself to look at the code as well before approving the branch.
That was no less rewarding: you seem to have done the job without growing the code. Plus you cleaned up some titles, and introduced sprites. Approved without reservations.
What would it take to get you on our team? :-)
Jeroen
Preview Diff
1 | === modified file 'lib/canonical/launchpad/icing/style-3-0.css' |
2 | --- lib/canonical/launchpad/icing/style-3-0.css 2009-08-18 03:59:41 +0000 |
3 | +++ lib/canonical/launchpad/icing/style-3-0.css 2009-08-19 19:48:09 +0000 |
4 | @@ -398,7 +398,7 @@ |
5 | clear: both; |
6 | visibility: hidden; |
7 | } |
8 | -.portlet dt { |
9 | +dt { |
10 | font-weight: bold; |
11 | } |
12 | .portlet dd { |
13 | |
14 | === modified file 'lib/lp/registry/browser/configure.zcml' |
15 | --- lib/lp/registry/browser/configure.zcml 2009-08-18 04:57:21 +0000 |
16 | +++ lib/lp/registry/browser/configure.zcml 2009-08-19 19:48:09 +0000 |
17 | @@ -600,7 +600,9 @@ |
18 | <browser:menus |
19 | module="lp.registry.browser.poll" |
20 | classes=" |
21 | - PollContextMenu"/> |
22 | + PollOverviewMenu |
23 | + PollActionNavigationMenu |
24 | + PollEditNavigationMenu"/> |
25 | <browser:defaultView |
26 | for="lp.registry.interfaces.poll.IPoll" |
27 | name="+index"/> |
28 | @@ -625,9 +627,6 @@ |
29 | permission="zope.Public" |
30 | class="lp.registry.browser.poll.BasePollView"> |
31 | <browser:page |
32 | - name="+options" |
33 | - template="../templates/poll-options.pt"/> |
34 | - <browser:page |
35 | name="+portlet-details" |
36 | template="../templates/poll-portlet-details.pt"/> |
37 | <browser:page |
38 | |
39 | === modified file 'lib/lp/registry/browser/poll.py' |
40 | --- lib/lp/registry/browser/poll.py 2009-06-25 04:06:00 +0000 |
41 | +++ lib/lp/registry/browser/poll.py 2009-08-19 19:48:09 +0000 |
42 | @@ -6,39 +6,34 @@ |
43 | __all__ = [ |
44 | 'BasePollView', |
45 | 'PollAddView', |
46 | - 'PollContextMenu', |
47 | + 'PollEditNavigationMenu', |
48 | 'PollEditView', |
49 | 'PollNavigation', |
50 | 'PollOptionAddView', |
51 | 'PollOptionEditView', |
52 | + 'PollOverviewMenu', |
53 | 'PollView', |
54 | 'PollVoteView', |
55 | ] |
56 | |
57 | from zope.event import notify |
58 | from zope.component import getUtility |
59 | +from zope.interface import implements, Interface |
60 | from zope.lifecycleevent import ObjectCreatedEvent |
61 | from zope.app.form.browser import TextWidget |
62 | |
63 | from canonical.launchpad.webapp import ( |
64 | - action, canonical_url, ContextMenu, custom_widget, |
65 | + action, ApplicationMenu, canonical_url, custom_widget, |
66 | enabled_with_permission, LaunchpadEditFormView, LaunchpadFormView, Link, |
67 | - Navigation, stepthrough) |
68 | -from canonical.launchpad.webapp.interfaces import ILaunchBag |
69 | + Navigation, NavigationMenu, stepthrough) |
70 | +from canonical.launchpad.webapp import LaunchpadView |
71 | from lp.registry.interfaces.poll import ( |
72 | IPoll, IPollOption, IPollOptionSet, IPollSubset, IVoteSet, PollAlgorithm, |
73 | PollSecrecy) |
74 | from canonical.launchpad.helpers import shortlist |
75 | |
76 | |
77 | -class PollContextMenu(ContextMenu): |
78 | - |
79 | - usedfor = IPoll |
80 | - links = ['showall', 'addnew', 'edit'] |
81 | - |
82 | - def showall(self): |
83 | - text = 'Show option details' |
84 | - return Link('+options', text, icon='info') |
85 | +class PollEditLinksMixin: |
86 | |
87 | @enabled_with_permission('launchpad.Edit') |
88 | def addnew(self): |
89 | @@ -51,6 +46,31 @@ |
90 | return Link('+edit', text, icon='edit') |
91 | |
92 | |
93 | +class PollOverviewMenu(ApplicationMenu, PollEditLinksMixin): |
94 | + usedfor = IPoll |
95 | + facet = 'overview' |
96 | + links = ['addnew'] |
97 | + |
98 | + |
99 | +class IPollEditMenu(Interface): |
100 | + """A marker interface for the edit navigation menu.""" |
101 | + |
102 | + |
103 | +class PollEditNavigationMenu(NavigationMenu, PollEditLinksMixin): |
104 | + usedfor = IPollEditMenu |
105 | + facet = 'overview' |
106 | + links = ['addnew', 'edit'] |
107 | + |
108 | + |
109 | +class IPollActionMenu(Interface): |
110 | + """A marker interface for the action menu.""" |
111 | + |
112 | + |
113 | +class PollActionNavigationMenu(PollEditNavigationMenu): |
114 | + usedfor = IPollActionMenu |
115 | + links = ['edit'] |
116 | + |
117 | + |
118 | class PollNavigation(Navigation): |
119 | |
120 | usedfor = IPoll |
121 | @@ -61,16 +81,12 @@ |
122 | self.context, int(name)) |
123 | |
124 | |
125 | -class BasePollView: |
126 | +class BasePollView(LaunchpadView): |
127 | """A base view class to be used in other poll views.""" |
128 | |
129 | - def __init__(self, context, request): |
130 | - self.context = context |
131 | - self.request = request |
132 | - self.user = getUtility(ILaunchBag).user |
133 | - self.token = None |
134 | - self.gotTokenAndVotes = False |
135 | - self.feedback = "" |
136 | + token = None |
137 | + gotTokenAndVotes = False |
138 | + feedback = "" |
139 | |
140 | def setUpTokenAndVotes(self): |
141 | """Set up the token and votes to be displayed.""" |
142 | @@ -172,12 +188,14 @@ |
143 | |
144 | class PollView(BasePollView): |
145 | """A view class to display the results of a poll.""" |
146 | + implements(IPollActionMenu) |
147 | |
148 | - def __init__(self, context, request): |
149 | - BasePollView.__init__(self, context, request) |
150 | - if (self.userCanVote() and context.isOpen() and |
151 | - context.getActiveOptions()): |
152 | - context_url = canonical_url(context) |
153 | + def initialize(self): |
154 | + super(PollView, self).initialize() |
155 | + request = self.request |
156 | + if (self.userCanVote() and self.context.isOpen() and |
157 | + self.context.getActiveOptions()): |
158 | + context_url = canonical_url(self.context) |
159 | if self.isSimple(): |
160 | request.response.redirect("%s/+vote-simple" % context_url) |
161 | elif self.isCondorcet(): |
162 | @@ -214,8 +232,9 @@ |
163 | change it. Otherwise he can register his vote. |
164 | """ |
165 | |
166 | - def processForm(self): |
167 | + def initialize(self): |
168 | """Process the form, if it was submitted.""" |
169 | + super(PollVoteView, self).initialize() |
170 | if not self.isSecret() and self.userVoted(): |
171 | # For non-secret polls, the user's vote is always displayed |
172 | self.setUpTokenAndVotesForNonSecretPolls() |
173 | @@ -353,11 +372,17 @@ |
174 | |
175 | class PollEditView(LaunchpadEditFormView): |
176 | |
177 | + implements(IPollEditMenu) |
178 | schema = IPoll |
179 | label = "Edit poll details" |
180 | field_names = ["name", "title", "proposition", "allowspoilt", "dateopens", |
181 | "datecloses"] |
182 | |
183 | + @property |
184 | + def cancel_url(self): |
185 | + """See `LaunchpadFormView`.""" |
186 | + return canonical_url(self.context) |
187 | + |
188 | @action("Save", name="save") |
189 | def save_action(self, action, data): |
190 | self.updateContextFromData(data) |
191 | @@ -372,6 +397,11 @@ |
192 | field_names = ["name", "title"] |
193 | custom_widget("title", TextWidget, width=30) |
194 | |
195 | + @property |
196 | + def cancel_url(self): |
197 | + """See `LaunchpadFormView`.""" |
198 | + return canonical_url(self.context.poll) |
199 | + |
200 | @action("Save", name="save") |
201 | def save_action(self, action, data): |
202 | self.updateContextFromData(data) |
203 | @@ -386,6 +416,11 @@ |
204 | field_names = ["name", "title"] |
205 | custom_widget("title", TextWidget, width=30) |
206 | |
207 | + @property |
208 | + def cancel_url(self): |
209 | + """See `LaunchpadFormView`.""" |
210 | + return canonical_url(self.context) |
211 | + |
212 | @action("Create", name="create") |
213 | def create_action(self, action, data): |
214 | polloption = self.context.newOption(data['name'], data['title']) |
215 | |
216 | === modified file 'lib/lp/registry/interfaces/poll.py' |
217 | --- lib/lp/registry/interfaces/poll.py 2009-06-25 04:06:00 +0000 |
218 | +++ lib/lp/registry/interfaces/poll.py 2009-08-19 19:48:09 +0000 |
219 | @@ -108,29 +108,29 @@ |
220 | readonly=True) |
221 | |
222 | name = PollNameField( |
223 | - title=_('The unique name of this poll.'), |
224 | + title=_('The unique name of this poll'), |
225 | description=_('A short unique name, beginning with a lower-case ' |
226 | 'letter or number, and containing only letters, ' |
227 | 'numbers, dots, hyphens, or plus signs.'), |
228 | required=True, readonly=False, constraint=name_validator) |
229 | |
230 | title = TextLine( |
231 | - title=_('The title of this poll.'), required=True, readonly=False) |
232 | + title=_('The title of this poll'), required=True, readonly=False) |
233 | |
234 | dateopens = Datetime( |
235 | - title=_('The date and time when this poll opens.'), required=True, |
236 | + title=_('The date and time when this poll opens'), required=True, |
237 | readonly=False) |
238 | |
239 | datecloses = Datetime( |
240 | - title=_('The date and time when this poll closes.'), required=True, |
241 | + title=_('The date and time when this poll closes'), required=True, |
242 | readonly=False) |
243 | |
244 | proposition = Text( |
245 | - title=_('The proposition that is going to be voted.'), required=True, |
246 | + title=_('The proposition that is going to be voted'), required=True, |
247 | readonly=False) |
248 | |
249 | type = Choice( |
250 | - title=_('The type of this poll.'), required=True, |
251 | + title=_('The type of this poll'), required=True, |
252 | readonly=False, vocabulary=PollAlgorithm, |
253 | default=PollAlgorithm.CONDORCET) |
254 | |
255 | @@ -139,7 +139,7 @@ |
256 | readonly=False, default=True) |
257 | |
258 | secrecy = Choice( |
259 | - title=_('The secrecy of the Poll.'), required=True, |
260 | + title=_('The secrecy of the Poll'), required=True, |
261 | readonly=False, vocabulary=PollSecrecy, |
262 | default=PollSecrecy.SECRET) |
263 | |
264 | |
265 | === modified file 'lib/lp/registry/stories/team-polls/create-poll-options.txt' |
266 | --- lib/lp/registry/stories/team-polls/create-poll-options.txt 2009-04-17 10:32:16 +0000 |
267 | +++ lib/lp/registry/stories/team-polls/create-poll-options.txt 2009-08-19 19:48:09 +0000 |
268 | @@ -37,10 +37,6 @@ |
269 | And here we see the option listed as one of the active options for this |
270 | poll. |
271 | |
272 | - >>> team_admin_browser.getLink('Show option details').click() |
273 | - >>> team_admin_browser.url |
274 | - 'http://launchpad.dev/~ubuntu-team/+poll/dpl-2080/+options' |
275 | - |
276 | >>> print extract_text( |
277 | ... find_tag_by_id(team_admin_browser.contents, 'options')) |
278 | Name Title Active |
279 | |
280 | === modified file 'lib/lp/registry/stories/team-polls/edit-options.txt' |
281 | --- lib/lp/registry/stories/team-polls/edit-options.txt 2008-10-15 17:56:31 +0000 |
282 | +++ lib/lp/registry/stories/team-polls/edit-options.txt 2009-08-19 19:48:09 +0000 |
283 | @@ -7,10 +7,11 @@ |
284 | >>> user_browser.getLink('A public poll that never closes').click() |
285 | >>> user_browser.url |
286 | 'http://launchpad.dev/~ubuntu-team/+poll/never-closes4' |
287 | - >>> user_browser.getLink('Show option details').click() |
288 | - >>> user_browser.url |
289 | - 'http://launchpad.dev/~ubuntu-team/+poll/never-closes4/+options' |
290 | - >>> user_browser.getLink('Edit') |
291 | + >>> print extract_text(find_tag_by_id(user_browser.contents, 'options')) |
292 | + Name Title Active |
293 | + OptionA OptionA Yes |
294 | + ... |
295 | + >>> user_browser.getLink('[Edit]') |
296 | Traceback (most recent call last): |
297 | ... |
298 | LinkNotFoundError |
299 | @@ -18,22 +19,14 @@ |
300 | And when the poll already started, administrators cannot change the options |
301 | either: |
302 | |
303 | + # Need to craft the URL manually because there's no link to it -- the |
304 | + # option can't be changed, after all. |
305 | >>> browser = setupBrowser( |
306 | ... auth='Basic jeff.waugh@ubuntulinux.com:jdub') |
307 | - >>> browser.open('http://launchpad.dev/~ubuntu-team/+poll/never-closes4') |
308 | - >>> browser.getLink('Show option details').click() |
309 | - >>> browser.url |
310 | - 'http://launchpad.dev/~ubuntu-team/+poll/never-closes4/+options' |
311 | - >>> browser.getLink('[Edit]').click() |
312 | - >>> browser.url |
313 | - 'http://launchpad.dev/~ubuntu-team/+poll/never-closes4/+option/...' |
314 | - |
315 | - >>> tags = find_tags_by_class(browser.contents, "error message") |
316 | - >>> for tag in tags: |
317 | - ... print tag.renderContents() |
318 | - <BLANKLINE> |
319 | + >>> browser.open('http://launchpad.dev/~ubuntu-team/+poll/never-closes4/' |
320 | + ... '+option/20') |
321 | + >>> print "\n".join(get_feedback_messages(browser.contents)) |
322 | You can’t edit any options because the poll is already open. |
323 | - <BLANKLINE> |
324 | |
325 | Since Jeff is an administrator of ubuntu-team and we have a poll that hasn't |
326 | been opened yet, he should be able to edit its options. |
327 | @@ -43,10 +36,6 @@ |
328 | >>> browser.url |
329 | 'http://launchpad.dev/~ubuntu-team/+poll/not-yet-opened' |
330 | |
331 | - >>> browser.getLink('Show option details').click() |
332 | - >>> browser.url |
333 | - 'http://launchpad.dev/~ubuntu-team/+poll/not-yet-opened/+options' |
334 | - |
335 | >>> browser.getLink('[Edit]').click() |
336 | >>> browser.url |
337 | 'http://launchpad.dev/~ubuntu-team/+poll/not-yet-opened/+option/...' |
338 | |
339 | === modified file 'lib/lp/registry/stories/team-polls/edit-poll.txt' |
340 | --- lib/lp/registry/stories/team-polls/edit-poll.txt 2009-04-17 10:32:16 +0000 |
341 | +++ lib/lp/registry/stories/team-polls/edit-poll.txt 2009-08-19 19:48:09 +0000 |
342 | @@ -71,7 +71,8 @@ |
343 | >>> team_admin_browser.url |
344 | 'http://launchpad.dev/~ubuntu-team/+poll/never-closes/+vote-simple' |
345 | |
346 | - >>> team_admin_browser.getLink('Change details').click() |
347 | + >>> team_admin_browser.open( |
348 | + ... 'http://launchpad.dev/~ubuntu-team/+poll/never-closes/+edit') |
349 | >>> print extract_text( |
350 | ... find_tag_by_id(team_admin_browser.contents, 'not-editable')) |
351 | This poll can't be edited... |
352 | |
353 | === modified file 'lib/lp/registry/templates/poll-edit.pt' |
354 | --- lib/lp/registry/templates/poll-edit.pt 2009-07-17 17:59:07 +0000 |
355 | +++ lib/lp/registry/templates/poll-edit.pt 2009-08-18 20:24:56 +0000 |
356 | @@ -3,19 +3,12 @@ |
357 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
358 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
359 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
360 | - xml:lang="en" |
361 | - lang="en" |
362 | - dir="ltr" |
363 | - metal:use-macro="context/@@main_template/master" |
364 | + metal:use-macro="view/macro:page/main_only" |
365 | i18n:domain="launchpad" |
366 | > |
367 | |
368 | <body> |
369 | |
370 | - <metal:portlets fill-slot="portlets"> |
371 | - <div tal:replace="structure context/@@+portlet-details" /> |
372 | - </metal:portlets> |
373 | - |
374 | <div metal:fill-slot="main"> |
375 | |
376 | <div tal:condition="context/isNotYetOpened"> |
377 | @@ -33,6 +26,8 @@ |
378 | opens it can't be edited anymore.</p> |
379 | </div> |
380 | |
381 | + <tal:menu replace="structure view/@@+related-pages" /> |
382 | + |
383 | </div> |
384 | |
385 | </body> |
386 | |
387 | === modified file 'lib/lp/registry/templates/poll-index.pt' |
388 | --- lib/lp/registry/templates/poll-index.pt 2009-07-17 17:59:07 +0000 |
389 | +++ lib/lp/registry/templates/poll-index.pt 2009-08-19 19:48:09 +0000 |
390 | @@ -1,39 +1,26 @@ |
391 | -<tal:root |
392 | - xmlns:tal="http://xml.zope.org/namespaces/tal" |
393 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
394 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
395 | - omit-tag=""> |
396 | - |
397 | -<tal:do-this-first replace="view/setUpTokenAndVotes" /> |
398 | <html |
399 | xmlns="http://www.w3.org/1999/xhtml" |
400 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
401 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
402 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
403 | - xml:lang="en" |
404 | - lang="en" |
405 | - dir="ltr" |
406 | - metal:use-macro="context/@@main_template/master" |
407 | + metal:use-macro="view/macro:page/main_side" |
408 | i18n:domain="launchpad" |
409 | > |
410 | <body> |
411 | |
412 | -<metal:leftportlets fill-slot="portlets_one"> |
413 | - <div tal:replace="structure context/@@+portlet-details" /> |
414 | - <div tal:replace="structure context/team/@@+portlet-details" /> |
415 | -</metal:leftportlets> |
416 | - |
417 | -<metal:rightportlets fill-slot="portlets_two"> |
418 | - <div tal:replace="structure context/@@+portlet-options" /> |
419 | -</metal:rightportlets> |
420 | +<tal:heading metal:fill-slot="heading"> |
421 | + <h1 tal:content="context/title">Mozilla</h1> |
422 | +</tal:heading> |
423 | |
424 | <div metal:fill-slot="main"> |
425 | |
426 | - <h1 tal:content="context/title" /> |
427 | - <div |
428 | - class="highlighted" |
429 | - tal:content="structure context/proposition/fmt:text-to-html" |
430 | - /> |
431 | + <tal:do-this-first replace="view/setUpTokenAndVotes" /> |
432 | + |
433 | + <div |
434 | + class="highlighted" |
435 | + tal:content="structure context/proposition/fmt:text-to-html" |
436 | + /> |
437 | + <br /> |
438 | |
439 | <p tal:condition="not: context/getActiveOptions"> |
440 | This poll does not yet have any voting options. Please <a |
441 | @@ -41,6 +28,36 @@ |
442 | for a real poll, of course :-) |
443 | </p> |
444 | |
445 | + <div class="two-column-list"> |
446 | + <dl> |
447 | + <dt>Opens:</dt> |
448 | + <dd |
449 | + tal:attributes="title context/dateopens/fmt:datetime" |
450 | + tal:content="context/dateopens/fmt:approximatedate" /> |
451 | + </dl> |
452 | + |
453 | + <dl> |
454 | + <dt>Type:</dt> |
455 | + <dd tal:content="context/type/title" /> |
456 | + </dl> |
457 | + |
458 | + <dl> |
459 | + <dt>Closes:</dt> |
460 | + <dd |
461 | + tal:attributes="title context/datecloses/fmt:datetime" |
462 | + tal:content="context/datecloses/fmt:approximatedate" /> |
463 | + </dl> |
464 | + |
465 | + <dl> |
466 | + <dt>Secrecy:</dt> |
467 | + <dd tal:content="context/secrecy/title" /> |
468 | + </dl> |
469 | + </div> |
470 | + <br /> |
471 | + |
472 | + <tal:details replace="structure context/@@+portlet-options" /> |
473 | + <br /> |
474 | + |
475 | <tal:is_open condition="context/isOpen"> |
476 | <p tal:condition="not: request/lp:person"> |
477 | You need to <a href="+login">login to vote</a>. |
478 | @@ -180,6 +197,11 @@ |
479 | |
480 | </div> |
481 | |
482 | +<div metal:fill-slot="side"> |
483 | + <div id="object-actions" class="top-portlet"> |
484 | + <tal:menu replace="structure view/@@+global-actions" /> |
485 | + </div> |
486 | +</div> |
487 | + |
488 | </body> |
489 | </html> |
490 | -</tal:root> |
491 | |
492 | === modified file 'lib/lp/registry/templates/poll-newoption.pt' |
493 | --- lib/lp/registry/templates/poll-newoption.pt 2009-07-17 17:59:07 +0000 |
494 | +++ lib/lp/registry/templates/poll-newoption.pt 2009-08-19 19:48:09 +0000 |
495 | @@ -3,19 +3,12 @@ |
496 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
497 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
498 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
499 | - xml:lang="en" |
500 | - lang="en" |
501 | - dir="ltr" |
502 | - metal:use-macro="context/@@main_template/master" |
503 | + metal:use-macro="view/macro:page/main_only" |
504 | i18n:domain="launchpad" |
505 | > |
506 | |
507 | <body> |
508 | |
509 | - <metal:portlets fill-slot="portlets"> |
510 | - <div tal:replace="structure context/@@+portlet-details" /> |
511 | - </metal:portlets> |
512 | - |
513 | <div metal:fill-slot="main"> |
514 | |
515 | <tal:block condition="context/isNotYetOpened"> |
516 | |
517 | === removed file 'lib/lp/registry/templates/poll-options.pt' |
518 | --- lib/lp/registry/templates/poll-options.pt 2009-07-17 17:59:07 +0000 |
519 | +++ lib/lp/registry/templates/poll-options.pt 1970-01-01 00:00:00 +0000 |
520 | @@ -1,56 +0,0 @@ |
521 | -<html |
522 | - xmlns="http://www.w3.org/1999/xhtml" |
523 | - xmlns:tal="http://xml.zope.org/namespaces/tal" |
524 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
525 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
526 | - xml:lang="en" |
527 | - lang="en" |
528 | - dir="ltr" |
529 | - metal:use-macro="context/@@main_template/master" |
530 | - i18n:domain="launchpad" |
531 | -> |
532 | -<body> |
533 | - |
534 | - <metal:portlets fill-slot="portlets"> |
535 | - <div tal:replace="structure context/@@+portlet-details" /> |
536 | - </metal:portlets> |
537 | - |
538 | - <div metal:fill-slot="main"> |
539 | - |
540 | - <h1>Poll options</h1> |
541 | - |
542 | - <tal:block condition="context/getAllOptions"> |
543 | - <table class="listing" id="options"> |
544 | - <thead> |
545 | - <tr> |
546 | - <th>Name</th> |
547 | - <th>Title</th> |
548 | - <th>Active</th> |
549 | - <th tal:condition="context/required:launchpad.Edit"></th> |
550 | - </tr> |
551 | - </thead> |
552 | - <tr tal:repeat="polloption context/getAllOptions"> |
553 | - <td tal:content="polloption/name">mjg59</td> |
554 | - <td tal:content="polloption/title">This guy rocks!</td> |
555 | - <td> |
556 | - <tal:is_active condition="polloption/active">Yes</tal:is_active> |
557 | - <tal:inactive condition="not: polloption/active">No</tal:inactive> |
558 | - </td> |
559 | - <td tal:condition="context/required:launchpad.Edit"> |
560 | - <a tal:attributes="href polloption/fmt:url" |
561 | - ><img src="/@@/edit" alt="[Edit]" |
562 | - title="Change this option details" /></a> |
563 | - </td> |
564 | - </tr> |
565 | - </table> |
566 | - </tal:block> |
567 | - |
568 | - <p class="warning message" tal:condition="not: context/getAllOptions"> |
569 | - This poll doesn't have any options for people to vote on yet. |
570 | - Make sure you add some options before the poll opens! |
571 | - </p> |
572 | - |
573 | - </div> |
574 | - |
575 | -</body> |
576 | -</html> |
577 | |
578 | === modified file 'lib/lp/registry/templates/poll-portlet-options.pt' |
579 | --- lib/lp/registry/templates/poll-portlet-options.pt 2009-07-17 17:59:07 +0000 |
580 | +++ lib/lp/registry/templates/poll-portlet-options.pt 2009-08-19 19:48:09 +0000 |
581 | @@ -7,22 +7,38 @@ |
582 | <div class="portlet" id="portlet-options"> |
583 | |
584 | <h2>Voting options</h2> |
585 | - |
586 | - <div class="portletBody portletContent" |
587 | - tal:define="options context/getAllOptions"> |
588 | - |
589 | - <ul tal:condition="options"> |
590 | - <li tal:repeat="option options"> |
591 | - <b tal:content="option/name">name</b>: |
592 | - <span tal:replace="option/title">The Title of the option</span> |
593 | - (<span tal:condition="option/active" |
594 | - >active</span><span |
595 | - tal:condition="not: option/active">inactive</span>) |
596 | - </li> |
597 | - </ul> |
598 | - <p tal:condition="not: options"> |
599 | - <i>No options yet specified.</i> |
600 | - </p> |
601 | - </div> |
602 | + <tal:block condition="context/getAllOptions"> |
603 | + <table class="listing" id="options"> |
604 | + <thead> |
605 | + <tr> |
606 | + <th>Name</th> |
607 | + <th>Title</th> |
608 | + <th>Active</th> |
609 | + <th tal:condition="context/required:launchpad.Edit"></th> |
610 | + </tr> |
611 | + </thead> |
612 | + <tr tal:repeat="polloption context/getAllOptions"> |
613 | + <td tal:content="polloption/name">mjg59</td> |
614 | + <td tal:content="polloption/title">This guy rocks!</td> |
615 | + <td> |
616 | + <tal:is_active condition="polloption/active">Yes</tal:is_active> |
617 | + <tal:inactive condition="not: polloption/active">No</tal:inactive> |
618 | + </td> |
619 | + <td tal:condition="context/required:launchpad.Edit"> |
620 | + <a tal:attributes="href polloption/fmt:url" |
621 | + ><img src="/@@/edit" alt="[Edit]" |
622 | + title="Change this option details" /></a> |
623 | + </td> |
624 | + </tr> |
625 | + </table> |
626 | + </tal:block> |
627 | + |
628 | + <p class="warning message" tal:condition="not: context/getAllOptions"> |
629 | + This poll doesn't have any options for people to vote on yet. |
630 | + Make sure you add some options before the poll opens! |
631 | + </p> |
632 | + |
633 | + <tal:new-option replace="structure context/menu:overview/addnew/render" /> |
634 | + |
635 | </div> |
636 | </tal:root> |
637 | |
638 | === modified file 'lib/lp/registry/templates/poll-vote-condorcet.pt' |
639 | --- lib/lp/registry/templates/poll-vote-condorcet.pt 2009-07-17 17:59:07 +0000 |
640 | +++ lib/lp/registry/templates/poll-vote-condorcet.pt 2009-08-19 19:48:09 +0000 |
641 | @@ -1,37 +1,20 @@ |
642 | -<tal:root |
643 | - xmlns:tal="http://xml.zope.org/namespaces/tal" |
644 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
645 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
646 | - omit-tag=""> |
647 | - |
648 | -<tal:do-this-first replace="view/processForm" /> |
649 | <html |
650 | xmlns="http://www.w3.org/1999/xhtml" |
651 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
652 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
653 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
654 | - xml:lang="en" |
655 | - lang="en" |
656 | - dir="ltr" |
657 | - metal:use-macro="context/@@main_template/master" |
658 | + metal:use-macro="view/macro:page/main_only" |
659 | i18n:domain="launchpad" |
660 | > |
661 | <body> |
662 | |
663 | -<metal:leftportlets fill-slot="portlets_one"> |
664 | - <div tal:replace="structure context/@@+portlet-details" /> |
665 | - <div tal:replace="structure context/team/@@+portlet-details" /> |
666 | -</metal:leftportlets> |
667 | - |
668 | -<metal:rightportlets fill-slot="portlets_two"> |
669 | - <div tal:replace="structure context/@@+portlet-options" /> |
670 | -</metal:rightportlets> |
671 | + <tal:heading metal:fill-slot="heading"> |
672 | + <h1 tal:content="context/title">Mozilla</h1> |
673 | + </tal:heading> |
674 | |
675 | <div metal:fill-slot="main"> |
676 | |
677 | <tal:open-poll condition="context/isOpen"> |
678 | - <h1>Condorcet poll</h1> |
679 | - |
680 | <tal:can-vote condition="view/userCanVote"> |
681 | <p |
682 | tal:condition="view/feedback" |
683 | @@ -125,6 +108,7 @@ |
684 | <tal:block condition="not: view/userVoted"> |
685 | <input type="submit" value="Vote" name="vote" /> |
686 | </tal:block> |
687 | + or <a tal:attributes="href context/team/fmt:url/+polls">Cancel</a> |
688 | </td> |
689 | </tr> |
690 | </table> |
691 | @@ -144,4 +128,3 @@ |
692 | </div> |
693 | </body> |
694 | </html> |
695 | -</tal:root> |
696 | |
697 | === modified file 'lib/lp/registry/templates/poll-vote-simple.pt' |
698 | --- lib/lp/registry/templates/poll-vote-simple.pt 2009-07-17 17:59:07 +0000 |
699 | +++ lib/lp/registry/templates/poll-vote-simple.pt 2009-08-19 19:48:09 +0000 |
700 | @@ -1,36 +1,19 @@ |
701 | -<tal:root |
702 | - xmlns:tal="http://xml.zope.org/namespaces/tal" |
703 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
704 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
705 | - omit-tag=""> |
706 | - |
707 | -<tal:do-this-first replace="view/processForm" /> |
708 | <html |
709 | xmlns="http://www.w3.org/1999/xhtml" |
710 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
711 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
712 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
713 | - xml:lang="en" |
714 | - lang="en" |
715 | - dir="ltr" |
716 | - metal:use-macro="context/@@main_template/master" |
717 | + metal:use-macro="view/macro:page/main_only" |
718 | i18n:domain="launchpad" |
719 | > |
720 | <body> |
721 | |
722 | -<metal:leftportlets fill-slot="portlets_one"> |
723 | - <div tal:replace="structure context/@@+portlet-details" /> |
724 | - <div tal:replace="structure context/team/@@+portlet-details" /> |
725 | -</metal:leftportlets> |
726 | - |
727 | -<metal:rightportlets fill-slot="portlets_two"> |
728 | - <div tal:replace="structure context/@@+portlet-options" /> |
729 | -</metal:rightportlets> |
730 | + <tal:heading metal:fill-slot="heading"> |
731 | + <h1 tal:content="context/title">Mozilla</h1> |
732 | + </tal:heading> |
733 | |
734 | <div metal:fill-slot="main"> |
735 | |
736 | - <h1 tal:content="context/title" /> |
737 | - |
738 | <tal:open-poll condition="context/isOpen"> |
739 | |
740 | <tal:can-vote condition="view/userCanVote"> |
741 | @@ -134,6 +117,7 @@ |
742 | <br /> |
743 | |
744 | <input type="submit" value="Continue" name="continue" /> |
745 | + or <a tal:attributes="href context/team/fmt:url/+polls">Cancel</a> |
746 | </td> |
747 | </tr> |
748 | </table> |
749 | @@ -155,4 +139,3 @@ |
750 | |
751 | </body> |
752 | </html> |
753 | -</tal:root> |
754 | |
755 | === modified file 'lib/lp/registry/templates/polloption-edit.pt' |
756 | --- lib/lp/registry/templates/polloption-edit.pt 2009-07-17 17:59:07 +0000 |
757 | +++ lib/lp/registry/templates/polloption-edit.pt 2009-08-18 20:24:56 +0000 |
758 | @@ -3,19 +3,12 @@ |
759 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
760 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
761 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
762 | - xml:lang="en" |
763 | - lang="en" |
764 | - dir="ltr" |
765 | - metal:use-macro="context/@@main_template/master" |
766 | + metal:use-macro="view/macro:page/main_only" |
767 | i18n:domain="launchpad" |
768 | > |
769 | |
770 | <body> |
771 | |
772 | - <metal:portlets fill-slot="portlets"> |
773 | - <div tal:replace="structure context/poll/@@+portlet-details" /> |
774 | - </metal:portlets> |
775 | - |
776 | <div metal:fill-slot="main"> |
777 | |
778 | <tal:block condition="context/poll/isNotYetOpened"> |
779 | |
780 | === modified file 'lib/lp/registry/templates/team-polls.pt' |
781 | --- lib/lp/registry/templates/team-polls.pt 2009-07-17 17:59:07 +0000 |
782 | +++ lib/lp/registry/templates/team-polls.pt 2009-08-18 20:24:56 +0000 |
783 | @@ -78,8 +78,8 @@ |
784 | |
785 | <br /> |
786 | <tal:block tal:condition="request/lp:person"> |
787 | - <ul class="add" tal:condition="context/required:launchpad.Edit"> |
788 | - <li><a href="+newpoll">Set up a new poll</a></li> |
789 | + <ul tal:condition="context/required:launchpad.Edit"> |
790 | + <li><a class="sprite add" href="+newpoll">Set up a new poll</a></li> |
791 | </ul> |
792 | </tal:block> |
793 |
= Summary =
Convert a few poll pages to 3.0
== Proposed fix ==
Convert the easy edit pages and turn the action menu into a related
pages section at the bottom.
before/after screenshots at /devpad. canonical. com/~salgado/ poll-shots/
https:/
== Pre-implementation notes ==
== Implementation details ==
== Tests ==
./bin/test -vvt stories.team-polls
== 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: registry/ browser/ configure. zcml registry/ templates/ poll-newoption. pt registry/ stories/ team-polls/ edit-options. txt registry/ templates/ team-polls. pt registry/ templates/ polloption- edit.pt registry/ browser/ poll.py registry/ templates/ poll-edit. pt registry/ stories/ team-polls/ create- poll-options. txt
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/