[IMP] web_kanban: enable widget float_time
Enable widget float time in web_kanban which format a float as hours:minutes (the unit of the float being an hour). closes #8255 opw-648068
This commit is contained in:
parent
0f03699956
commit
0c4905738e
|
@ -1278,6 +1278,17 @@ instance.web_kanban.AbstractField = instance.web.Widget.extend(instance.web_kanb
|
|||
},
|
||||
});
|
||||
|
||||
instance.web_kanban.FormatChar = instance.web_kanban.AbstractField.extend({
|
||||
tagName: 'span',
|
||||
init: function(parent, field, $node) {
|
||||
this._super.apply(this, arguments);
|
||||
this.format_descriptor = _.extend({}, this.field, {'widget': this.$node.attr('widget')});
|
||||
},
|
||||
renderElement: function() {
|
||||
this.$el.text(instance.web.format_value(this.field.raw_value, this.format_descriptor));
|
||||
}
|
||||
});
|
||||
|
||||
instance.web_kanban.Priority = instance.web_kanban.AbstractField.extend({
|
||||
init: function(parent, field, $node) {
|
||||
this._super.apply(this, arguments);
|
||||
|
@ -1373,6 +1384,7 @@ instance.web_kanban.KanbanSelection = instance.web_kanban.AbstractField.extend({
|
|||
instance.web_kanban.fields_registry = new instance.web.Registry({});
|
||||
instance.web_kanban.fields_registry.add('priority','instance.web_kanban.Priority');
|
||||
instance.web_kanban.fields_registry.add('kanban_state_selection','instance.web_kanban.KanbanSelection');
|
||||
instance.web_kanban.fields_registry.add('float_time','instance.web_kanban.FormatChar');
|
||||
};
|
||||
|
||||
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
|
||||
|
|
Loading…
Reference in New Issue