Thibault Delavallée (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-image-standardize-tde into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-image-standardize-tde/+merge/118381

MyNotChatterTask: image resize.

This revision adds standard image field names and sizes (image: 1024x1024; 
image_medium: 180x180; image_small: 50x50, the last two being function fields). 
This web-side branch holds the field name change for the topbar avatar. It also 
adds 2 CSS classes when using images: oe_image_small and oe_image_medium, that 
fix the max-width and mex-height to respectively 50x50 and 180x180 px.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-image-standardize-tde/+merge/118381
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-image-standardize-tde.
=== modified file 'addons/web/static/src/css/base.css'
--- addons/web/static/src/css/base.css	2012-08-06 14:00:44 +0000
+++ addons/web/static/src/css/base.css	2012-08-06 15:58:35 +0000
@@ -509,6 +509,14 @@
 .openerp .oe_avatar + div {
   margin-left: 5px;
 }
+.openerp .oe_image_small > img {
+  max-width: 50px;
+  max-height: 50px;
+}
+.openerp .oe_image_medium > img {
+  max-width: 180px;
+  max-height: 180px;
+}
 .openerp .oe_button.oe_link {
   border: none;
   padding: 0;

=== modified file 'addons/web/static/src/css/base.sass'
--- addons/web/static/src/css/base.sass	2012-08-06 14:00:44 +0000
+++ addons/web/static/src/css/base.sass	2012-08-06 15:58:35 +0000
@@ -408,6 +408,12 @@
             border: none
     .oe_avatar + div
         margin-left: 5px
+    .oe_image_small > img
+        max-width: 50px
+        max-height: 50px
+    .oe_image_medium > img
+        max-width: 180px
+        max-height: 180px
     .oe_button.oe_link
         @include reset()
         img

=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js	2012-08-06 15:02:48 +0000
+++ addons/web/static/src/js/chrome.js	2012-08-06 15:58:35 +0000
@@ -874,7 +874,7 @@
                 if(res.company_id[0] > 1)
                     topbar_name = _.str.sprintf("%s (%s)", topbar_name, res.company_id[1]);
                 self.$element.find('.oe_topbar_name').text(topbar_name);
-                var avatar_src = _.str.sprintf('%s/web/binary/image?session_id=%s&model=res.users&field=avatar&id=%s', self.session.prefix, self.session.session_id, self.session.uid);
+                var avatar_src = _.str.sprintf('%s/web/binary/image?session_id=%s&model=res.users&field=image_small&id=%s', self.session.prefix, self.session.session_id, self.session.uid);
                 $avatar.attr('src', avatar_src);
             });
         };

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to