Merge lp:~danilo/launchpad/bug-516317 into lp:launchpad
- bug-516317
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Данило Шеган |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12155 |
Proposed branch: | lp:~danilo/launchpad/bug-516317 |
Merge into: | lp:launchpad |
Diff against target: |
654 lines (+88/-112) 21 files modified
lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt (+2/-2) lib/lp/registry/browser/configure.zcml (+0/-7) lib/lp/registry/browser/distribution.py (+2/-2) lib/lp/registry/browser/product.py (+1/-9) lib/lp/registry/configure.zcml (+2/-8) lib/lp/registry/interfaces/distribution.py (+4/-3) lib/lp/registry/interfaces/product.py (+2/-2) lib/lp/translations/browser/configure.zcml (+5/-6) lib/lp/translations/browser/distribution.py (+10/-9) lib/lp/translations/browser/product.py (+11/-14) lib/lp/translations/stories/distribution/xx-distribution-translations.txt (+6/-5) lib/lp/translations/stories/standalone/xx-potemplate-index.txt (+9/-18) lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt (+6/-4) lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt (+3/-3) lib/lp/translations/stories/translationgroups/15-product-translation-group.txt (+4/-4) lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt (+2/-1) lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt (+1/-1) lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt (+10/-9) lib/lp/translations/templates/distribution-translations.pt (+4/-0) lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt (+0/-5) lib/lp/translations/templates/project-translations.pt (+4/-0) |
To merge this branch: | bzr merge lp:~danilo/launchpad/bug-516317 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Henning Eggers (community) | ui,code | Approve | |
Launchpad code reviewers | Pending | ||
Review via email: mp+44746@code.launchpad.net |
Commit message
[r=henninge]
Description of the change
= Bug 516317 =
Merge +settings and +configure-
Caveats:
- At the moment, products have double link to "configure translations" page: http://
- At the moment, Ubuntu doesn't have "configure translations" near the top, even though I think it should (where it says what's the default focus): http://
- I haven't updated the project group page (see eg. https:/
- Ideally, we'd have all this ajaxified and we could eg. change permissions just-in-place, be able to set up per-series translation settings while choosing translation focus... But hey :)
- I am unsure about "custom language codes" link: I feel it should be close to "Configure translations" link (maybe even available from the settings page)
Though I'd like to fix all of these, I still think getting these onto single translations configuration page is a win in itself and I'd probably be happy if I get your input on the first two points: should I keep the double "configure translations" link on the project page (I'd like to get rid of the first one, but since that one was added by registry, I want second opinion :), and what should I do for the distro page (I'd like to have a "change" button near the translation focus description)?
FWIW, remaining lint issue is due to comment being treated as empty line.
== Tests ==
bin/test -cvvm lp.translations -t stories
== Demo and Q/A ==
https:/
https:/
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
982: E301 expected 1 blank line, found 2
Данило Шеган (danilo) wrote : | # |
Ok, I've got rid of the double link and added a top-level link for the distribution. I didn't change "project" to "distribution" for official_rosetta in the interface since it's still extended by other interfaces like IProduct.
Henning Eggers (henninge) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Danilo,
thank you for this branch, great improvement in this. I am happy with you
landing this but please consider my few little comments.
review approve code,ui
Cheers,
Henning
> === modified file 'lib/lp/
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -430,7 +430,7 @@
> def configure_
> text = 'Configure translations'
> summary = 'Allow users to provide translations for this project.'
> - return Link('+edit', text, summary, icon='edit')
> + return Link('+
This may be missing a site="translations" parameter but I just checked the
other links on the project page and they all go to the root site. In fact they
seem to be available on all sites. All other links to +configure-
go to the translations site. I don't know if there is some kind of concept
behind this setup or if it is just an oversight.
For a distribution, +configure-
translations site. This adds to my confusion here.
But I don't think you need to do anything about it now. ;)
>
>
> class DerivativeDistr
>
> === modified file 'lib/lp/
> === modified file 'lib/lp/
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -284,9 +284,9 @@
> "get the full functionality of LP")
>
> translation_focus = Choice(
> - title=_
> + title=_
> description=_(
> - "The DistroSeries that should get the translation effort focus."),
> + "The release series translators should focus on."),
"The release series *that* translators should focus on." is much better to read.
> required=False,
> vocabulary=
>
> @@ -636,7 +636,8 @@
> archive = ubuntu.main_archive
> series = ubuntu.
> print archive.
> - source_
> + source_
> + distro_
> """
> export_
>
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -679,11 +679,11 @@
>
> translation_focus = exported(
> ReferenceChoice(
> - title=_
> + title=_
> vocabulary=
> schema=
Henning Eggers (henninge) : | # |
Данило Шеган (danilo) wrote : | # |
Henning, thanks again for the review. I didn't apply all of your
comments though, so see below.
У сре, 29. 12 2010. у 16:08 +0000, Henning Eggers пише:
>
> This may be missing a site="translations" parameter but I just checked
> the other links on the project page and they all go to the root site.
> In fact they seem to be available on all sites. All other links to
> +configure-
> there is some kind of concept behind this setup or if it is just an
> oversight.
>
> For a distribution, +configure-
> translations site. This adds to my confusion here.
Indeed. As explained on IRC, all this is intentional, but just because
I touch on work done by others. Ideally, I think we should just let
them live on the translations site, but that should be made a general
policy. I didn't change distribution one because that one is basically
entirely different, and I brought them only slightly closer together (by
using the same page ID and narrative).
> > + "The release series translators should focus on."),
>
> "The release series *that* translators should focus on." is much
> better to read.
I disagree, and looking online, so do many others (especially in
writing). I've still adjusted it (in both places) so as to make my nice
reviewer happy :)
As for the facet attribute, entire section is included in <facet
facet="
Still, considering it's useless, I removed it.
> > class DistributionSet
> DistributionEdi
> > - label = "Set permissions and policies"
> > - field_names = ["translationgr
> > -
> > - @property
> > - def page_title(self):
> > - return "Set translation permissions for %s" % (
> > - self.context.
> > + label = "Translations settings"
>
> Yeah! Finally this page is converted to 3.0! ;) I think, though, that
> it is custom to include the displayname of the context in the label.
I believe that we (LP team) have had a long discussion about this in the
past, and agreed that it isn't. The result of not including it makes
the following critical elements as such:
| Settings : Translations : Ubuntu (Browser title)
+------
| __
| / \ Ubuntu Linux
| \ /
| ^^ Overview Code Bugs *Translations* Answers
|
| <h1>Translation settings</h1>
| Ubuntu > Translations > Settings
And I hold a very strong opinion that including context is not necessary
considering[*] context is mentioned in the page title, at the top of the
page and in breadcrumbs right after the heading. The only decent
argument in favor of including it I could ever hear is that it is better
for search engines. But, with context being so prominent anyway, I
doubt it will make much of a difference.
[*] "...considering *that* context...", if you please :)
Preview Diff
1 | === modified file 'lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt' | |||
2 | --- lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt 2010-12-16 19:27:54 +0000 | |||
3 | +++ lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt 2010-12-30 20:12:18 +0000 | |||
4 | @@ -147,8 +147,8 @@ | |||
5 | 147 | >>> check("/ubuntu/+edit", auth=True) | 147 | >>> check("/ubuntu/+edit", auth=True) |
6 | 148 | >>> check("/ubuntu/+reassign", auth=True) | 148 | >>> check("/ubuntu/+reassign", auth=True) |
7 | 149 | >>> check("/ubuntu/+selectmemberteam", auth=True) | 149 | >>> check("/ubuntu/+selectmemberteam", auth=True) |
10 | 150 | >>> check("/ubuntu/+settings", host='translations.launchpad.dev', | 150 | >>> check("/ubuntu/+configure-translations", |
11 | 151 | ... auth=True) | 151 | ... host='translations.launchpad.dev', auth=True) |
12 | 152 | >>> check("/ubuntu/hoary/+addmilestone", auth=True) | 152 | >>> check("/ubuntu/hoary/+addmilestone", auth=True) |
13 | 153 | >>> check("/ubuntu/+addspec", auth=True) | 153 | >>> check("/ubuntu/+addspec", auth=True) |
14 | 154 | >>> check("/ubuntu/+imports", host='translations.launchpad.dev') | 154 | >>> check("/ubuntu/+imports", host='translations.launchpad.dev') |
15 | 155 | 155 | ||
16 | === modified file 'lib/lp/registry/browser/configure.zcml' | |||
17 | --- lib/lp/registry/browser/configure.zcml 2010-12-20 20:16:02 +0000 | |||
18 | +++ lib/lp/registry/browser/configure.zcml 2010-12-30 20:12:18 +0000 | |||
19 | @@ -1443,13 +1443,6 @@ | |||
20 | 1443 | template="../../app/templates/generic-edit.pt" | 1443 | template="../../app/templates/generic-edit.pt" |
21 | 1444 | class="lp.registry.browser.product.ProductConfigureBlueprintsView"/> | 1444 | class="lp.registry.browser.product.ProductConfigureBlueprintsView"/> |
22 | 1445 | <browser:page | 1445 | <browser:page |
23 | 1446 | for="lp.registry.interfaces.product.IProduct" | ||
24 | 1447 | facet="overview" | ||
25 | 1448 | permission="launchpad.Edit" | ||
26 | 1449 | name="+configure-translations" | ||
27 | 1450 | template="../../app/templates/generic-edit.pt" | ||
28 | 1451 | class="lp.registry.browser.product.ProductConfigureTranslationsView"/> | ||
29 | 1452 | <browser:page | ||
30 | 1453 | name="+branding" | 1446 | name="+branding" |
31 | 1454 | for="lp.registry.interfaces.product.IProduct" | 1447 | for="lp.registry.interfaces.product.IProduct" |
32 | 1455 | facet="overview" | 1448 | facet="overview" |
33 | 1456 | 1449 | ||
34 | === modified file 'lib/lp/registry/browser/distribution.py' | |||
35 | --- lib/lp/registry/browser/distribution.py 2010-12-16 19:59:20 +0000 | |||
36 | +++ lib/lp/registry/browser/distribution.py 2010-12-30 20:12:18 +0000 | |||
37 | @@ -426,11 +426,11 @@ | |||
38 | 426 | summary = 'Enable tracking of feature planning.' | 426 | summary = 'Enable tracking of feature planning.' |
39 | 427 | return Link('+edit', text, summary, icon='edit') | 427 | return Link('+edit', text, summary, icon='edit') |
40 | 428 | 428 | ||
42 | 429 | @enabled_with_permission('launchpad.Edit') | 429 | @enabled_with_permission('launchpad.TranslationsAdmin') |
43 | 430 | def configure_translations(self): | 430 | def configure_translations(self): |
44 | 431 | text = 'Configure translations' | 431 | text = 'Configure translations' |
45 | 432 | summary = 'Allow users to provide translations for this project.' | 432 | summary = 'Allow users to provide translations for this project.' |
47 | 433 | return Link('+edit', text, summary, icon='edit') | 433 | return Link('+configure-translations', text, summary, icon='edit') |
48 | 434 | 434 | ||
49 | 435 | 435 | ||
50 | 436 | class DerivativeDistributionOverviewMenu(DistributionOverviewMenu): | 436 | class DerivativeDistributionOverviewMenu(DistributionOverviewMenu): |
51 | 437 | 437 | ||
52 | === modified file 'lib/lp/registry/browser/product.py' | |||
53 | --- lib/lp/registry/browser/product.py 2010-12-21 17:18:59 +0000 | |||
54 | +++ lib/lp/registry/browser/product.py 2010-12-30 20:12:18 +0000 | |||
55 | @@ -15,7 +15,6 @@ | |||
56 | 15 | 'ProductConfigureBase', | 15 | 'ProductConfigureBase', |
57 | 16 | 'ProductConfigureAnswersView', | 16 | 'ProductConfigureAnswersView', |
58 | 17 | 'ProductConfigureBlueprintsView', | 17 | 'ProductConfigureBlueprintsView', |
59 | 18 | 'ProductConfigureTranslationsView', | ||
60 | 19 | 'ProductDownloadFileMixin', | 18 | 'ProductDownloadFileMixin', |
61 | 20 | 'ProductDownloadFilesView', | 19 | 'ProductDownloadFilesView', |
62 | 21 | 'ProductEditPeopleView', | 20 | 'ProductEditPeopleView', |
63 | @@ -525,7 +524,7 @@ | |||
64 | 525 | summary = 'Specify where bugs are tracked for this project' | 524 | summary = 'Specify where bugs are tracked for this project' |
65 | 526 | return Link('+configure-bugtracker', text, summary, icon='edit') | 525 | return Link('+configure-bugtracker', text, summary, icon='edit') |
66 | 527 | 526 | ||
68 | 528 | @enabled_with_permission('launchpad.Edit') | 527 | @enabled_with_permission('launchpad.TranslationsAdmin') |
69 | 529 | def configure_translations(self): | 528 | def configure_translations(self): |
70 | 530 | text = 'Configure translations' | 529 | text = 'Configure translations' |
71 | 531 | summary = 'Allow users to submit translations for this project' | 530 | summary = 'Allow users to submit translations for this project' |
72 | @@ -1432,13 +1431,6 @@ | |||
73 | 1432 | usage_fieldname = 'blueprints_usage' | 1431 | usage_fieldname = 'blueprints_usage' |
74 | 1433 | 1432 | ||
75 | 1434 | 1433 | ||
76 | 1435 | class ProductConfigureTranslationsView(ProductConfigureBase): | ||
77 | 1436 | """View class to configure the Launchpad Translations for a project.""" | ||
78 | 1437 | |||
79 | 1438 | label = "Configure translations" | ||
80 | 1439 | usage_fieldname = 'translations_usage' | ||
81 | 1440 | |||
82 | 1441 | |||
83 | 1442 | class ProductConfigureAnswersView(ProductConfigureBase): | 1434 | class ProductConfigureAnswersView(ProductConfigureBase): |
84 | 1443 | """View class to configure the Launchpad Answers for a project.""" | 1435 | """View class to configure the Launchpad Answers for a project.""" |
85 | 1444 | 1436 | ||
86 | 1445 | 1437 | ||
87 | === modified file 'lib/lp/registry/configure.zcml' | |||
88 | --- lib/lp/registry/configure.zcml 2010-12-15 22:05:43 +0000 | |||
89 | +++ lib/lp/registry/configure.zcml 2010-12-30 20:12:18 +0000 | |||
90 | @@ -1107,6 +1107,7 @@ | |||
91 | 1107 | <require | 1107 | <require |
92 | 1108 | permission="launchpad.TranslationsAdmin" | 1108 | permission="launchpad.TranslationsAdmin" |
93 | 1109 | set_attributes=" | 1109 | set_attributes=" |
94 | 1110 | official_rosetta | ||
95 | 1110 | translation_focus | 1111 | translation_focus |
96 | 1111 | translationgroup | 1112 | translationgroup |
97 | 1112 | translationpermission"/> | 1113 | translationpermission"/> |
98 | @@ -1124,13 +1125,6 @@ | |||
99 | 1124 | set_schema="lp.registry.interfaces.product.IProductModerateRestricted" | 1125 | set_schema="lp.registry.interfaces.product.IProductModerateRestricted" |
100 | 1125 | set_attributes="active private_bugs "/> | 1126 | set_attributes="active private_bugs "/> |
101 | 1126 | 1127 | ||
102 | 1127 | <!-- Changes to official_rosetta must be available to Launchpad | ||
103 | 1128 | Translations admins so we need its own permission. --> | ||
104 | 1129 | |||
105 | 1130 | <require | ||
106 | 1131 | permission="launchpad.TranslationsAdmin" | ||
107 | 1132 | set_attributes="official_rosetta"/> | ||
108 | 1133 | |||
109 | 1134 | <!-- IHasAliases --> | 1128 | <!-- IHasAliases --> |
110 | 1135 | 1129 | ||
111 | 1136 | <allow | 1130 | <allow |
112 | @@ -1400,7 +1394,6 @@ | |||
113 | 1400 | official_answers | 1394 | official_answers |
114 | 1401 | official_blueprints | 1395 | official_blueprints |
115 | 1402 | official_malone | 1396 | official_malone |
116 | 1403 | official_rosetta | ||
117 | 1404 | owner | 1397 | owner |
118 | 1405 | security_contact | 1398 | security_contact |
119 | 1406 | summary | 1399 | summary |
120 | @@ -1413,6 +1406,7 @@ | |||
121 | 1413 | permission="launchpad.TranslationsAdmin" | 1406 | permission="launchpad.TranslationsAdmin" |
122 | 1414 | set_attributes=" | 1407 | set_attributes=" |
123 | 1415 | language_pack_admin | 1408 | language_pack_admin |
124 | 1409 | official_rosetta | ||
125 | 1416 | translationgroup | 1410 | translationgroup |
126 | 1417 | translationpermission | 1411 | translationpermission |
127 | 1418 | translation_focus"/> | 1412 | translation_focus"/> |
128 | 1419 | 1413 | ||
129 | === modified file 'lib/lp/registry/interfaces/distribution.py' | |||
130 | --- lib/lp/registry/interfaces/distribution.py 2010-12-01 11:26:57 +0000 | |||
131 | +++ lib/lp/registry/interfaces/distribution.py 2010-12-30 20:12:18 +0000 | |||
132 | @@ -284,9 +284,9 @@ | |||
133 | 284 | "get the full functionality of LP") | 284 | "get the full functionality of LP") |
134 | 285 | 285 | ||
135 | 286 | translation_focus = Choice( | 286 | translation_focus = Choice( |
137 | 287 | title=_("Translation Focus"), | 287 | title=_("Translation focus"), |
138 | 288 | description=_( | 288 | description=_( |
140 | 289 | "The DistroSeries that should get the translation effort focus."), | 289 | "The release series that translators should focus on."), |
141 | 290 | required=False, | 290 | required=False, |
142 | 291 | vocabulary='FilteredDistroSeries') | 291 | vocabulary='FilteredDistroSeries') |
143 | 292 | 292 | ||
144 | @@ -636,7 +636,8 @@ | |||
145 | 636 | archive = ubuntu.main_archive | 636 | archive = ubuntu.main_archive |
146 | 637 | series = ubuntu.current_series | 637 | series = ubuntu.current_series |
147 | 638 | print archive.getPublishedSources(exact_match=True, | 638 | print archive.getPublishedSources(exact_match=True, |
149 | 639 | source_name="apport", distro_series=series)[0].source_package_version | 639 | source_name="apport", |
150 | 640 | distro_series=series)[0].source_package_version | ||
151 | 640 | """ | 641 | """ |
152 | 641 | export_as_webservice_entry() | 642 | export_as_webservice_entry() |
153 | 642 | 643 | ||
154 | 643 | 644 | ||
155 | === modified file 'lib/lp/registry/interfaces/product.py' | |||
156 | --- lib/lp/registry/interfaces/product.py 2010-12-01 11:26:57 +0000 | |||
157 | +++ lib/lp/registry/interfaces/product.py 2010-12-30 20:12:18 +0000 | |||
158 | @@ -679,11 +679,11 @@ | |||
159 | 679 | 679 | ||
160 | 680 | translation_focus = exported( | 680 | translation_focus = exported( |
161 | 681 | ReferenceChoice( | 681 | ReferenceChoice( |
163 | 682 | title=_("Translation Focus"), required=False, | 682 | title=_("Translation focus"), required=False, |
164 | 683 | vocabulary='FilteredProductSeries', | 683 | vocabulary='FilteredProductSeries', |
165 | 684 | schema=IProductSeries, | 684 | schema=IProductSeries, |
166 | 685 | description=_( | 685 | description=_( |
168 | 686 | 'The ProductSeries where translations are focused.'))) | 686 | 'Project series that translators should focus on.'))) |
169 | 687 | 687 | ||
170 | 688 | translatable_packages = Attribute( | 688 | translatable_packages = Attribute( |
171 | 689 | "A list of the source packages for this product that can be " | 689 | "A list of the source packages for this product that can be " |
172 | 690 | 690 | ||
173 | === modified file 'lib/lp/translations/browser/configure.zcml' | |||
174 | --- lib/lp/translations/browser/configure.zcml 2010-12-22 12:05:12 +0000 | |||
175 | +++ lib/lp/translations/browser/configure.zcml 2010-12-30 20:12:18 +0000 | |||
176 | @@ -809,12 +809,11 @@ | |||
177 | 809 | template="../templates/hastranslationimports-index.pt" | 809 | template="../templates/hastranslationimports-index.pt" |
178 | 810 | layer="lp.translations.publisher.TranslationsLayer"/> | 810 | layer="lp.translations.publisher.TranslationsLayer"/> |
179 | 811 | <browser:page | 811 | <browser:page |
181 | 812 | name="+settings" | 812 | name="+configure-translations" |
182 | 813 | for="lp.registry.interfaces.product.IProduct" | 813 | for="lp.registry.interfaces.product.IProduct" |
183 | 814 | class="lp.translations.browser.product.ProductSettingsView" | 814 | class="lp.translations.browser.product.ProductSettingsView" |
184 | 815 | permission="launchpad.TranslationsAdmin" | 815 | permission="launchpad.TranslationsAdmin" |
187 | 816 | template="../templates/set-translators.pt" | 816 | template="../templates/configure-translations.pt"/> |
186 | 817 | layer="lp.translations.publisher.TranslationsLayer"/> | ||
188 | 818 | <browser:pages | 817 | <browser:pages |
189 | 819 | for="lp.registry.interfaces.product.IProduct" | 818 | for="lp.registry.interfaces.product.IProduct" |
190 | 820 | permission="zope.Public" | 819 | permission="zope.Public" |
191 | @@ -872,7 +871,7 @@ | |||
192 | 872 | for="lp.registry.interfaces.projectgroup.IProjectGroup" | 871 | for="lp.registry.interfaces.projectgroup.IProjectGroup" |
193 | 873 | class="lp.translations.browser.project.ProjectSettingsView" | 872 | class="lp.translations.browser.project.ProjectSettingsView" |
194 | 874 | permission="launchpad.TranslationsAdmin" | 873 | permission="launchpad.TranslationsAdmin" |
196 | 875 | template="../templates/set-translators.pt" | 874 | template="../templates/configure-translations.pt" |
197 | 876 | layer="lp.translations.publisher.TranslationsLayer"/> | 875 | layer="lp.translations.publisher.TranslationsLayer"/> |
198 | 877 | 876 | ||
199 | 878 | <!-- Distribution --> | 877 | <!-- Distribution --> |
200 | @@ -903,11 +902,11 @@ | |||
201 | 903 | class="lp.translations.browser.translations.HelpTranslateButtonView" | 902 | class="lp.translations.browser.translations.HelpTranslateButtonView" |
202 | 904 | permission="zope.Public"/> | 903 | permission="zope.Public"/> |
203 | 905 | <browser:page | 904 | <browser:page |
205 | 906 | name="+settings" | 905 | name="+configure-translations" |
206 | 907 | for="lp.registry.interfaces.distribution.IDistribution" | 906 | for="lp.registry.interfaces.distribution.IDistribution" |
207 | 908 | class="lp.translations.browser.distribution.DistributionSettingsView" | 907 | class="lp.translations.browser.distribution.DistributionSettingsView" |
208 | 909 | permission="launchpad.TranslationsAdmin" | 908 | permission="launchpad.TranslationsAdmin" |
210 | 910 | template="../templates/set-translators.pt" | 909 | template="../templates/configure-translations.pt" |
211 | 911 | layer="lp.translations.publisher.TranslationsLayer"/> | 910 | layer="lp.translations.publisher.TranslationsLayer"/> |
212 | 912 | <browser:page | 911 | <browser:page |
213 | 913 | for="lp.registry.interfaces.distribution.IDistribution" | 912 | for="lp.registry.interfaces.distribution.IDistribution" |
214 | 914 | 913 | ||
215 | === modified file 'lib/lp/translations/browser/distribution.py' | |||
216 | --- lib/lp/translations/browser/distribution.py 2010-09-23 14:33:51 +0000 | |||
217 | +++ lib/lp/translations/browser/distribution.py 2010-12-30 20:12:18 +0000 | |||
218 | @@ -44,7 +44,7 @@ | |||
219 | 44 | 44 | ||
220 | 45 | @enabled_with_permission('launchpad.TranslationsAdmin') | 45 | @enabled_with_permission('launchpad.TranslationsAdmin') |
221 | 46 | def settings(self): | 46 | def settings(self): |
223 | 47 | text = 'Change permissions' | 47 | text = 'Configure translations' |
224 | 48 | return Link('+settings', text, icon='edit', site='translations') | 48 | return Link('+settings', text, icon='edit', site='translations') |
225 | 49 | 49 | ||
226 | 50 | @enabled_with_permission('launchpad.TranslationsAdmin') | 50 | @enabled_with_permission('launchpad.TranslationsAdmin') |
227 | @@ -106,7 +106,7 @@ | |||
228 | 106 | 106 | ||
229 | 107 | def can_configure_translations(self): | 107 | def can_configure_translations(self): |
230 | 108 | """Whether or not the user can configure translations.""" | 108 | """Whether or not the user can configure translations.""" |
232 | 109 | return check_permission("launchpad.Edit", self.context) | 109 | return check_permission("launchpad.TranslationsAdmin", self.context) |
233 | 110 | 110 | ||
234 | 111 | def is_translations_admin(self): | 111 | def is_translations_admin(self): |
235 | 112 | """Whether or not the user is a translations admin.""" | 112 | """Whether or not the user is a translations admin.""" |
236 | @@ -129,13 +129,14 @@ | |||
237 | 129 | 129 | ||
238 | 130 | 130 | ||
239 | 131 | class DistributionSettingsView(TranslationsMixin, DistributionEditView): | 131 | class DistributionSettingsView(TranslationsMixin, DistributionEditView): |
247 | 132 | label = "Set permissions and policies" | 132 | label = "Translations settings" |
248 | 133 | field_names = ["translationgroup", "translationpermission"] | 133 | page_title = "Settings" |
249 | 134 | 134 | field_names = [ | |
250 | 135 | @property | 135 | "official_rosetta", |
251 | 136 | def page_title(self): | 136 | "translation_focus", |
252 | 137 | return "Set translation permissions for %s" % ( | 137 | "translationgroup", |
253 | 138 | self.context.displayname) | 138 | "translationpermission", |
254 | 139 | ] | ||
255 | 139 | 140 | ||
256 | 140 | @property | 141 | @property |
257 | 141 | def cancel_url(self): | 142 | def cancel_url(self): |
258 | 142 | 143 | ||
259 | === modified file 'lib/lp/translations/browser/product.py' | |||
260 | --- lib/lp/translations/browser/product.py 2010-09-23 14:33:51 +0000 | |||
261 | +++ lib/lp/translations/browser/product.py 2010-12-30 20:12:18 +0000 | |||
262 | @@ -20,7 +20,7 @@ | |||
263 | 20 | from canonical.launchpad.webapp.authorization import check_permission | 20 | from canonical.launchpad.webapp.authorization import check_permission |
264 | 21 | from canonical.launchpad.webapp.menu import NavigationMenu | 21 | from canonical.launchpad.webapp.menu import NavigationMenu |
265 | 22 | from lp.app.enums import service_uses_launchpad | 22 | from lp.app.enums import service_uses_launchpad |
267 | 23 | from lp.registry.browser.product import ProductEditView | 23 | from lp.registry.browser.product import ProductConfigureBase |
268 | 24 | from lp.registry.interfaces.product import IProduct | 24 | from lp.registry.interfaces.product import IProduct |
269 | 25 | from lp.registry.interfaces.productseries import IProductSeries | 25 | from lp.registry.interfaces.productseries import IProductSeries |
270 | 26 | from lp.registry.interfaces.series import SeriesStatus | 26 | from lp.registry.interfaces.series import SeriesStatus |
271 | @@ -45,8 +45,9 @@ | |||
272 | 45 | 45 | ||
273 | 46 | @enabled_with_permission('launchpad.TranslationsAdmin') | 46 | @enabled_with_permission('launchpad.TranslationsAdmin') |
274 | 47 | def settings(self): | 47 | def settings(self): |
277 | 48 | text = 'Change permissions' | 48 | text = 'Configure translations' |
278 | 49 | return Link('+settings', text, icon='edit', site='translations') | 49 | return Link( |
279 | 50 | '+configure-translations', text, icon='edit', site='translations') | ||
280 | 50 | 51 | ||
281 | 51 | @enabled_with_permission('launchpad.AnyPerson') | 52 | @enabled_with_permission('launchpad.AnyPerson') |
282 | 52 | def translationdownload(self): | 53 | def translationdownload(self): |
283 | @@ -70,21 +71,17 @@ | |||
284 | 70 | return Link(link, text, icon='translation') | 71 | return Link(link, text, icon='translation') |
285 | 71 | 72 | ||
286 | 72 | 73 | ||
290 | 73 | class ProductSettingsView(TranslationsMixin, ProductEditView): | 74 | class ProductSettingsView(TranslationsMixin, ProductConfigureBase): |
291 | 74 | label = "Set permissions and policies" | 75 | label = "Configure translations" |
292 | 75 | page_title = "Permissions and policies" | 76 | page_title = "Configure translations" |
293 | 77 | usage_fieldname = "translations_usage" | ||
294 | 76 | field_names = [ | 78 | field_names = [ |
295 | 79 | usage_fieldname, | ||
296 | 80 | "translation_focus", | ||
297 | 77 | "translationgroup", | 81 | "translationgroup", |
298 | 78 | "translationpermission", | 82 | "translationpermission", |
299 | 79 | "translation_focus", | ||
300 | 80 | ] | 83 | ] |
301 | 81 | 84 | ||
302 | 82 | @property | ||
303 | 83 | def cancel_url(self): | ||
304 | 84 | return canonical_url(self.context, rootsite="translations") | ||
305 | 85 | |||
306 | 86 | next_url = cancel_url | ||
307 | 87 | |||
308 | 88 | 85 | ||
309 | 89 | class ProductView(LaunchpadView): | 86 | class ProductView(LaunchpadView): |
310 | 90 | 87 | ||
311 | @@ -110,7 +107,7 @@ | |||
312 | 110 | 107 | ||
313 | 111 | def can_configure_translations(self): | 108 | def can_configure_translations(self): |
314 | 112 | """Whether or not the user can configure translations.""" | 109 | """Whether or not the user can configure translations.""" |
316 | 113 | return check_permission("launchpad.Edit", self.context) | 110 | return check_permission("launchpad.TranslationsAdmin", self.context) |
317 | 114 | 111 | ||
318 | 115 | def is_translations_admin(self): | 112 | def is_translations_admin(self): |
319 | 116 | """Whether or not the user is a translations admin.""" | 113 | """Whether or not the user is a translations admin.""" |
320 | 117 | 114 | ||
321 | === modified file 'lib/lp/translations/stories/distribution/xx-distribution-translations.txt' | |||
322 | --- lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2010-09-27 20:22:00 +0000 | |||
323 | +++ lib/lp/translations/stories/distribution/xx-distribution-translations.txt 2010-12-30 20:12:18 +0000 | |||
324 | @@ -1,4 +1,5 @@ | |||
326 | 1 | = Distribution translations = | 1 | Distribution translations |
327 | 2 | ========================= | ||
328 | 2 | 3 | ||
329 | 3 | This page shows a list of PO templates contained within all source | 4 | This page shows a list of PO templates contained within all source |
330 | 4 | packages for the distroseries that is the translation focus for a | 5 | packages for the distroseries that is the translation focus for a |
331 | @@ -91,7 +92,7 @@ | |||
332 | 91 | >>> logout() | 92 | >>> logout() |
333 | 92 | 93 | ||
334 | 93 | We should get latest release as the translation focus. | 94 | We should get latest release as the translation focus. |
336 | 94 | 95 | ||
337 | 95 | >>> browser.open('http://translations.launchpad.dev/debian') | 96 | >>> browser.open('http://translations.launchpad.dev/debian') |
338 | 96 | >>> browser.url | 97 | >>> browser.url |
339 | 97 | 'http://translations.launchpad.dev/debian' | 98 | 'http://translations.launchpad.dev/debian' |
340 | @@ -134,11 +135,11 @@ | |||
341 | 134 | ... auth='Basic jeff.waugh@ubuntulinux.com:jdub') | 135 | ... auth='Basic jeff.waugh@ubuntulinux.com:jdub') |
342 | 135 | >>> editor_browser.open('http://launchpad.dev/ubuntu') | 136 | >>> editor_browser.open('http://launchpad.dev/ubuntu') |
343 | 136 | >>> editor_browser.getLink('Change details').click() | 137 | >>> editor_browser.getLink('Change details').click() |
345 | 137 | >>> editor_browser.getControl('Translation Focus').displayValue | 138 | >>> editor_browser.getControl('Translation focus').displayValue |
346 | 138 | ['ubuntu hoary'] | 139 | ['ubuntu hoary'] |
348 | 139 | >>> editor_browser.getControl('Translation Focus').displayValue = [ | 140 | >>> editor_browser.getControl('Translation focus').displayValue = [ |
349 | 140 | ... 'ubuntu grumpy'] | 141 | ... 'ubuntu grumpy'] |
350 | 141 | >>> editor_browser.getControl('Change', index=3).click() | 142 | >>> editor_browser.getControl('Change', index=3).click() |
351 | 142 | >>> editor_browser.getLink('Change details').click() | 143 | >>> editor_browser.getLink('Change details').click() |
353 | 143 | >>> editor_browser.getControl('Translation Focus').displayValue | 144 | >>> editor_browser.getControl('Translation focus').displayValue |
354 | 144 | ['ubuntu grumpy'] | 145 | ['ubuntu grumpy'] |
355 | 145 | 146 | ||
356 | === modified file 'lib/lp/translations/stories/standalone/xx-potemplate-index.txt' | |||
357 | --- lib/lp/translations/stories/standalone/xx-potemplate-index.txt 2010-09-02 22:26:01 +0000 | |||
358 | +++ lib/lp/translations/stories/standalone/xx-potemplate-index.txt 2010-12-30 20:12:18 +0000 | |||
359 | @@ -40,7 +40,7 @@ | |||
360 | 40 | Afrikaans 22 ... ... — — | 40 | Afrikaans 22 ... ... — — |
361 | 41 | Japanese 21 ... ... ... Carlos... | 41 | Japanese 21 ... ... ... Carlos... |
362 | 42 | Sotho, Southern 22 ... ... — — | 42 | Sotho, Southern 22 ... ... — — |
364 | 43 | Spanish 15 1 1 ... Valentina Commissari | 43 | Spanish 15 1 1 ... Valent... |
365 | 44 | Xhosa 22 ... ... ... — | 44 | Xhosa 22 ... ... ... — |
366 | 45 | Zulu 22 ... ... — — | 45 | Zulu 22 ... ... — — |
367 | 46 | 46 | ||
368 | @@ -117,7 +117,8 @@ | |||
369 | 117 | A source package with five templates is created. | 117 | A source package with five templates is created. |
370 | 118 | 118 | ||
371 | 119 | >>> from zope.component import getUtility | 119 | >>> from zope.component import getUtility |
373 | 120 | >>> from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 120 | >>> from canonical.launchpad.interfaces.launchpad import ( |
374 | 121 | ... ILaunchpadCelebrities) | ||
375 | 121 | 122 | ||
376 | 122 | >>> login('admin@canonical.com') | 123 | >>> login('admin@canonical.com') |
377 | 123 | >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu | 124 | >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu |
378 | @@ -209,9 +210,6 @@ | |||
379 | 209 | 210 | ||
380 | 210 | A product series with 7 templates is created. | 211 | A product series with 7 templates is created. |
381 | 211 | 212 | ||
382 | 212 | >>> from zope.component import getUtility | ||
383 | 213 | >>> from canonical.launchpad.interfaces.launchpad import ( | ||
384 | 214 | ... ILaunchpadCelebrities) | ||
385 | 215 | >>> from lp.app.enums import ServiceUsage | 213 | >>> from lp.app.enums import ServiceUsage |
386 | 216 | >>> login('admin@canonical.com') | 214 | >>> login('admin@canonical.com') |
387 | 217 | >>> product = factory.makeProduct(name="fusa", | 215 | >>> product = factory.makeProduct(name="fusa", |
388 | @@ -281,9 +279,9 @@ | |||
389 | 281 | 279 | ||
390 | 282 | >>> user_browser.getLink('download').click() | 280 | >>> user_browser.getLink('download').click() |
391 | 283 | >>> print user_browser.url | 281 | >>> print user_browser.url |
393 | 284 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export | 282 | http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export |
394 | 285 | 283 | ||
396 | 286 | Translation administrators will see both download and upload links. | 284 | Translation administrators will see both download and upload links. |
397 | 287 | Beside administering this template, "Change permissions" | 285 | Beside administering this template, "Change permissions" |
398 | 288 | and "Change details" should be also accessible. | 286 | and "Change details" should be also accessible. |
399 | 289 | 287 | ||
400 | @@ -292,34 +290,27 @@ | |||
401 | 292 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') | 290 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') |
402 | 293 | >>> admin_browser.getLink('upload').click() | 291 | >>> admin_browser.getLink('upload').click() |
403 | 294 | >>> print admin_browser.url | 292 | >>> print admin_browser.url |
405 | 295 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload | 293 | http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+upload |
406 | 296 | 294 | ||
407 | 297 | >>> admin_browser.open( | 295 | >>> admin_browser.open( |
408 | 298 | ... 'http://translations.launchpad.dev/' | 296 | ... 'http://translations.launchpad.dev/' |
409 | 299 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') | 297 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') |
410 | 300 | >>> admin_browser.getLink('download').click() | 298 | >>> admin_browser.getLink('download').click() |
411 | 301 | >>> print admin_browser.url | 299 | >>> print admin_browser.url |
413 | 302 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export | 300 | http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+export |
414 | 303 | 301 | ||
415 | 304 | >>> admin_browser.open( | 302 | >>> admin_browser.open( |
416 | 305 | ... 'http://translations.launchpad.dev/' | 303 | ... 'http://translations.launchpad.dev/' |
417 | 306 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') | 304 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') |
418 | 307 | >>> admin_browser.getLink('Administer this template').click() | 305 | >>> admin_browser.getLink('Administer this template').click() |
419 | 308 | >>> print admin_browser.url | 306 | >>> print admin_browser.url |
421 | 309 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin | 307 | http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+admin |
422 | 310 | 308 | ||
423 | 311 | >>> admin_browser.open( | 309 | >>> admin_browser.open( |
424 | 312 | ... 'http://translations.launchpad.dev/' | 310 | ... 'http://translations.launchpad.dev/' |
425 | 313 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') | 311 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') |
426 | 314 | >>> admin_browser.getLink('Change details').click() | 312 | >>> admin_browser.getLink('Change details').click() |
427 | 315 | >>> print admin_browser.url | 313 | >>> print admin_browser.url |
436 | 316 | http://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit | 314 | http://trans.../ubuntu/hoary/+source/evolution/+pots/evolution-2.2/+edit |
429 | 317 | |||
430 | 318 | >>> admin_browser.open( | ||
431 | 319 | ... 'http://translations.launchpad.dev/' | ||
432 | 320 | ... 'ubuntu/hoary/+source/evolution/+pots/evolution-2.2') | ||
433 | 321 | >>> admin_browser.getLink('Change permissions').click() | ||
434 | 322 | >>> print admin_browser.url | ||
435 | 323 | http://translations.launchpad.dev/ubuntu/+settings | ||
437 | 324 | 315 | ||
438 | 325 | 316 | ||
439 | 326 | 317 | ||
440 | === modified file 'lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt' | |||
441 | --- lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt 2010-10-06 20:49:58 +0000 | |||
442 | +++ lib/lp/translations/stories/translationfocus/xx-product-translationfocus.txt 2010-12-30 20:12:18 +0000 | |||
443 | @@ -12,12 +12,13 @@ | |||
444 | 12 | 12 | ||
445 | 13 | Only admin users are able to change the translation focus of a product. | 13 | Only admin users are able to change the translation focus of a product. |
446 | 14 | Unprivileged users can see the recommended series for translation, | 14 | Unprivileged users can see the recommended series for translation, |
448 | 15 | but have no access to the 'Change permissions' menu. | 15 | but have no access to the 'Configure translations' menu. |
449 | 16 | 16 | ||
450 | 17 | >>> admin_browser.open(fooproject_url) | 17 | >>> admin_browser.open(fooproject_url) |
451 | 18 | >>> print extract_text( | 18 | >>> print extract_text( |
454 | 19 | ... find_tags_by_class(admin_browser.contents, 'edit sprite')[1]) | 19 | ... find_tags_by_class(admin_browser.contents, |
455 | 20 | Change permissions | 20 | ... 'menu-link-configure_translations')[0]) |
456 | 21 | Configure translations | ||
457 | 21 | 22 | ||
458 | 22 | >>> browser.open(fooproject_url) | 23 | >>> browser.open(fooproject_url) |
459 | 23 | >>> print extract_text( | 24 | >>> print extract_text( |
460 | @@ -85,5 +86,6 @@ | |||
461 | 85 | >>> browser.open(fooproject_url) | 86 | >>> browser.open(fooproject_url) |
462 | 86 | >>> print extract_text(find_tags_by_class(browser.contents, 'portlet')[0]) | 87 | >>> print extract_text(find_tags_by_class(browser.contents, 'portlet')[0]) |
463 | 87 | Translation details... | 88 | Translation details... |
465 | 88 | Launchpad currently recommends translating... Fooproject other-series series. | 89 | Launchpad currently recommends translating... |
466 | 90 | Fooproject other-series series. | ||
467 | 89 | ... | 91 | ... |
468 | 90 | 92 | ||
469 | === modified file 'lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt' | |||
470 | --- lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-10-05 20:25:59 +0000 | |||
471 | +++ lib/lp/translations/stories/translationgroups/10-distro-translation-group.txt 2010-12-30 20:12:18 +0000 | |||
472 | @@ -21,14 +21,14 @@ | |||
473 | 21 | >>> ubuntu_owner_browser = setupBrowser( | 21 | >>> ubuntu_owner_browser = setupBrowser( |
474 | 22 | ... auth='Basic colin.watson@ubuntulinux.com:test') | 22 | ... auth='Basic colin.watson@ubuntulinux.com:test') |
475 | 23 | >>> ubuntu_owner_browser.open(anon_browser.url) | 23 | >>> ubuntu_owner_browser.open(anon_browser.url) |
477 | 24 | >>> ubuntu_owner_browser.getLink('Change permissions').click() | 24 | >>> ubuntu_owner_browser.getLink('Configure translations').click() |
478 | 25 | >>> print ubuntu_owner_browser.title | 25 | >>> print ubuntu_owner_browser.title |
480 | 26 | Set translation permissions for Ubuntu... | 26 | Settings : Translations : Ubuntu |
481 | 27 | 27 | ||
482 | 28 | Other users cannot access this page, nor see the menu link to it. | 28 | Other users cannot access this page, nor see the menu link to it. |
483 | 29 | 29 | ||
484 | 30 | >>> user_browser.open(anon_browser.url) | 30 | >>> user_browser.open(anon_browser.url) |
486 | 31 | >>> user_browser.getLink('Change permissions').click() | 31 | >>> user_browser.getLink('Configure translations').click() |
487 | 32 | Traceback (most recent call last): | 32 | Traceback (most recent call last): |
488 | 33 | ... | 33 | ... |
489 | 34 | LinkNotFoundError | 34 | LinkNotFoundError |
490 | 35 | 35 | ||
491 | === modified file 'lib/lp/translations/stories/translationgroups/15-product-translation-group.txt' | |||
492 | --- lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-10-06 20:49:58 +0000 | |||
493 | +++ lib/lp/translations/stories/translationgroups/15-product-translation-group.txt 2010-12-30 20:12:18 +0000 | |||
494 | @@ -32,11 +32,11 @@ | |||
495 | 32 | group and permissions. | 32 | group and permissions. |
496 | 33 | 33 | ||
497 | 34 | >>> translations_page_url = netapplet_owner_browser.url | 34 | >>> translations_page_url = netapplet_owner_browser.url |
499 | 35 | >>> netapplet_owner_browser.getLink('Change permissions').click() | 35 | >>> netapplet_owner_browser.getLink('Configure translations').click() |
500 | 36 | >>> change_translators_url = netapplet_owner_browser.url | 36 | >>> change_translators_url = netapplet_owner_browser.url |
501 | 37 | 37 | ||
502 | 38 | >>> print netapplet_owner_browser.title | 38 | >>> print netapplet_owner_browser.title |
504 | 39 | Permissions and policies... | 39 | Configure translations : Translations : NetApplet |
505 | 40 | 40 | ||
506 | 41 | >>> print netapplet_owner_browser.getControl( | 41 | >>> print netapplet_owner_browser.getControl( |
507 | 42 | ... 'Translation group').displayOptions | 42 | ... 'Translation group').displayOptions |
508 | @@ -47,11 +47,11 @@ | |||
509 | 47 | ... 'Translation group').displayValue | 47 | ... 'Translation group').displayValue |
510 | 48 | ['(no value)'] | 48 | ['(no value)'] |
511 | 49 | 49 | ||
513 | 50 | Ordinary users cannot see the "Change permissions" link or the page it | 50 | Ordinary users cannot see the "Configure translations" link or the page it |
514 | 51 | leads to. | 51 | leads to. |
515 | 52 | 52 | ||
516 | 53 | >>> user_browser.open(translations_page_url) | 53 | >>> user_browser.open(translations_page_url) |
518 | 54 | >>> user_browser.getLink('Change permissions').click() | 54 | >>> user_browser.getLink('Configure translations').click() |
519 | 55 | Traceback (most recent call last): | 55 | Traceback (most recent call last): |
520 | 56 | ... | 56 | ... |
521 | 57 | LinkNotFoundError | 57 | LinkNotFoundError |
522 | 58 | 58 | ||
523 | === modified file 'lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt' | |||
524 | --- lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt 2010-04-13 16:06:52 +0000 | |||
525 | +++ lib/lp/translations/stories/translationgroups/45-test-distro-restricted-permissions.txt 2010-12-30 20:12:18 +0000 | |||
526 | @@ -8,7 +8,8 @@ | |||
527 | 8 | >>> browser.addHeader('Authorization', 'Basic no-priv@canonical.com:test') | 8 | >>> browser.addHeader('Authorization', 'Basic no-priv@canonical.com:test') |
528 | 9 | 9 | ||
529 | 10 | >>> admin_browser.open( | 10 | >>> admin_browser.open( |
531 | 11 | ... 'http://translations.launchpad.dev/ubuntu/+settings') | 11 | ... 'http://translations.launchpad.dev/ubuntu/' |
532 | 12 | ... '+configure-translations') | ||
533 | 12 | 13 | ||
534 | 13 | >>> admin_browser.getControl( | 14 | >>> admin_browser.getControl( |
535 | 14 | ... 'Translation permissions policy').value = ['RESTRICTED'] | 15 | ... 'Translation permissions policy').value = ['RESTRICTED'] |
536 | 15 | 16 | ||
537 | === modified file 'lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt' | |||
538 | --- lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2010-08-24 22:23:17 +0000 | |||
539 | +++ lib/lp/translations/stories/translationgroups/46-test-distro-structured-permissions.txt 2010-12-30 20:12:18 +0000 | |||
540 | @@ -15,7 +15,7 @@ | |||
541 | 15 | as the translation group for the netapplet product... | 15 | as the translation group for the netapplet product... |
542 | 16 | 16 | ||
543 | 17 | >>> admin_browser.getLink('Translations').click() | 17 | >>> admin_browser.getLink('Translations').click() |
545 | 18 | >>> admin_browser.getLink('Change permissions').click() | 18 | >>> admin_browser.getLink('Configure translations').click() |
546 | 19 | >>> admin_browser.getControl('Translation group').displayOptions | 19 | >>> admin_browser.getControl('Translation group').displayOptions |
547 | 20 | ['(no value)', 'Single-language Translators', | 20 | ['(no value)', 'Single-language Translators', |
548 | 21 | 'The PolyGlot Translation Group', 'Just a testing team'] | 21 | 'The PolyGlot Translation Group', 'Just a testing team'] |
549 | 22 | 22 | ||
550 | === modified file 'lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt' | |||
551 | --- lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt 2010-08-31 18:10:51 +0000 | |||
552 | +++ lib/lp/translations/stories/translationgroups/xx-change-translation-policy.txt 2010-12-30 20:12:18 +0000 | |||
553 | @@ -19,20 +19,20 @@ | |||
554 | 19 | >>> po_browser = setupBrowser("Basic po@ex.com:test") | 19 | >>> po_browser = setupBrowser("Basic po@ex.com:test") |
555 | 20 | 20 | ||
556 | 21 | Visiting the main products translations page, product owners and Rosetta | 21 | Visiting the main products translations page, product owners and Rosetta |
558 | 22 | administrators sees the "Change permissions" link, leading to the | 22 | administrators sees the "Configure translations" link, leading to the |
559 | 23 | translations settings page. | 23 | translations settings page. |
560 | 24 | 24 | ||
561 | 25 | >>> re_browser.open( | 25 | >>> re_browser.open( |
562 | 26 | ... 'http://translations.launchpad.dev/chestii') | 26 | ... 'http://translations.launchpad.dev/chestii') |
564 | 27 | >>> re_browser.getLink('Change permissions').click() | 27 | >>> re_browser.getLink('Configure translations').click() |
565 | 28 | >>> print re_browser.url | 28 | >>> print re_browser.url |
567 | 29 | http://translations.launchpad.dev/chestii/+settings | 29 | http://translations.launchpad.dev/chestii/+configure-translations |
568 | 30 | 30 | ||
569 | 31 | >>> po_browser.open( | 31 | >>> po_browser.open( |
570 | 32 | ... 'http://translations.launchpad.dev/chestii') | 32 | ... 'http://translations.launchpad.dev/chestii') |
572 | 33 | >>> po_browser.getLink('Change permissions').click() | 33 | >>> po_browser.getLink('Configure translations').click() |
573 | 34 | >>> print po_browser.url | 34 | >>> print po_browser.url |
575 | 35 | http://translations.launchpad.dev/chestii/+settings | 35 | http://translations.launchpad.dev/chestii/+configure-translations |
576 | 36 | 36 | ||
577 | 37 | From the settings page, translations group and translation permissions | 37 | From the settings page, translations group and translation permissions |
578 | 38 | can be changed. | 38 | can be changed. |
579 | @@ -58,7 +58,7 @@ | |||
580 | 58 | 58 | ||
581 | 59 | >>> dtc_browser.open( | 59 | >>> dtc_browser.open( |
582 | 60 | ... 'http://translations.launchpad.dev/chestii') | 60 | ... 'http://translations.launchpad.dev/chestii') |
584 | 61 | >>> dtc_browser.getLink('Change permissions') | 61 | >>> dtc_browser.getLink('Configure translations') |
585 | 62 | Traceback (most recent call last): | 62 | Traceback (most recent call last): |
586 | 63 | ... | 63 | ... |
587 | 64 | LinkNotFoundError... | 64 | LinkNotFoundError... |
588 | @@ -66,7 +66,8 @@ | |||
589 | 66 | An attempt to access the translations policy url will not be authorized. | 66 | An attempt to access the translations policy url will not be authorized. |
590 | 67 | 67 | ||
591 | 68 | >>> browser.open( | 68 | >>> browser.open( |
593 | 69 | ... 'http://translations.launchpad.dev/chestii/+settings') | 69 | ... 'http://translations.launchpad.dev/' |
594 | 70 | ... 'chestii/+configure-translations') | ||
595 | 70 | Traceback (most recent call last): | 71 | Traceback (most recent call last): |
596 | 71 | ... | 72 | ... |
597 | 72 | Unauthorized... | 73 | Unauthorized... |
598 | @@ -80,9 +81,9 @@ | |||
599 | 80 | 81 | ||
600 | 81 | >>> dtc_browser.open( | 82 | >>> dtc_browser.open( |
601 | 82 | ... 'http://translations.launchpad.dev/ubuntu') | 83 | ... 'http://translations.launchpad.dev/ubuntu') |
603 | 83 | >>> dtc_browser.getLink('Change permissions').click() | 84 | >>> dtc_browser.getLink('Configure translations').click() |
604 | 84 | >>> print dtc_browser.url | 85 | >>> print dtc_browser.url |
606 | 85 | http://translations.launchpad.dev/ubuntu/+settings | 86 | http://translations.launchpad.dev/ubuntu/+configure-translations |
607 | 86 | 87 | ||
608 | 87 | >>> dtc_browser.getControl('Translation group').value = [ | 88 | >>> dtc_browser.getControl('Translation group').value = [ |
609 | 88 | ... 'ubuntu-translators'] | 89 | ... 'ubuntu-translators'] |
610 | 89 | 90 | ||
611 | === renamed file 'lib/lp/translations/templates/set-translators.pt' => 'lib/lp/translations/templates/configure-translations.pt' | |||
612 | === modified file 'lib/lp/translations/templates/distribution-translations.pt' | |||
613 | --- lib/lp/translations/templates/distribution-translations.pt 2010-10-10 21:54:16 +0000 | |||
614 | +++ lib/lp/translations/templates/distribution-translations.pt 2010-12-30 20:12:18 +0000 | |||
615 | @@ -48,6 +48,10 @@ | |||
616 | 48 | <tal:target replace="structure target/fmt:link/+translations" | 48 | <tal:target replace="structure target/fmt:link/+translations" |
617 | 49 | >trunk</tal:target>. | 49 | >trunk</tal:target>. |
618 | 50 | </p> | 50 | </p> |
619 | 51 | <p tal:condition="view/can_configure_translations"> | ||
620 | 52 | <a tal:replace="structure context/menu:overview/configure_translations/fmt:link"/> | ||
621 | 53 | </p> | ||
622 | 54 | |||
623 | 51 | </div> | 55 | </div> |
624 | 52 | <div class="yui-g"> | 56 | <div class="yui-g"> |
625 | 53 | <div class="yui-u first"> | 57 | <div class="yui-u first"> |
626 | 54 | 58 | ||
627 | === modified file 'lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt' | |||
628 | --- lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2010-02-16 21:21:14 +0000 | |||
629 | +++ lib/lp/translations/templates/hastranslationgroup-portlet-translation-groups-and-permission.pt 2010-12-30 20:12:18 +0000 | |||
630 | @@ -12,9 +12,4 @@ | |||
631 | 12 | tal:content="context/translationpermission/title">certain</a> | 12 | tal:content="context/translationpermission/title">certain</a> |
632 | 13 | permissions. | 13 | permissions. |
633 | 14 | </p> | 14 | </p> |
634 | 15 | <div tal:condition="context/required:launchpad.TranslationsAdmin"> | ||
635 | 16 | <a tal:replace="structure context/menu:translations/settings/fmt:link"> | ||
636 | 17 | Change permissions | ||
637 | 18 | </a> | ||
638 | 19 | </div> | ||
639 | 20 | </div> | 15 | </div> |
640 | 21 | 16 | ||
641 | === modified file 'lib/lp/translations/templates/project-translations.pt' | |||
642 | --- lib/lp/translations/templates/project-translations.pt 2010-10-26 21:26:27 +0000 | |||
643 | +++ lib/lp/translations/templates/project-translations.pt 2010-12-30 20:12:18 +0000 | |||
644 | @@ -38,6 +38,10 @@ | |||
645 | 38 | context/@@+portlet-translation-groups-and-permission" | 38 | context/@@+portlet-translation-groups-and-permission" |
646 | 39 | /> | 39 | /> |
647 | 40 | </p> | 40 | </p> |
648 | 41 | <p tal:condition="view/required:launchpad.TranslationsAdmin"> | ||
649 | 42 | <a tal:replace=" | ||
650 | 43 | structure context/menu:translations/settings/fmt:link"/> | ||
651 | 44 | </p> | ||
652 | 41 | </div> | 45 | </div> |
653 | 42 | 46 | ||
654 | 43 | <div class="yui-g"> | 47 | <div class="yui-g"> |
Hi Danilo,
thank you for doing this and also for pointing out the caveats - makes life easy for me. ;)
I think there should be only one "Configure translations" link and it should be near the top. I guess the intention of that placement near the help link is to make it easy for project maintainers to start on translations. That is not so important on distributions as they don't get started very often. Also, the current placement at the bottom is in the "permissions" portlet but this page is not just about permissions any more, even before this branch. So, a general placement in the top portlet seems logical.
Another little thing: The check box on the distribution configuration page is labelled "Translations for this project are done in Launchpad" - can you put "distribution" there, please?
Cheers,
Henning