[IMP] web_kanban: various tweaks
* css tweaks * display correct tooltips in columns
This commit is contained in:
@@ -58,6 +58,11 @@ var KanbanColumn = Widget.extend({
|
||||
this.record_options = _.extend(_.clone(record_options), {
|
||||
group_info: this.values,
|
||||
});
|
||||
|
||||
var self = this;
|
||||
this.tooltip_info = _.map(group_data.options.group_by_tooltip, function (key, value, list) {
|
||||
return (self.values && self.values[value] && "<div>" +key + "<br>" + self.values[value] + "</div>") || '';
|
||||
}).join('');
|
||||
},
|
||||
|
||||
start: function() {
|
||||
@@ -157,7 +162,8 @@ var KanbanColumn = Widget.extend({
|
||||
} else {
|
||||
tooltip = this.records.length + _t(' records');
|
||||
}
|
||||
this.$header.tooltip().attr('data-original-title', tooltip);
|
||||
tooltip = '<p>' + tooltip + '</p>' + this.tooltip_info;
|
||||
this.$header.tooltip({html: true}).attr('data-original-title', tooltip);
|
||||
if (!this.remaining) {
|
||||
this.$('.o_kanban_load_more').remove();
|
||||
} else {
|
||||
|
||||
@@ -171,9 +171,11 @@ var KanbanView = View.extend({
|
||||
// legends for kanban state management (states_legend) are fetched in
|
||||
// one call.
|
||||
var group_by_fields_to_read = [];
|
||||
var group_options = {};
|
||||
var recurse = function(node) {
|
||||
if (node.tag === "field" && node.attrs && node.attrs.options) {
|
||||
if (node.tag === "field" && node.attrs && node.attrs.options && node.attrs.name === group_by_field) {
|
||||
var options = pyeval.py_eval(node.attrs.options);
|
||||
group_options = options;
|
||||
var states_fields_to_read = _.map(
|
||||
options && options.states_legend || {},
|
||||
function (value, key, list) { return value; });
|
||||
@@ -184,6 +186,7 @@ var KanbanView = View.extend({
|
||||
group_by_fields_to_read,
|
||||
states_fields_to_read,
|
||||
tooltip_fields_to_read);
|
||||
return;
|
||||
}
|
||||
_.each(node.children, function(child) {
|
||||
recurse(child);
|
||||
@@ -203,6 +206,7 @@ var KanbanView = View.extend({
|
||||
group.title = result ? result.display_name : _t("Undefined");
|
||||
group.values = result;
|
||||
group.id = group_id;
|
||||
group.options = group_options;
|
||||
});
|
||||
return groups;
|
||||
});
|
||||
|
||||
@@ -336,21 +336,6 @@
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.oe_kanban_status {
|
||||
display: inline-block;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
border-radius: 6px;
|
||||
|
||||
background-color: @odoo-brand-secondary;
|
||||
|
||||
&.oe_kanban_status_green {
|
||||
background-color: @brand-success;
|
||||
}
|
||||
&.oe_kanban_status_red {
|
||||
background-color: @brand-danger;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.o_kanban_group {
|
||||
@@ -531,6 +516,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
// necessary outside kanban views (for example, edit column form in task kanban view)
|
||||
// ideally, it should be made generic (.o_status, .o_status_green, ...)
|
||||
.oe_kanban_status {
|
||||
display: inline-block;
|
||||
height: 12px;
|
||||
width: 12px;
|
||||
border-radius: 6px;
|
||||
|
||||
background-color: @odoo-brand-secondary;
|
||||
|
||||
|
||||
&.oe_kanban_status_green {
|
||||
background-color: @brand-success;
|
||||
}
|
||||
&.oe_kanban_status_red {
|
||||
background-color: @brand-danger;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<t t-name="KanbanView.Group">
|
||||
<div class="o_kanban_group" t-att-data-id="widget.id">
|
||||
<div class="o_kanban_header" t-att-title="widget.data_records.length + ' records'">
|
||||
<div class="o_kanban_header" t-att-title="widget.data_records.length + ' records'" data-delay="500">
|
||||
<span class="o_column_title"><t t-esc="widget.title"/></span>
|
||||
<span class="o_column_unfold"><i class="fa fa-arrows-h"/></span>
|
||||
<span class="o_kanban_config dropdown">
|
||||
|
||||
Reference in New Issue
Block a user