[FIX] ir_qweb, website_blog: Allow to pass inline style as an option for the widget...
authorJeremy Kersten <jke@odoo.com>
Wed, 5 Nov 2014 10:11:26 +0000 (11:11 +0100)
committerJeremy Kersten <jke@odoo.com>
Wed, 5 Nov 2014 10:11:26 +0000 (11:11 +0100)
addons/website/models/ir_qweb.py
addons/website_blog/views/website_blog_templates.xml

index 3555b33..dd50d69 100644 (file)
@@ -298,7 +298,7 @@ class Image(orm.AbstractModel):
             max_size = '%sx%s' % (max_width, max_height)
 
         src = self.pool['website'].image_url(cr, uid, record, field_name, max_size)
-        img = '<img class="%s" src="%s"/>' % (classes, src)
+        img = '<img class="%s" src="%s" style="%s"/>' % (classes, src, options.get('style', ''))
         return ir_qweb.HTMLSafe(img)
 
     local_url_re = re.compile(r'^/(?P<module>[^]]+)/static/(?P<rest>.+)$')
index 07cf2b8..40bde2f 100644 (file)
             <h2 t-field="blog_post.subtitle"/>
             <p class="post-meta text-muted text-center" name="blog_post_data"/>
             <div>
-                <img class="img-circle" t-att-src="website.image_url(blog_post.author_id, 'image_small')" style="width: 30px; margin-right: 10px;"/>
+                <span t-field="blog_post.author_avatar" t-field-options='{"widget": "image", "class": "img-circle", "style":"width: 30px; margin-right: 10px; display:inline"}' />
                 <span t-field="blog_post.author_id" style="display: inline-block;" t-field-options='{
                     "widget": "contact",
                     "fields": ["name"]
                 <h1 t-field="next_post.name"/>
                 <h2 t-field="next_post.subtitle"/>
                 <div>
-                    <img class="img-circle" t-att-src="website.image_url(next_post.author_id, 'image_small')" style="width: 30px; margin-right: 10px;"/>
+                    <span t-field="next_post.author_avatar" t-field-options='{"widget": "image", "class": "img-circle", "style":"width: 30px; margin-right: 10px; display:inline"}' />
                     <span t-field="next_post.author_id" style="display: inline-block;" t-field-options='{
                             "widget": "contact",
                             "fields": ["name"]