[IMP] Improved o2m and m2m viewmanager/listview styling

bzr revid: fme@openerp.com-20120612131543-qmltlt7p1h8g5xk5
This commit is contained in:
Fabien Meghazi 2012-06-12 15:15:43 +02:00
parent 250ae50514
commit 554195630b
5 changed files with 24 additions and 6 deletions

View File

@ -2026,6 +2026,12 @@
.openerp .oe-select-create-popup-view-form > .oe_formview > .oe_form_pager {
display: none;
}
.openerp .oe_form .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page {
display: none;
}
.openerp .oe_form .oe_form_field_many2many > .oe-listview .oe_list_pager_single_page {
display: none;
}
.openerp .oe_form td.oe_form_group_cell_label {
border-right: 1px solid #dddddd;
padding: 2px 0px 2px 0px;

View File

@ -1674,6 +1674,16 @@ $colour4: #8a89ba
display: none
// }}}
// FormView.one2many {{{
.oe_form .oe_form_field_one2many > .oe_view_manager
.oe_list_pager_single_page
display: none
// }}}
// FormView.many2many {{{
.oe_form .oe_form_field_many2many > .oe-listview
.oe_list_pager_single_page
display: none
// }}}
// FormView.classes for openerp views {{{
.oe_form
td.oe_form_group_cell_label

View File

@ -3283,6 +3283,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
},
start: function() {
this._super.apply(this, arguments);
this.$element.addClass('oe_form_field_many2many');
var self = this;
@ -3291,7 +3292,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
this.dataset.on_unlink.add_last(function(ids) {
self.dataset_changed();
});
this.is_setted.then(function() {
self.load_view();
});
@ -3304,7 +3305,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({
});
});
});
})
});
},
set_value: function(value_) {
value_ = value_ || [];

View File

@ -364,6 +364,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
}
var total = dataset.size();
this.$pager.toggleClass('oe_list_pager_single_page', (total <= this.limit()));
var spager = '-';
if (total) {
var range_start = this.page * this.limit() + 1;

View File

@ -404,7 +404,7 @@
<col width="33%"/>
<col width="33%"/>
<col width="34%"/>
<tr class="oe_header_row">
<tr class="oe_header_row oe_header_row_top">
<td colspan="2">
<h2 class="oe_view_title" t-if="widget.flags.display_title !== false">
<span class="oe_view_title_text"><t t-esc="widget.display_title()"/></span>
@ -642,8 +642,8 @@
</tfoot>
</table>
<div t-name="ListView.buttons" class="oe_list_buttons">
<t t-if="!widget.no_leaf and widget.options.action_buttons !== false">
<button type="button" class="oe_button oe_list_add oe_form_button_hi" t-if="widget.options.addable">
<t t-if="!widget.no_leaf and widget.options.action_buttons !== false and widget.options.addable">
<button type="button" class="oe_button oe_list_add oe_form_button_hi">
<t t-esc="widget.options.addable"/>
</button>
<span class="oe_fade">or</span> <a href="#" class="oe_bold oe_list_button_import">Import</a>
@ -1204,7 +1204,7 @@
</t>
<t t-name="One2Many.viewmanager" t-extend="ViewManager">
<t t-jquery="span.oe_view_title_text" t-operation="replace"/>
<t t-jquery=".oe_header_row_top" t-operation="replace"/>
<t t-jquery=".oe-view-manager-header">
this.attr('t-if', 'views.length != 1');