Here is the diff from the last commit. I will leave the other tasks for another branch. I looked for all the other places where factory.makeTranslator is used and the change should not affect the current tests. bin/test -m translations looks ok. === modified file 'lib/canonical/launchpad/icing/style-3-0.css' --- lib/canonical/launchpad/icing/style-3-0.css 2009-12-05 03:11:48 +0000 +++ lib/canonical/launchpad/icing/style-3-0.css 2009-12-10 12:03:04 +0000 @@ -674,6 +674,18 @@ padding: 2px 1em 2px 2px; } +/* Templates listing. + * + * Examples: + * https://translations.launchpad.dev/ubuntu/hoary/+templates + * https://translations.launchpad.dev/evolution/trunk/+templates + */ + +.inactive-template td { + background-color: #DCDCDC; +} + + /* Translations statistics and legend. * * Examples: === modified file 'lib/canonical/launchpad/security.py' --- lib/canonical/launchpad/security.py 2009-12-09 01:03:22 +0000 +++ lib/canonical/launchpad/security.py 2009-12-10 11:31:11 +0000 @@ -1123,13 +1123,21 @@ to edit distribution details are able to change translation settings for a distribution. """ - return ( + # Translation group owner for a distribution is also a + # translations administrator for it. + translation_group = self.obj.translationgroup + if translation_group and user.inTeam(translation_group.owner): + return True + else: + return ( OnlyRosettaExpertsAndAdmins.checkAuthenticated(self, user) or EditDistributionByDistroOwnersOrAdmins.checkAuthenticated( self, user)) -class AdminPOTemplateDetails(AdminDistributionTranslations): +# Please keep AdminPOTemplateSubset in sync with this, unless you +# know exactly what you are doing. +class AdminPOTemplateDetails(OnlyRosettaExpertsAndAdmins): """Controls administration of an `IPOTemplate`. Allow all persons that can also administer the translations to @@ -1143,16 +1151,17 @@ def checkAuthenticated(self, user): template = self.obj if template.distroseries is not None: - distro = template.distroseries.distribution - translation_group = distro.translationgroup - if translation_group and user.inTeam(translation_group.owner): - return True - + # Template is on a distribution. + distribution = template.distroseries.distribution return ( AdminDistributionTranslations( - template.distroseries.distribution).checkAuthenticated(user)) + template.distroseries.distribution).checkAuthenticated( + user)) - return False + else: + # Template is on a product. + return OnlyRosettaExpertsAndAdmins.checkAuthenticated( + self, user) class EditPOTemplateDetails(AdminPOTemplateDetails, EditByOwnersOrAdmins): @@ -1636,7 +1645,11 @@ user.inTeam(celebs.bazaar_experts)) -class AdminPOTemplateSubset(AdminDistributionTranslations): +# Please keep this in sync with AdminPOTemplateDetails. Note that +# this permission controls access to browsing into individual +# potemplates, but it's on a different object (POTemplateSubset) +# from AdminPOTemplateDetails, even though it looks almost identical +class AdminPOTemplateSubset(OnlyRosettaExpertsAndAdmins): """Controls administration of an `IPOTemplateSubset`. Allow all persons that can also administer the translations to @@ -1648,16 +1661,16 @@ usedfor = IPOTemplateSubset def checkAuthenticated(self, user): - template = self.obj - if template.distroseries is not None: - distro = template.distroseries.distribution + template_set = self.obj + if template_set.distroseries is not None: + distro = template_set.distroseries.distribution translation_group = distro.translationgroup if translation_group and user.inTeam(translation_group.owner): return True return ( AdminDistributionTranslations( - template.distroseries.distribution).checkAuthenticated(user)) + template_set.distroseries.distribution).checkAuthenticated(user)) return False === modified file 'lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt' --- lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt 2009-12-09 01:03:22 +0000 +++ lib/lp/translations/stories/distroseries/xx-distroseries-templates.txt 2009-12-10 12:20:01 +0000 @@ -42,14 +42,14 @@ pmount pmount 2005-05-06 -Log in as any user and an the distribution serie page you will see a -link to the page listing all active templates for that series +Logged-in users see a link to all the active translation templates +on a distribution series translation page. >>> user_browser.open( ... 'http://translations.launchpad.dev/ubuntu/hoary') >>> user_browser.getLink('full list of templates').click() -From this page you can choose to download all translations for each -active template. +Regular users only see the option to download translations for each of +the active templates. >>> table = find_tag_by_id(user_browser.contents, 'templates_table') >>> print extract_text(table) @@ -69,13 +69,13 @@ >>> table = find_tag_by_id(admin_browser.contents, 'templates_table') >>> print extract_text(table) - Source package Template name Last update Actions - evolution disabled-template 2007-01-05 Edit Upload Download Administer - evolution evolution-2.2 2005-05-06 Edit Upload Download Administer - evolution man 2006-08-14 Edit Upload Download Administer - mozilla pkgconf-mozilla 2005-05-06 Edit Upload Download Administer - pmount man 2006-08-14 Edit Upload Download Administer - pmount pmount 2005-05-06 Edit Upload Download Administer + Source package Template name Last update Actions + evolution disabled-template (inactive) 2007-01-05 Edit Upload Download Administer + evolution evolution-2.2 2005-05-06 Edit Upload Download Administer + evolution man 2006-08-14 Edit Upload Download Administer + mozilla pkgconf-mozilla 2005-05-06 Edit Upload Download Administer + pmount man 2006-08-14 Edit Upload Download Administer + pmount pmount 2005-05-06 Edit Upload Download Administer Ubuntu Translations Coordinator can administer all templates, including those that are currently disabled. @@ -99,10 +99,11 @@ >>> # Log out so we can go back to using test browsers. >>> logout() -Visit the Ubuntu Hoary templates page as on translation administrator -You will see "Edit" and "Administer" for all templates. +Visiting the Ubuntu Hoary templates page, translation administrators +will see "Edit" and "Administer" links for all templates. -Try editing and administering an active template. +Trying to edit/administer enabled templates brings them to the +appropriate page. >>> utc_browser = setupBrowser(auth='Basic