[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;
|
||||
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;
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
|
|
|
@ -2312,7 +2312,7 @@ $sheet-padding: 16px
|
|||
padding: 3px 6px
|
||||
white-space: pre-line
|
||||
> td, > th
|
||||
> button
|
||||
> button.btn_img
|
||||
border: none
|
||||
background: transparent
|
||||
padding: 0
|
||||
|
|
|
@ -2260,8 +2260,8 @@ instance.web.list.Button = instance.web.list.Column.extend({
|
|||
attrs = this.modifiers_for(row_data);
|
||||
}
|
||||
if (attrs.invisible) { return ''; }
|
||||
|
||||
return QWeb.render('ListView.row.button', {
|
||||
var template = this.icon && 'ListView.row.button' || 'ListView.row.text_button';
|
||||
return QWeb.render(template, {
|
||||
widget: this,
|
||||
prefix: instance.session.prefix,
|
||||
disabled: attrs.readonly
|
||||
|
|
|
@ -785,11 +785,17 @@
|
|||
</span>
|
||||
</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"
|
||||
t-att-title="widget.string" t-att-disabled="disabled || undefined"
|
||||
t-att-class="disabled ? 'oe_list_button_disabled' : undefined"
|
||||
><img t-attf-src="#{prefix}/web/static/src/img/icons/#{widget.icon}.png"
|
||||
t-att-alt="widget.string"/></button>
|
||||
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"
|
||||
t-att-alt="widget.string"/>
|
||||
</button>
|
||||
<t t-extend="ListView.row">
|
||||
<!-- adds back padding to row being rendered after edition, if necessary
|
||||
(if not deletable add back padding), otherwise the row being added is
|
||||
|
|
Loading…
Reference in New Issue