Code review comment for lp:~adiroiban/launchpad/bug-340664

Revision history for this message
Adi Roiban (adiroiban) wrote :

I filled bug 522188.

The hover presentation is already on edge. ie: https://translations.edge.launchpad.net/openobject-addons/trunk/+templates

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/translations/browser/potemplate.py'
--- lib/lp/translations/browser/potemplate.py 2010-02-02 11:17:00 +0000
+++ lib/lp/translations/browser/potemplate.py 2010-02-15 14:55:25 +0000
@@ -175,21 +175,21 @@
     @enabled_with_permission('launchpad.Edit')
     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_with_permission('launchpad.Edit')
     def edit(self):
- text = 'Settings'
- return Link('+edit', text)
+ text = 'Edit'
+ return Link('+edit', text, icon='edit')

     @enabled_with_permission('launchpad.TranslationsAdmin')
     def administer(self):
         text = 'Administer'
- return Link('+admin', text)
+ return Link('+admin', text, icon='edit')

 class POTemplateSubsetView:

=== modified file 'lib/lp/translations/templates/object-templates.pt'
--- lib/lp/translations/templates/object-templates.pt 2010-02-02 11:17:00 +0000
+++ lib/lp/translations/templates/object-templates.pt 2010-02-15 15:25:55 +0000
@@ -7,8 +7,8 @@
   <body>
     <div metal:fill-slot="head_epilogue">
       <style type="text/css">
- .inactive_links a img{
- visibility: hidden;
+ .inactive_links a{
+ background: none;
         }
         .inactive_links a{
           color: lightgray;
@@ -130,22 +130,18 @@
               <td class="actions_column"
                   tal:condition="context/required:launchpad.AnyPerson">
               <div class="template_links">
- <tal:maintainer condition="template/required:launchpad.Edit">
- <a tal:attributes="href string:${template/fmt:url}/+edit;
- title string:Edit ${template/name}'s details">
- <img src="/@@/edit" />&nbsp;Edit</a>
- <a tal:attributes="href string:${template/fmt:url}/+upload;
- title string:Upload translations to ${template/name}">
- <img src="/@@/add" />&nbsp;Upload</a>
- </tal:maintainer>
- <a tal:attributes="href string:${template/fmt:url}/+export;
- title string:Download translations from ${template/name}">
- <img src="/@@/download" />&nbsp;Download</a>
- <tal:admin condition="template/required:launchpad.TranslationsAdmin">
- <a tal:attributes="href string:${template/fmt:url}/+admin;
- title string:Administer ${template/name}">
- <img src="/@@/edit" />&nbsp;Administer</a>
- </tal:admin>
+ <a tal:replace="
+ structure template/menu:translations/edit/fmt:link
+ " />
+ <a tal:replace="
+ structure template/menu:translations/upload/fmt:link
+ " />
+ <a tal:replace="
+ structure template/menu:translations/download/fmt:link
+ " />
+ <a tal:replace="
+ structure template/menu:translations/administer/fmt:link
+ " />
               </div>
               </td>
             </tr>

« Back to merge proposal