← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-client-web/web-dashboard-image into lp:openobject-client-web

 

vda(Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/web-dashboard-image into lp:openobject-client-web.

Requested reviews:
  OpenERP SA's Web Client R&D (openerp-dev-web)

-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/web-dashboard-image/+merge/41390
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client-web/web-dashboard-image.
=== modified file 'addons/openerp/controllers/root.py'
--- addons/openerp/controllers/root.py	2010-11-02 16:47:18 +0000
+++ addons/openerp/controllers/root.py	2010-11-20 08:41:21 +0000
@@ -106,7 +106,7 @@
         ctx = rpc.session.context.copy()
         menus = rpc.RPCProxy("ir.ui.menu")
         ids = menus.search([('parent_id', '=', False)], 0, 0, 0, ctx)
-        parents = menus.read(ids, ['name', 'action'], ctx)
+        parents = menus.read(ids, ['name', 'action', 'web_icon_datas', 'web_icon_hover_datas'], ctx)
             
         for parent in parents:
             if parent['id'] == id:

=== modified file 'addons/openerp/controllers/templates/index.mako'
--- addons/openerp/controllers/templates/index.mako	2010-10-21 12:53:16 +0000
+++ addons/openerp/controllers/templates/index.mako	2010-11-20 08:41:21 +0000
@@ -82,14 +82,44 @@
                                     <div class="wrap" style="padding: 10px;">
                                         <ul class="sections-a">
                                             % for parent in parents:
-                                                <li class="${'-'.join(parent['name'].split(' ')).lower()}">
+                                                <li class="web_dashboard" id="${parent['id']}">
                                                     <span class="wrap">
                                                         <a href="${py.url('/openerp/menu', active=parent['id'])}" target="_top">
-                                                            <span>
-                                                                <strong>${parent['name']}</strong>
-                                                            </span>
+                                                            <table width="100%" height="100%" cellspacing="0" cellpadding="1">
+                                                                <tr>
+                                                                    <td align="center" style="height: 100px;">
+                                                                        % if parent.get('web_icon_datas'):
+                                                                            <img id="web_icon" src="data:image/png;base64,${parent['web_icon_datas']}"/>
+                                                                        % endif
+                                                                        %if parent.get('web_icon_hover_datas'):
+                                                                            <img id="web_icon_hover" src="data:image/png;base64,${parent['web_icon_hover_datas']}"/>
+                                                                        % endif
+                                                                    </td>
+                                                                </tr>
+                                                                <tr>
+                                                                    <td>
+                                                                        <span>
+                                                                            <strong>${parent['name']}</strong>
+                                                                        </span>
+                                                                    </td>
+                                                                </tr>
+                                                            </table>
                                                         </a>
                                                     </span>
+                                                    % if parent.get('web_icon_hover_datas'):
+                                                        <script type="text/javascript">
+                                                            jQuery(document).ready(function(){
+                                                                jQuery("li.web_dashboard#${parent['id']}").mouseover(function() {
+                                                                    jQuery(this).find('#web_icon').hide();
+                                                                    jQuery(this).find('#web_icon_hover').show();
+                                                                });
+                                                                jQuery("li.web_dashboard#${parent['id']}").mouseout(function(){
+                                                                    jQuery(this).find('#web_icon').show();
+                                                                    jQuery(this).find('#web_icon_hover').hide();
+                                                                });
+                                                            });
+                                                        </script>
+                                                    % endif
                                                 </li>
                                             % endfor
                                         </ul>

=== modified file 'addons/openerp/static/css/screen.css'
--- addons/openerp/static/css/screen.css	2010-11-19 09:19:48 +0000
+++ addons/openerp/static/css/screen.css	2010-11-20 08:41:21 +0000
@@ -1551,6 +1551,15 @@
     border-bottom-color: #bcbbbb;
 }
 
+#web_icon,
+#web_icon_hover {
+    vertical-align: middle;
+}
+
+#web_icon_hover {
+    display: none;
+}
+
 ul.sections-a li span.wrap a:hover,ul.sections-a li span.wrap a:focus,ul.sections-a li span.wrap a:active
     {
     background-position: 50% -260px;


Follow ups