[IMP] Moved kanban buttons in header

bzr revid: fme@openerp.com-20120410142051-lmhd2t0kcmqyf3sv
This commit is contained in:
Fabien Meghazi
2012-04-10 16:20:51 +02:00
parent d9e194be04
commit f61cd197b6
5 changed files with 27 additions and 47 deletions
-21
View File
@@ -454,27 +454,6 @@ label.error {
margin-right: 3px;
}
.openerp #tiptip_content {
font-size: 12px;
}
.openerp .oe_tooltip_string {
color: #FD5;
font-weight: bold;
font-size: 13px;
}
.openerp .oe_tooltip_help {
white-space: pre-wrap;
}
.openerp .oe_tooltip_technical {
padding: 0 0 4px 0;
margin: 5px 0 0 15px;
list-style: circle;
}
.openerp .oe_tooltip_technical_title {
font-weight: bold;
}
.openerp .oe_align_left {
text-align: left;
}
-19
View File
@@ -654,25 +654,6 @@
</td>
</tr>
<t t-name="FormView">
<div class="oe_formview">
<div class="oe_form_header">
<div class="oe_form_buttons" t-if="widget.options.action_buttons !== false">
<button type="button" class="oe_button oe_form_button_save">Save</button>
<button type="button" class="oe_button oe_form_button_cancel">Cancel</button>
</div>
<div class="oe_form_pager" t-if="widget.options.pager !== false">
<t t-call="ViewPager">
<span class="oe_pager_index">0</span><span class="oe_pager_separator"> / </span><span class="oe_pager_count">0</span>
</t>
</div>
<div class="oe_form_sidebar">
</div>
</div>
<div style="clear: both;"/>
<div class="oe_form_container"/>
</div>
</t>
<t t-name="FormView">
<div class="oe_formview">
<div class="oe_form_buttons"/>
@@ -3,6 +3,9 @@
visibility: visible !important;
height: 60px !important;
}
.openerp .oe_kanban_groups {
width: 100%;
}
.openerp .oe_kanban_group_header {
position: relative;
}
+17 -1
View File
@@ -37,7 +37,14 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
this.add_group_mutex = new $.Mutex();
},
on_loaded: function(data) {
this.$element.find('button.oe_kanban_button_new').click(this.do_add_record);
this.$buttons = $(QWeb.render("KanbanView.buttons", {'widget': this}));
if (this.options.$buttons) {
this.$buttons.appendTo(this.options.$buttons);
} else {
this.$element.find('.oe_kanban_buttons').replaceWith(this.$buttons);
}
this.$buttons
.on('click','button.oe_kanban_button_new', this.do_add_record);
this.$groups = this.$element.find('.oe_kanban_groups tr');
this.fields_view = data;
this.fields_keys = _.keys(this.fields_view.fields);
@@ -265,9 +272,18 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
},
do_show: function() {
if (this.$buttons) {
this.$buttons.show();
}
this.do_push_state({});
return this._super();
},
do_hide: function () {
if (this.$buttons) {
this.$buttons.hide();
}
return this._super();
},
open_record: function(id) {
if (this.dataset.select_id(id)) {
this.do_switch_view('form');
@@ -1,12 +1,8 @@
<template>
<t t-name="KanbanView">
<div class="oe_view_topbar">
<t t-if="widget.options.action_buttons !== false">
<button type="button" class="oe_button oe_kanban_button_new">Create</button>
</t>
</div>
<div class="oe_kanban_buttons"/>
<div class="oe_kanban_view">
<table style="width:100%;" class="oe_kanban_groups">
<table class="oe_kanban_groups">
<tr class="oe_kanban_groups_headers">
</tr>
<tr class="oe_kanban_groups_records">
@@ -14,6 +10,11 @@
</table>
</div>
</t>
<div t-name="KanbanView.buttons" class="oe_kanban_buttons">
<t t-if="widget.options.action_buttons !== false">
<button type="button" class="oe_button oe_kanban_button_new">Create</button>
</t>
</div>
<t t-name="KanbanView.group_header">
<td>
<t t-if="widget.view.group_by">