[FIX] ir_qweb, website_blog: Allow to pass inline style as an option for the widget image. And change some img from blog to use this widget

This commit is contained in:
Jeremy Kersten 2014-11-05 11:11:26 +01:00
parent 7582f91e1b
commit 738a895dba
2 changed files with 3 additions and 3 deletions

View 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>.+)$')

View File

@ -201,7 +201,7 @@
<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"]
@ -245,7 +245,7 @@
<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"]