[IMP] list_view: allow displaying string-based buttons in list view
and not only img-based buttons. bzr revid: tde@openerp.com-20140320173907-5b02atnispbznqmj
This commit is contained in:
parent
c2e13ccb3b
commit
2f0b59be37
|
@ -2877,7 +2877,7 @@
|
||||||
padding: 3px 6px;
|
padding: 3px 6px;
|
||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
.openerp .oe_list_content > tbody > tr > td > button, .openerp .oe_list_content > tbody > tr > th > button {
|
.openerp .oe_list_content > tbody > tr > td > button.btn_img, .openerp .oe_list_content > tbody > tr > th > button.btn_img {
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -2312,7 +2312,7 @@ $sheet-padding: 16px
|
||||||
padding: 3px 6px
|
padding: 3px 6px
|
||||||
white-space: pre-line
|
white-space: pre-line
|
||||||
> td, > th
|
> td, > th
|
||||||
> button
|
> button.btn_img
|
||||||
border: none
|
border: none
|
||||||
background: transparent
|
background: transparent
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
|
@ -2260,8 +2260,8 @@ instance.web.list.Button = instance.web.list.Column.extend({
|
||||||
attrs = this.modifiers_for(row_data);
|
attrs = this.modifiers_for(row_data);
|
||||||
}
|
}
|
||||||
if (attrs.invisible) { return ''; }
|
if (attrs.invisible) { return ''; }
|
||||||
|
var template = this.icon && 'ListView.row.button' || 'ListView.row.text_button';
|
||||||
return QWeb.render('ListView.row.button', {
|
return QWeb.render(template, {
|
||||||
widget: this,
|
widget: this,
|
||||||
prefix: instance.session.prefix,
|
prefix: instance.session.prefix,
|
||||||
disabled: attrs.readonly
|
disabled: attrs.readonly
|
||||||
|
|
|
@ -785,11 +785,17 @@
|
||||||
</span>
|
</span>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
<button t-name="ListView.row.text_button" type="button"
|
||||||
|
t-att-title="widget.string" t-att-disabled="disabled || undefined"
|
||||||
|
t-att-class="disabled ? 'oe_list_button_disabled btn' : 'btn'">
|
||||||
|
<t t-esc="widget.string"/>
|
||||||
|
</button>
|
||||||
<button t-name="ListView.row.button" type="button"
|
<button t-name="ListView.row.button" type="button"
|
||||||
t-att-title="widget.string" t-att-disabled="disabled || undefined"
|
t-att-title="widget.string" t-att-disabled="disabled || undefined"
|
||||||
t-att-class="disabled ? 'oe_list_button_disabled' : undefined"
|
t-att-class="disabled ? 'oe_list_button_disabled btn_img' : 'btn_img'">
|
||||||
><img t-attf-src="#{prefix}/web/static/src/img/icons/#{widget.icon}.png"
|
<img t-attf-src="#{prefix}/web/static/src/img/icons/#{widget.icon}.png"
|
||||||
t-att-alt="widget.string"/></button>
|
t-att-alt="widget.string"/>
|
||||||
|
</button>
|
||||||
<t t-extend="ListView.row">
|
<t t-extend="ListView.row">
|
||||||
<!-- adds back padding to row being rendered after edition, if necessary
|
<!-- adds back padding to row being rendered after edition, if necessary
|
||||||
(if not deletable add back padding), otherwise the row being added is
|
(if not deletable add back padding), otherwise the row being added is
|
||||||
|
|
Loading…
Reference in New Issue