Merge lp:~adiroiban/launchpad/bug-340664 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Graham Binns on 2010-02-16 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~adiroiban/launchpad/bug-340664 |
| Merge into: | lp:launchpad |
| Diff against target: |
691 lines (+230/-279) 6 files modified
lib/lp/translations/browser/distroseries.py (+5/-10) lib/lp/translations/browser/potemplate.py (+43/-5) lib/lp/translations/browser/productseries.py (+5/-11) lib/lp/translations/stories/productseries/xx-productseries-templates.txt (+0/-95) lib/lp/translations/stories/standalone/xx-series-templates.txt (+105/-49) lib/lp/translations/templates/object-templates.pt (+72/-109) |
| To merge this branch: | bzr merge lp:~adiroiban/launchpad/bug-340664 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Graham Binns (community) | 2010-02-02 | Approve on 2010-02-16 | |
| Curtis Hovey (community) | ui | 2010-02-04 | Approve on 2010-02-15 |
|
Review via email:
|
|||
| Adi Roiban (adiroiban) wrote : | # |
| Michael Nelson (michael.nelson) wrote : | # |
Hi Adi, I'm requesting a UI review from Curtis first (he's been starved of them), as it's always worth doing that before the code review.
| Curtis Hovey (sinzui) wrote : | # |
Hi Adi.
This is a good start. I was please to see a presentation that deemphasised
the action to improve the readability of the page.
The behaviour of these actions is disconcerting. When I edit a a template,
the next_url is the template, but I expected to return to the all templates
view. I know that this behaviour has not changed in this branch. I do not
see any bugs that pertain to this surprise--maybe I do not know what to
search on. Here is an example of how to negotiate multiple origins:
@property
def next_url(self):
referrer = self.request.
if (referrer is not None
and referrer.
return referrer
else:
return canonical_
We should discuss if this is in scope. If not this should be a bug reported
against translations.
See below for some 3.0 style concerns.
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
...
+ <td class="
+ tal:condition=
+ <div class="
+ <tal:maintainer condition=
+ <a tal:attributes=
+ title string:Edit ${template/name}'s details">
+ <img src="/@@/edit" /> Edit</a>
+ <a tal:attributes=
+ title string:Upload translations to ${template/name}">
+ <img src="/@@/add" /> Upload</a>
+ </tal:maintainer>
+ <a tal:attributes=
+ title string:Download translations from ${template/name}">
+ <img src="/@@/download" />
+ <tal:admin condition=
+ <a tal:attributes=
+ title string:Administer ${template/name}">
+ <img src="/@@/edit" />
+ </tal:admin>
I an uncomfortable with these hand crafted links. We usually need extra tests
to verify that the permission and URL that is in the same as the canonical
definitions used by menus, and render the correct markup.
This rendered markup is not 3.0 style. This should use a sprite, which will
fix the strange underlining issues I see under the icon eg:
class="sprint edit"
All these links appear to be defined in POTemplateMenu, so I think you can
avoid writing lots of tests by removing this exceptional markup with:
<a tal:replace=
The URL is guaranteed by menu:translations. The markup is guaranteed by
fmt:link. This does permission checking for you too. This will be consistent
with other links....
| Adi Roiban (adiroiban) wrote : | # |
Hi Curtis and thanks for taking the time to do this review.
I agree that the forms next url is buggy. I think it is best to open a new bug report as this diff could become to big. If you consider this is issues is valid for a new bug,I can take care of reporting and solving that bug.
I agree that it is best to use the URL formatter, rather than constructing the URL in the template.
I think we can rename „Settings” to „Edit”.
Should we keep the javascript that hides the icons and only shows them on mouseover?
| Curtis Hovey (sinzui) wrote : | # |
I like the hover presentation. I want to see it on edge to get feedback from users. Please file a bug about the next URL problem.
| Adi Roiban (adiroiban) wrote : | # |
I filled bug 522188.
The hover presentation is already on edge. ie: https:/
I tried to look into doc/tales.txt but I am not sure if the are covering all permissions testing or if I should move the permission testing for templates actions in a different test. Any advice is much appreciated. Thanks!
Bellow is the diff with the latest changes:
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -175,21 +175,21 @@
@enabled_
def upload(self):
text = 'Upload'
- return Link('+upload', text)
+ return Link('+upload', text, icon='add')
def download(self):
text = 'Download'
- return Link('+export', text)
+ return Link('+export', text, icon='download')
@enabled_
def edit(self):
- text = 'Settings'
- return Link('+edit', text)
+ text = 'Edit'
+ return Link('+edit', text, icon='edit')
@enabled_
def administer(self):
text = 'Administer'
- return Link('+admin', text)
+ return Link('+admin', text, icon='edit')
class POTemplateSubse
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -7,8 +7,8 @@
<body>
<div metal:fill-
<style type="text/css">
- .inactive_links a img{
- visibility: hidden;
+ .inactive_links a{
+ background: none;
}
color: lightgray;
@@ -130,22 +130,18 @@
<td class="
<div class="
- <tal:maintainer condition=
- <a tal:attributes=
- title string:Edit ${template/name}'s details">
- <img src="/@@/edit" /> Edit</a>
- <a tal:attributes=
- title string:Upload translations to ${template/name}">
- <img src="/@@/add" /> Upload</a>
- </tal:maintainer>
- <a tal:attributes=
- title string:Download translations from ${template/name}">
- <img src="/@@/download" />
- <tal:admin condition=
- <a tal:attributes=
- title string:Administer ${template/name}">
- <img src="/@@/edit" />
| Curtis Hovey (sinzui) wrote : | # |
Thanks for these changes. These links finally meet launchpad 2.0 rules after 18 months.
We do not need explict tests for most links because the decorator and formatter rules are well tested.
| Graham Binns (gmb) wrote : | # |
Hi Adi,
You've got a typo in xx-series-
s/lenght/length/. Other than that this is a nice branch and I'm happy for it to land. I'll run it through ec2 for you.
| Graham Binns (gmb) wrote : | # |
(Approved revision: 10102).
| Adi Roiban (adiroiban) wrote : | # |
Many thanks for the review!
I have pushed the typo fix.
When you have time, please run it through ec2. There is no hurry.

= Bug 340664 =
As discussed during Translations 3.0 UI sprint, we've decided to add administration page listing all templates for a single series. This would be mostly used by maintainers, and initially should have following columns:
* template
* length (number of messages)
* languages (that have at least some translations)
* last update
* editing button
Showing priority might not be a bad idea either.
== Proposed fix ==
Add priority, length and languages to the +templates pages.
== Pre-implementation notes ==
Last update and editing buttons were added in previous branches.
I talked with Danilo and he said the screenshots are OK and this is the intended way for fixing the bug.
== Implementation details == templates and productseries- templates stories were merged into a single series-templates file.
distroseries-
Since both product and distribution series are using the same template for displaying templates list, I have create a base class for those views.
object-template.pt logic was moved from the template to the view and the new template should be easier to read.
== Tests ==
lp-test -t series-templates
== Demo and Q/A == /translations. launchpad. dev/evolution/ trunk/+ templates
Log in as admin and go to a product +templates page
https:/
The table should look like in this screenshot: launchpadlibrar ian.net/ 37268665/ productseries. png
http://
Log in as admin and go to a distribution +templates page launchpadlibrar ian.net/ 37268672/ distroseries. png
The table should look like in this screenshot:
http://
When logged in as a normal user you should not see the edit, upload and admin links.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: translations/ browser/ distroseries. py translations/ browser/ productseries. py
lib/lp/
lib/lp/