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

Proposed by Vaibhav Darji
Status: Merged
Merged at revision: 3921
Proposed branch: lp:~openerp-dev/openobject-client-web/web-dashboard-image
Merge into: lp:openobject-client-web/trunk
Diff against target: 85 lines (+44/-5)
3 files modified
addons/openerp/controllers/root.py (+1/-1)
addons/openerp/controllers/templates/index.mako (+34/-4)
addons/openerp/static/css/screen.css (+9/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/web-dashboard-image
Reviewer Review Type Date Requested Status
Navrang Oza (community) Approve
Review via email: mp+41390@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Navrang Oza (noz-tiny) wrote :

Implemented web dashboard images from server side.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/root.py'
2--- addons/openerp/controllers/root.py 2010-11-02 16:47:18 +0000
3+++ addons/openerp/controllers/root.py 2010-11-20 08:41:21 +0000
4@@ -106,7 +106,7 @@
5 ctx = rpc.session.context.copy()
6 menus = rpc.RPCProxy("ir.ui.menu")
7 ids = menus.search([('parent_id', '=', False)], 0, 0, 0, ctx)
8- parents = menus.read(ids, ['name', 'action'], ctx)
9+ parents = menus.read(ids, ['name', 'action', 'web_icon_datas', 'web_icon_hover_datas'], ctx)
10
11 for parent in parents:
12 if parent['id'] == id:
13
14=== modified file 'addons/openerp/controllers/templates/index.mako'
15--- addons/openerp/controllers/templates/index.mako 2010-10-21 12:53:16 +0000
16+++ addons/openerp/controllers/templates/index.mako 2010-11-20 08:41:21 +0000
17@@ -82,14 +82,44 @@
18 <div class="wrap" style="padding: 10px;">
19 <ul class="sections-a">
20 % for parent in parents:
21- <li class="${'-'.join(parent['name'].split(' ')).lower()}">
22+ <li class="web_dashboard" id="${parent['id']}">
23 <span class="wrap">
24 <a href="${py.url('/openerp/menu', active=parent['id'])}" target="_top">
25- <span>
26- <strong>${parent['name']}</strong>
27- </span>
28+ <table width="100%" height="100%" cellspacing="0" cellpadding="1">
29+ <tr>
30+ <td align="center" style="height: 100px;">
31+ % if parent.get('web_icon_datas'):
32+ <img id="web_icon" src="data:image/png;base64,${parent['web_icon_datas']}"/>
33+ % endif
34+ %if parent.get('web_icon_hover_datas'):
35+ <img id="web_icon_hover" src="data:image/png;base64,${parent['web_icon_hover_datas']}"/>
36+ % endif
37+ </td>
38+ </tr>
39+ <tr>
40+ <td>
41+ <span>
42+ <strong>${parent['name']}</strong>
43+ </span>
44+ </td>
45+ </tr>
46+ </table>
47 </a>
48 </span>
49+ % if parent.get('web_icon_hover_datas'):
50+ <script type="text/javascript">
51+ jQuery(document).ready(function(){
52+ jQuery("li.web_dashboard#${parent['id']}").mouseover(function() {
53+ jQuery(this).find('#web_icon').hide();
54+ jQuery(this).find('#web_icon_hover').show();
55+ });
56+ jQuery("li.web_dashboard#${parent['id']}").mouseout(function(){
57+ jQuery(this).find('#web_icon').show();
58+ jQuery(this).find('#web_icon_hover').hide();
59+ });
60+ });
61+ </script>
62+ % endif
63 </li>
64 % endfor
65 </ul>
66
67=== modified file 'addons/openerp/static/css/screen.css'
68--- addons/openerp/static/css/screen.css 2010-11-19 09:19:48 +0000
69+++ addons/openerp/static/css/screen.css 2010-11-20 08:41:21 +0000
70@@ -1551,6 +1551,15 @@
71 border-bottom-color: #bcbbbb;
72 }
73
74+#web_icon,
75+#web_icon_hover {
76+ vertical-align: middle;
77+}
78+
79+#web_icon_hover {
80+ display: none;
81+}
82+
83 ul.sections-a li span.wrap a:hover,ul.sections-a li span.wrap a:focus,ul.sections-a li span.wrap a:active
84 {
85 background-position: 50% -260px;