', {
- html: $(QWeb.render('muk_web_utils.MissingModuleDialog')),
- }),
- title: _t("Missing Module"),
- }).open();
- },
- _confirmRedirect: function () {
- if(this.nodeOptions.url) {
- framework.redirect(this.nodeOptions.url);
- } else {
- var module = this.name.replace("module_", "");
- framework.redirect("https://apps.odoo.com/apps/modules/browse?search=" + module);
- }
- },
- _render: function () {
- this._super.apply(this, arguments);
- var $element = this.$label || this.$el;
- $element.append(' ').append($("", {
- 'text': _t("Store"),
- 'class': "badge badge-primary oe_inline mk_module_label"
- }));
- },
- _onInputClicked: function (event) {
- if ($(event.currentTarget).prop("checked")) {
- var dialog = this._openDialog();
- dialog.on('closed', this, this._resetValue.bind(this));
- }
- },
- _resetValue: function () {
- this.$input.prop("checked", false).change();
- },
-});
-
-registry.add('module_boolean', ModuleBoolean);
-
-return ModuleBoolean;
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+odoo.define('muk_web_utils.ModuleBoolean', function (require) {
+"use strict";
+
+var core = require('web.core');
+var fields = require('web.basic_fields');
+var registry = require('web.field_registry');
+var framework = require('web.framework');
+
+var Dialog = require('web.Dialog');
+var AbstractField = require('web.AbstractField');
+
+var _t = core._t;
+var QWeb = core.qweb;
+
+var ModuleBoolean = fields.FieldBoolean.extend({
+ supportedFieldTypes: [],
+ events: _.extend({}, AbstractField.prototype.events, {
+ 'click input': '_onInputClicked',
+ }),
+ renderWithLabel: function ($label) {
+ this.$label = $label;
+ this._render();
+ },
+ _openDialog: function () {
+ var buttons = [{
+ text: _t("Download"),
+ classes: 'btn-primary',
+ close: true,
+ click: this._confirmRedirect.bind(this),
+ }, {
+ text: _t("Cancel"),
+ close: true,
+ }];
+ return new Dialog(this, {
+ size: 'medium',
+ buttons: buttons,
+ $content: $('
', {
+ html: $(QWeb.render('muk_web_utils.MissingModuleDialog')),
+ }),
+ title: _t("Missing Module"),
+ }).open();
+ },
+ _confirmRedirect: function () {
+ if(this.nodeOptions.url) {
+ framework.redirect(this.nodeOptions.url);
+ } else {
+ var module = this.name.replace("module_", "");
+ framework.redirect("https://apps.odoo.com/apps/modules/browse?search=" + module);
+ }
+ },
+ _render: function () {
+ this._super.apply(this, arguments);
+ var $element = this.$label || this.$el;
+ $element.append(' ').append($("", {
+ 'text': _t("Store"),
+ 'class': "badge badge-primary oe_inline mk_module_label"
+ }));
+ },
+ _onInputClicked: function (event) {
+ if ($(event.currentTarget).prop("checked")) {
+ var dialog = this._openDialog();
+ dialog.on('closed', this, this._resetValue.bind(this));
+ }
+ },
+ _resetValue: function () {
+ this.$input.prop("checked", false).change();
+ },
+});
+
+registry.add('module_boolean', ModuleBoolean);
+
+return ModuleBoolean;
+
});
\ No newline at end of file
diff --git a/muk_web_utils/static/src/js/fields/path.js b/muk_web_utils/static/src/js/fields/path.js
index e3c49b9..ffc2bc1 100644
--- a/muk_web_utils/static/src/js/fields/path.js
+++ b/muk_web_utils/static/src/js/fields/path.js
@@ -1,116 +1,119 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-odoo.define('muk_web_utils.path', function (require) {
-"use strict";
-
-var core = require('web.core');
-var fields = require('web.basic_fields');
-var registry = require('web.field_registry');
-var colorpicker = require('web.colorpicker');
-
-var AbstractField = require('web.AbstractField');
-
-var _t = core._t;
-var QWeb = core.qweb;
-
-var FieldPathNames = fields.FieldChar.extend({
- init: function(parent, name, record) {
- this._super.apply(this, arguments);
- this.max_width = this.nodeOptions.width || 500;
- },
- _renderReadonly: function() {
- var show_value = this._formatValue(this.value);
- var text_witdh = $.fn.textWidth(show_value);
- if(text_witdh >= this.max_width) {
- var ratio_start = (1 - (this.max_width / text_witdh)) * show_value.length;
- show_value = ".." + show_value.substring(ratio_start, show_value.length);
- }
- this.$el.text(show_value);
- },
-});
-
-var FieldPathJson = fields.FieldText.extend({
- events: _.extend({}, fields.FieldText.prototype.events, {
- 'click a' : '_onNodeClicked',
- }),
- init: function(parent, name, record) {
- this._super.apply(this, arguments);
- this.max_width = this.nodeOptions.width || 500;
- this.seperator = this.nodeOptions.seperator || "/";
- this.prefix = this.nodeOptions.prefix || false;
- this.suffix = this.nodeOptions.suffix || false;
- },
- _renderReadonly: function() {
- this.$el.empty();
- this._renderPath();
- },
- _renderPath: function() {
- var text_width_measure = "";
- var path = JSON.parse(this.value || "[]");
- $.each(_.clone(path).reverse(), function(index, element) {
- text_width_measure += element.name + "/";
- if($.fn.textWidth(text_width_measure) >= this.max_width) {
- this.$el.prepend($('').text(".."));
- } else {
- if (index == 0) {
- if(this.suffix) {
- this.$el.prepend($('').text(this.seperator));
- }
- this.$el.prepend($('').text(element.name));
- this.$el.prepend($('').text(this.seperator));
- } else {
- this.$el.prepend($('', {
- 'class': 'oe_form_uri',
- 'data-model': element.model,
- 'data-id': element.id,
- 'href': "javascript:void(0);",
- 'text': element.name,
- }));
- if (index != path.length - 1) {
- this.$el.prepend($('').text(this.seperator));
- } else if (this.prefix) {
- this.$el.prepend($('').text(this.seperator));
- }
- }
- }
- return ($.fn.textWidth(text_width_measure) < this.max_width);
- }.bind(this));
- },
- _onNodeClicked : function(event) {
- this.do_action({
- type: 'ir.actions.act_window',
- res_model: $(event.currentTarget).data('model'),
- res_id: $(event.currentTarget).data('id'),
- views: [[false, 'form']],
- target: 'current',
- context: {},
- });
- }
-});
-
-registry.add('path_names', FieldPathNames);
-registry.add('path_json', FieldPathJson);
-
-return {
- FieldPathNames: FieldPathNames,
- FieldPathJson: FieldPathJson,
-};
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+odoo.define('muk_web_utils.path', function (require) {
+"use strict";
+
+var core = require('web.core');
+var fields = require('web.basic_fields');
+var registry = require('web.field_registry');
+var colorpicker = require('web.colorpicker');
+
+var AbstractField = require('web.AbstractField');
+
+var _t = core._t;
+var QWeb = core.qweb;
+
+var FieldPathNames = fields.FieldChar.extend({
+ init: function(parent, name, record) {
+ this._super.apply(this, arguments);
+ this.max_width = this.nodeOptions.width || 500;
+ },
+ _renderReadonly: function() {
+ var show_value = this._formatValue(this.value);
+ var text_witdh = $.fn.textWidth(show_value);
+ if(text_witdh >= this.max_width) {
+ var ratio_start = (1 - (this.max_width / text_witdh)) * show_value.length;
+ show_value = ".." + show_value.substring(ratio_start, show_value.length);
+ }
+ this.$el.text(show_value);
+ },
+});
+
+var FieldPathJson = fields.FieldText.extend({
+ events: _.extend({}, fields.FieldText.prototype.events, {
+ 'click a' : '_onNodeClicked',
+ }),
+ init: function(parent, name, record) {
+ this._super.apply(this, arguments);
+ this.max_width = this.nodeOptions.width || 500;
+ this.seperator = this.nodeOptions.seperator || "/";
+ this.prefix = this.nodeOptions.prefix || false;
+ this.suffix = this.nodeOptions.suffix || false;
+ },
+ _renderReadonly: function() {
+ this.$el.empty();
+ this._renderPath();
+ },
+ _renderPath: function() {
+ var text_width_measure = "";
+ var path = JSON.parse(this.value || "[]");
+ $.each(_.clone(path).reverse(), function(index, element) {
+ text_width_measure += element.name + "/";
+ if($.fn.textWidth(text_width_measure) >= this.max_width) {
+ this.$el.prepend($('').text(".."));
+ } else {
+ if (index == 0) {
+ if(this.suffix) {
+ this.$el.prepend($('').text(this.seperator));
+ }
+ this.$el.prepend($('').text(element.name));
+ this.$el.prepend($('').text(this.seperator));
+ } else {
+ this.$el.prepend($('', {
+ 'class': 'oe_form_uri',
+ 'data-model': element.model,
+ 'data-id': element.id,
+ 'href': "javascript:void(0);",
+ 'text': element.name,
+ }));
+ if (index != path.length - 1) {
+ this.$el.prepend($('').text(this.seperator));
+ } else if (this.prefix) {
+ this.$el.prepend($('').text(this.seperator));
+ }
+ }
+ }
+ return ($.fn.textWidth(text_width_measure) < this.max_width);
+ }.bind(this));
+ },
+ _onNodeClicked : function(event) {
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: $(event.currentTarget).data('model'),
+ res_id: $(event.currentTarget).data('id'),
+ views: [[false, 'form']],
+ target: 'current',
+ context: {},
+ });
+ }
+});
+
+registry.add('path_names', FieldPathNames);
+registry.add('path_json', FieldPathJson);
+
+return {
+ FieldPathNames: FieldPathNames,
+ FieldPathJson: FieldPathJson,
+};
+
});
\ No newline at end of file
diff --git a/muk_web_utils/static/src/js/fields/share.js b/muk_web_utils/static/src/js/fields/share.js
index c367482..eaa0eee 100644
--- a/muk_web_utils/static/src/js/fields/share.js
+++ b/muk_web_utils/static/src/js/fields/share.js
@@ -1,224 +1,227 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-odoo.define('muk_web_utils.share', function (require) {
-"use strict";
-
-var core = require('web.core');
-var session = require('web.session');
-var fields = require('web.basic_fields');
-var registry = require('web.field_registry');
-
-var utils = require('muk_web_utils.utils');
-var copy = require('muk_web_utils.copy');
-
-var _t = core._t;
-var QWeb = core.qweb;
-
-var ShareMixin = {
- shareEvents: {
- 'click .mk_share_dropdown_message': '_onShareMessageClick',
- 'click .mk_share_dropdown_note': '_onShareNoteClick',
- 'click .mk_share_dropdown_mail': '_onShareMailClick',
- 'click .mk_share_dropdown_send': '_onShareSendClick',
- },
- getShareMessageValues: function(message) {
- var values = {
- name: session.partner_display_name,
- record: this.recordData.display_name,
- url: utils.isUrl(this.value) && this.value,
- value: this.value,
- };
- return {
- subject: _.template(this.shareOptions.subjectTemplate)(values),
- body: QWeb.render(this.shareOptions.bodyTemplate, values),
- text: _.template(this.shareOptions.textTemplate)(values),
- url: utils.isUrl(this.value) && this.value,
- }
- },
- openShareChat: function(note) {
- var values = this.getShareMessageValues();
- var context = {
- default_is_log: note,
- default_body: values.body,
- default_subject: values.subject,
- default_model: this.shareOptions.res_model,
- default_res_id: this.shareOptions.res_id,
- mail_post_autofollow: false,
- };
- this.do_action({
- type: 'ir.actions.act_window',
- res_model: 'mail.compose.message',
- view_mode: 'form',
- view_type: 'form',
- views: [[false, 'form']],
- target: 'new',
- context: context,
- });
- },
- _onShareMessageClick: function(event) {
- event.preventDefault();
- event.stopPropagation();
- this.openShareChat(false);
- },
- _onShareNoteClick: function(event) {
- event.preventDefault();
- event.stopPropagation();
- this.openShareChat(true);
- },
- _onShareMailClick: function(event) {
- event.preventDefault();
- event.stopPropagation();
- var values = this.getShareMessageValues();
- var subject = "subject=" + values.subject;
- var body = "&body=" + encodeURIComponent(values.text);
- window.location.href = "mailto:?" + subject + body;
- },
- _onShareSendClick: function(event) {
- event.preventDefault();
- event.stopPropagation();
- var values = this.getShareMessageValues();
- navigator.share({
- title: values.subject,
- text: values.text,
- url: values.url,
- });
- },
-};
-
-var CharShare = fields.CharCopyClipboard.extend(ShareMixin, {
- fieldDependencies: _.extend({}, fields.CharCopyClipboard.prototype.fieldDependencies, {
- display_name: {type: 'char'},
- }),
- events: _.extend({}, fields.CharCopyClipboard.prototype.events, ShareMixin.shareEvents),
- init: function(parent, name, record) {
- this._super.apply(this, arguments);
- this.navigator = window.navigator.share;
- this.chatter = _.contains(odoo._modules, "mail");
- this.shareOptions = _.defaults(this.nodeOptions, {
- subjectTemplate: _t("<%= name %> shared a message!"),
- textTemplate: _t("<%= value %>"),
- bodyTemplate: 'muk_web_utils.ShareMessage',
- });
- this.shareOptions = _.extend({}, this.shareOptions, {
- res_model: this.recordData[this.nodeOptions.res_model] || this.model,
- res_id: this.recordData[this.nodeOptions.res_id] || this.res_id,
- });
- },
- _render: function() {
- this._super.apply(this, arguments);
- this.$el.addClass('mk_field_share');
- this.$el.prepend($(QWeb.render('muk_web_utils.CharShare', {
- navigator: !!this.navigator,
- chatter: !!this.chatter,
- })));
- },
-});
-
-var TextShare = fields.TextCopyClipboard.extend(ShareMixin, {
- fieldDependencies: _.extend({}, fields.TextCopyClipboard.prototype.fieldDependencies, {
- display_name: {type: 'char'},
- }),
- events: _.extend({}, fields.TextCopyClipboard.prototype.events, ShareMixin.shareEvents),
- init: function(parent, name, record) {
- this._super.apply(this, arguments);
- this.navigator = window.navigator.share;
- this.chatter = _.contains(odoo._modules, "mail");
- this.shareOptions = _.defaults(this.nodeOptions, {
- subjectTemplate: _t("<%= name %> shared a message!"),
- textTemplate: _t("<%= value %>"),
- bodyTemplate: 'muk_web_utils.ShareMessage',
- });
- this.shareOptions = _.extend({}, this.shareOptions, {
- res_model: this.recordData[this.nodeOptions.res_model] || this.model,
- res_id: this.recordData[this.nodeOptions.res_id] || this.res_id,
- });
- },
- _render: function() {
- this._super.apply(this, arguments);
- this.$el.addClass('mk_field_share');
- this.$el.prepend($(QWeb.render('muk_web_utils.TextShare', {
- navigator: !!this.navigator,
- chatter: !!this.chatter,
- })));
- }
-});
-
-var BinaryFileShare = copy.BinaryFileCopy.extend(ShareMixin, {
- fieldDependencies: _.extend({}, fields.FieldBinaryFile.prototype.fieldDependencies, {
- display_name: {type: 'char'},
- }),
- events: _.extend({}, copy.BinaryFileCopy.prototype.events, ShareMixin.shareEvents, {
- 'click .mk_share_button': '_onShareDropdownClick',
- }),
- init: function () {
- this._super.apply(this, arguments);
- this.navigator = window.navigator.share;
- this.chatter = _.contains(odoo._modules, "mail");
- this.shareOptions = _.defaults(this.nodeOptions, {
- subjectTemplate: _t("<%= name %> shared a file!"),
- textTemplate: _t("<%= value %>"),
- bodyTemplate: 'muk_web_utils.ShareBinaryMessage',
- });
- this.shareOptions = _.extend({}, this.shareOptions, {
- res_model: this.recordData[this.nodeOptions.res_model] || this.model,
- res_id: this.recordData[this.nodeOptions.res_id] || this.res_id,
- });
- },
- getShareMessageValues: function() {
- var values = {
- name: session.partner_display_name,
- record: this.recordData.display_name,
- url: this.shareUrl,
- value: this.shareUrl,
- };
- return {
- subject: _.template(this.shareOptions.subjectTemplate)(values),
- body: QWeb.render(this.shareOptions.bodyTemplate, values),
- text: _.template(this.shareOptions.textTemplate)(values),
- url: this.shareUrl,
- }
- },
- _renderReadonly: function () {
- this._super.apply(this, arguments);
- this.$el.addClass('mk_field_share');
- this.$el.append($(QWeb.render('muk_web_utils.BinaryShare', {
- navigator: !!this.navigator,
- chatter: !!this.chatter,
- share: !!this.shareUrl,
- })));
- },
- _onShareDropdownClick: function(event) {
- $(event.currentTarget).dropdown("toggle");
- event.stopPropagation();
- },
-});
-
-registry.add('share_char', CharShare);
-registry.add('share_text', TextShare);
-registry.add('share_binary', BinaryFileShare);
-
-return {
- ShareMixin: ShareMixin,
- CharShare: CharShare,
- TextShare: TextShare,
- BinaryFileShare: BinaryFileShare,
-};
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+odoo.define('muk_web_utils.share', function (require) {
+"use strict";
+
+var core = require('web.core');
+var session = require('web.session');
+var fields = require('web.basic_fields');
+var registry = require('web.field_registry');
+
+var utils = require('muk_web_utils.utils');
+var copy = require('muk_web_utils.copy');
+
+var _t = core._t;
+var QWeb = core.qweb;
+
+var ShareMixin = {
+ shareEvents: {
+ 'click .mk_share_dropdown_message': '_onShareMessageClick',
+ 'click .mk_share_dropdown_note': '_onShareNoteClick',
+ 'click .mk_share_dropdown_mail': '_onShareMailClick',
+ 'click .mk_share_dropdown_send': '_onShareSendClick',
+ },
+ getShareMessageValues: function(message) {
+ var values = {
+ name: session.partner_display_name,
+ record: this.recordData.display_name,
+ url: utils.isUrl(this.value) && this.value,
+ value: this.value,
+ };
+ return {
+ subject: _.template(this.shareOptions.subjectTemplate)(values),
+ body: QWeb.render(this.shareOptions.bodyTemplate, values),
+ text: _.template(this.shareOptions.textTemplate)(values),
+ url: utils.isUrl(this.value) && this.value,
+ }
+ },
+ openShareChat: function(note) {
+ var values = this.getShareMessageValues();
+ var context = {
+ default_is_log: note,
+ default_body: values.body,
+ default_subject: values.subject,
+ default_model: this.shareOptions.res_model,
+ default_res_id: this.shareOptions.res_id,
+ mail_post_autofollow: false,
+ };
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'mail.compose.message',
+ view_mode: 'form',
+ view_type: 'form',
+ views: [[false, 'form']],
+ target: 'new',
+ context: context,
+ });
+ },
+ _onShareMessageClick: function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ this.openShareChat(false);
+ },
+ _onShareNoteClick: function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ this.openShareChat(true);
+ },
+ _onShareMailClick: function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ var values = this.getShareMessageValues();
+ var subject = "subject=" + values.subject;
+ var body = "&body=" + encodeURIComponent(values.text);
+ window.location.href = "mailto:?" + subject + body;
+ },
+ _onShareSendClick: function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ var values = this.getShareMessageValues();
+ navigator.share({
+ title: values.subject,
+ text: values.text,
+ url: values.url,
+ });
+ },
+};
+
+var CharShare = fields.CharCopyClipboard.extend(ShareMixin, {
+ fieldDependencies: _.extend({}, fields.CharCopyClipboard.prototype.fieldDependencies, {
+ display_name: {type: 'char'},
+ }),
+ events: _.extend({}, fields.CharCopyClipboard.prototype.events, ShareMixin.shareEvents),
+ init: function(parent, name, record) {
+ this._super.apply(this, arguments);
+ this.navigator = window.navigator.share;
+ this.chatter = _.contains(odoo._modules, "mail");
+ this.shareOptions = _.defaults(this.nodeOptions, {
+ subjectTemplate: _t("<%= name %> shared a message!"),
+ textTemplate: _t("<%= value %>"),
+ bodyTemplate: 'muk_web_utils.ShareMessage',
+ });
+ this.shareOptions = _.extend({}, this.shareOptions, {
+ res_model: this.recordData[this.nodeOptions.res_model] || this.model,
+ res_id: this.recordData[this.nodeOptions.res_id] || this.res_id,
+ });
+ },
+ _render: function() {
+ this._super.apply(this, arguments);
+ this.$el.addClass('mk_field_share');
+ this.$el.prepend($(QWeb.render('muk_web_utils.CharShare', {
+ navigator: !!this.navigator,
+ chatter: !!this.chatter,
+ })));
+ },
+});
+
+var TextShare = fields.TextCopyClipboard.extend(ShareMixin, {
+ fieldDependencies: _.extend({}, fields.TextCopyClipboard.prototype.fieldDependencies, {
+ display_name: {type: 'char'},
+ }),
+ events: _.extend({}, fields.TextCopyClipboard.prototype.events, ShareMixin.shareEvents),
+ init: function(parent, name, record) {
+ this._super.apply(this, arguments);
+ this.navigator = window.navigator.share;
+ this.chatter = _.contains(odoo._modules, "mail");
+ this.shareOptions = _.defaults(this.nodeOptions, {
+ subjectTemplate: _t("<%= name %> shared a message!"),
+ textTemplate: _t("<%= value %>"),
+ bodyTemplate: 'muk_web_utils.ShareMessage',
+ });
+ this.shareOptions = _.extend({}, this.shareOptions, {
+ res_model: this.recordData[this.nodeOptions.res_model] || this.model,
+ res_id: this.recordData[this.nodeOptions.res_id] || this.res_id,
+ });
+ },
+ _render: function() {
+ this._super.apply(this, arguments);
+ this.$el.addClass('mk_field_share');
+ this.$el.prepend($(QWeb.render('muk_web_utils.TextShare', {
+ navigator: !!this.navigator,
+ chatter: !!this.chatter,
+ })));
+ }
+});
+
+var BinaryFileShare = copy.BinaryFileCopy.extend(ShareMixin, {
+ fieldDependencies: _.extend({}, fields.FieldBinaryFile.prototype.fieldDependencies, {
+ display_name: {type: 'char'},
+ }),
+ events: _.extend({}, copy.BinaryFileCopy.prototype.events, ShareMixin.shareEvents, {
+ 'click .mk_share_button': '_onShareDropdownClick',
+ }),
+ init: function () {
+ this._super.apply(this, arguments);
+ this.navigator = window.navigator.share;
+ this.chatter = _.contains(odoo._modules, "mail");
+ this.shareOptions = _.defaults(this.nodeOptions, {
+ subjectTemplate: _t("<%= name %> shared a file!"),
+ textTemplate: _t("<%= value %>"),
+ bodyTemplate: 'muk_web_utils.ShareBinaryMessage',
+ });
+ this.shareOptions = _.extend({}, this.shareOptions, {
+ res_model: this.recordData[this.nodeOptions.res_model] || this.model,
+ res_id: this.recordData[this.nodeOptions.res_id] || this.res_id,
+ });
+ },
+ getShareMessageValues: function() {
+ var values = {
+ name: session.partner_display_name,
+ record: this.recordData.display_name,
+ url: this.shareUrl,
+ value: this.shareUrl,
+ };
+ return {
+ subject: _.template(this.shareOptions.subjectTemplate)(values),
+ body: QWeb.render(this.shareOptions.bodyTemplate, values),
+ text: _.template(this.shareOptions.textTemplate)(values),
+ url: this.shareUrl,
+ }
+ },
+ _renderReadonly: function () {
+ this._super.apply(this, arguments);
+ this.$el.addClass('mk_field_share');
+ this.$el.append($(QWeb.render('muk_web_utils.BinaryShare', {
+ navigator: !!this.navigator,
+ chatter: !!this.chatter,
+ share: !!this.shareUrl,
+ })));
+ },
+ _onShareDropdownClick: function(event) {
+ $(event.currentTarget).dropdown("toggle");
+ event.stopPropagation();
+ },
+});
+
+registry.add('share_char', CharShare);
+registry.add('share_text', TextShare);
+registry.add('share_binary', BinaryFileShare);
+
+return {
+ ShareMixin: ShareMixin,
+ CharShare: CharShare,
+ TextShare: TextShare,
+ BinaryFileShare: BinaryFileShare,
+};
+
});
\ No newline at end of file
diff --git a/muk_web_utils/static/src/js/fields/utils.js b/muk_web_utils/static/src/js/fields/utils.js
index 70d6372..001acdd 100644
--- a/muk_web_utils/static/src/js/fields/utils.js
+++ b/muk_web_utils/static/src/js/fields/utils.js
@@ -1,51 +1,54 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-odoo.define('muk_web_utils.field_utils', function(require) {
-"use strict";
-
-var core = require('web.core');
-var session = require('web.session');
-var utils = require('web.field_utils');
-
-var _t = core._t;
-var QWeb = core.qweb;
-
-function formatBinarySize(value, field, options) {
- options = _.defaults(options || {}, {
- si: true,
- });
- var thresh = options.si ? 1000 : 1024;
- if(Math.abs(value) < thresh) {
- return utils.format['float'](value, field, options) + ' B';
- }
- var units = options.si
- ? ['KB','MB','GB','TB','PB','EB','ZB','YB']
- : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
- var unit = -1;
- do {
- value /= thresh;
- ++unit;
- } while(Math.abs(value) >= thresh && unit < units.length - 1);
- return utils.format['float'](value, field, options) + ' ' + units[unit];
-}
-
-utils.format.binary_size = formatBinarySize;
-
-});
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+odoo.define('muk_web_utils.field_utils', function(require) {
+"use strict";
+
+var core = require('web.core');
+var session = require('web.session');
+var utils = require('web.field_utils');
+
+var _t = core._t;
+var QWeb = core.qweb;
+
+function formatBinarySize(value, field, options) {
+ options = _.defaults(options || {}, {
+ si: true,
+ });
+ var thresh = options.si ? 1000 : 1024;
+ if(Math.abs(value) < thresh) {
+ return utils.format['float'](value, field, options) + ' B';
+ }
+ var units = options.si
+ ? ['KB','MB','GB','TB','PB','EB','ZB','YB']
+ : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
+ var unit = -1;
+ do {
+ value /= thresh;
+ ++unit;
+ } while(Math.abs(value) >= thresh && unit < units.length - 1);
+ return utils.format['float'](value, field, options) + ' ' + units[unit];
+}
+
+utils.format.binary_size = formatBinarySize;
+
+});
diff --git a/muk_web_utils/static/src/js/libs/jquery.js b/muk_web_utils/static/src/js/libs/jquery.js
index 3e57ed1..84b3314 100644
--- a/muk_web_utils/static/src/js/libs/jquery.js
+++ b/muk_web_utils/static/src/js/libs/jquery.js
@@ -1,101 +1,104 @@
-/**********************************************************************************
-*
-* Copyright (C) 2018 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-$.fn.textWidth = function(text, font) {
- if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('').hide().appendTo(document.body);
- $.fn.textWidth.fakeEl.text(text || this.val() || this.text()).css('font', font || this.css('font'));
- return $.fn.textWidth.fakeEl.width();
-};
-
-$.fn.dndHover = function(options) {
- return this.each(function() {
- var self = $(this);
- var collection = $();
- var dragenter = function(event) {
- if (collection.size() === 0) {
- self.trigger('dndHoverStart', [event]);
- }
- collection = collection.add(event.target);
- };
- var dragleave = function(event) {
- setTimeout(function() {
- collection = collection.not(event.target);
- if (collection.size() === 0) {
- self.trigger('dndHoverEnd', [event]);
- }
- }, 1);
- };
- var drop = function(event) {
- setTimeout(function() {
- collection = $();
- self.trigger('dndHoverEnd', [event]);
- }, 1);
- };
- if(options && options === 'destroy') {
- self.off('dragenter.dnd_hover');
- self.off('dragleave.dnd_hover');
- self.off('drop.dnd_hover');
- } else {
- self.on('dragenter.dnd_hover', dragenter);
- self.on('dragleave.dnd_hover', dragleave);
- self.on('drop.dnd_hover', drop);
- }
- });
-};
-
-$.ajaxTransport("+binary", function(options, originalOptions, jqXHR) {
- if (window.FormData && ((options.dataType && (options.dataType == 'binary')) ||
- (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) ||
- (window.Blob && options.data instanceof Blob))))) {
- return {
- send: function(headers, callback){
- var xhr = new XMLHttpRequest();
- var url = options.url,
- type = options.type,
- async = options.async || true,
- dataType = options.responseType || 'blob',
- data = options.data || null,
- username = options.username,
- password = options.password;
- xhr.addEventListener('load', function(){
- var data = {};
- data[options.dataType] = xhr.response;
- callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders());
- });
- xhr.open(type, url, async, username, password);
- for (var i in headers ) {
- xhr.setRequestHeader(i, headers[i] );
- }
- if (options.xhrFields) {
- for (var key in options.xhrFields) {
- if (key in xhr) {
- xhr[key] = options.xhrFields[key];
- }
- }
- }
- xhr.responseType = dataType;
- xhr.send(data);
- },
- abort: function(){
- jqXHR.abort();
- }
- };
- }
-});
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+$.fn.textWidth = function(text, font) {
+ if (!$.fn.textWidth.fakeEl) $.fn.textWidth.fakeEl = $('').hide().appendTo(document.body);
+ $.fn.textWidth.fakeEl.text(text || this.val() || this.text()).css('font', font || this.css('font'));
+ return $.fn.textWidth.fakeEl.width();
+};
+
+$.fn.dndHover = function(options) {
+ return this.each(function() {
+ var self = $(this);
+ var collection = $();
+ var dragenter = function(event) {
+ if (collection.size() === 0) {
+ self.trigger('dndHoverStart', [event]);
+ }
+ collection = collection.add(event.target);
+ };
+ var dragleave = function(event) {
+ setTimeout(function() {
+ collection = collection.not(event.target);
+ if (collection.size() === 0) {
+ self.trigger('dndHoverEnd', [event]);
+ }
+ }, 1);
+ };
+ var drop = function(event) {
+ setTimeout(function() {
+ collection = $();
+ self.trigger('dndHoverEnd', [event]);
+ }, 1);
+ };
+ if(options && options === 'destroy') {
+ self.off('dragenter.dnd_hover');
+ self.off('dragleave.dnd_hover');
+ self.off('drop.dnd_hover');
+ } else {
+ self.on('dragenter.dnd_hover', dragenter);
+ self.on('dragleave.dnd_hover', dragleave);
+ self.on('drop.dnd_hover', drop);
+ }
+ });
+};
+
+$.ajaxTransport("+binary", function(options, originalOptions, jqXHR) {
+ if (window.FormData && ((options.dataType && (options.dataType == 'binary')) ||
+ (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) ||
+ (window.Blob && options.data instanceof Blob))))) {
+ return {
+ send: function(headers, callback){
+ var xhr = new XMLHttpRequest();
+ var url = options.url,
+ type = options.type,
+ async = options.async || true,
+ dataType = options.responseType || 'blob',
+ data = options.data || null,
+ username = options.username,
+ password = options.password;
+ xhr.addEventListener('load', function(){
+ var data = {};
+ data[options.dataType] = xhr.response;
+ callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders());
+ });
+ xhr.open(type, url, async, username, password);
+ for (var i in headers ) {
+ xhr.setRequestHeader(i, headers[i] );
+ }
+ if (options.xhrFields) {
+ for (var key in options.xhrFields) {
+ if (key in xhr) {
+ xhr[key] = options.xhrFields[key];
+ }
+ }
+ }
+ xhr.responseType = dataType;
+ xhr.send(data);
+ },
+ abort: function(){
+ jqXHR.abort();
+ }
+ };
+ }
+});
+
diff --git a/muk_web_utils/static/src/js/libs/scrollbar.js b/muk_web_utils/static/src/js/libs/scrollbar.js
index 7d0bd9a..2c889fd 100644
--- a/muk_web_utils/static/src/js/libs/scrollbar.js
+++ b/muk_web_utils/static/src/js/libs/scrollbar.js
@@ -1,24 +1,27 @@
-/**********************************************************************************
-*
-* Copyright (C) 2018 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-$.fn.renderScrollBar = function() {
- this.each(function() {
- new SimpleBar(this);
- });
-};
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+$.fn.renderScrollBar = function() {
+ this.each(function() {
+ new SimpleBar(this);
+ });
+};
diff --git a/muk_web_utils/static/src/js/libs/underscore.js b/muk_web_utils/static/src/js/libs/underscore.js
index 5901f96..a8a4aa8 100644
--- a/muk_web_utils/static/src/js/libs/underscore.js
+++ b/muk_web_utils/static/src/js/libs/underscore.js
@@ -1,44 +1,47 @@
-/**********************************************************************************
-*
-* Copyright (C) 2018 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-_.mixin({
- memoizeDebounce: function(func, wait, options) {
- wait = (typeof wait !== 'undefined') ? wait : 0;
- options = (typeof options !== 'undefined') ? options : {};
- var mem = _.memoize(function() {
- return _.debounce(func, wait, options)
- }, options.resolver);
- return function() {
- mem.apply(this, arguments).apply(this, arguments)
- }
- }
-});
-
-_.mixin({
- memoizeThrottle: function(func, wait, options) {
- wait = (typeof wait !== 'undefined') ? wait : 0;
- options = (typeof options !== 'undefined') ? options : {};
- var mem = _.memoize(function() {
- return _.throttle(func, wait, options)
- }, options.resolver);
- return function() {
- mem.apply(this, arguments).apply(this, arguments)
- }
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+_.mixin({
+ memoizeDebounce: function(func, wait, options) {
+ wait = (typeof wait !== 'undefined') ? wait : 0;
+ options = (typeof options !== 'undefined') ? options : {};
+ var mem = _.memoize(function() {
+ return _.debounce(func, wait, options)
+ }, options.resolver);
+ return function() {
+ mem.apply(this, arguments).apply(this, arguments)
+ }
+ }
+});
+
+_.mixin({
+ memoizeThrottle: function(func, wait, options) {
+ wait = (typeof wait !== 'undefined') ? wait : 0;
+ options = (typeof options !== 'undefined') ? options : {};
+ var mem = _.memoize(function() {
+ return _.throttle(func, wait, options)
+ }, options.resolver);
+ return function() {
+ mem.apply(this, arguments).apply(this, arguments)
+ }
+ }
});
\ No newline at end of file
diff --git a/muk_web_utils/static/src/js/services/notification_service.js b/muk_web_utils/static/src/js/services/notification_service.js
index 5e22029..8f5787e 100644
--- a/muk_web_utils/static/src/js/services/notification_service.js
+++ b/muk_web_utils/static/src/js/services/notification_service.js
@@ -1,19 +1,22 @@
/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
+* GNU Lesser General Public License for more details.
*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
*
**********************************************************************************/
diff --git a/muk_web_utils/static/src/js/views/form/renderer.js b/muk_web_utils/static/src/js/views/form/renderer.js
index 7236c80..496211a 100644
--- a/muk_web_utils/static/src/js/views/form/renderer.js
+++ b/muk_web_utils/static/src/js/views/form/renderer.js
@@ -1,44 +1,47 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-odoo.define('muk_web_utils.FormRenderer', function (require) {
-"use strict";
-
-var core = require('web.core');
-
-var FormRenderer = require('web.FormRenderer');
-
-var _t = core._t;
-var QWeb = core.qweb;
-
-FormRenderer.include({
- _updateView: function ($newContent) {
- this._super.apply(this, arguments);
- _.each(this.allFieldWidgets[this.state.id], function (widget) {
- if (widget.attrs.widget === 'module_boolean') {
- var inputID = this.idsForLabels[widget.name];
- var $widgets = this.$('.o_field_widget[name=' + widget.name + ']');
- var $label = inputID ? this.$('.o_form_label[for=' + inputID + ']') : $();
- widget.renderWithLabel($label.eq($widgets.index(widget.$el)));
- }
- }, this);
- }
-});
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+odoo.define('muk_web_utils.FormRenderer', function (require) {
+"use strict";
+
+var core = require('web.core');
+
+var FormRenderer = require('web.FormRenderer');
+
+var _t = core._t;
+var QWeb = core.qweb;
+
+FormRenderer.include({
+ _updateView: function ($newContent) {
+ this._super.apply(this, arguments);
+ _.each(this.allFieldWidgets[this.state.id], function (widget) {
+ if (widget.attrs.widget === 'module_boolean') {
+ var inputID = this.idsForLabels[widget.name];
+ var $widgets = this.$('.o_field_widget[name=' + widget.name + ']');
+ var $label = inputID ? this.$('.o_form_label[for=' + inputID + ']') : $();
+ widget.renderWithLabel($label.eq($widgets.index(widget.$el)));
+ }
+ }, this);
+ }
+});
+
});
\ No newline at end of file
diff --git a/muk_web_utils/static/src/js/widgets/notification.js b/muk_web_utils/static/src/js/widgets/notification.js
index 89a3938..b51b636 100644
--- a/muk_web_utils/static/src/js/widgets/notification.js
+++ b/muk_web_utils/static/src/js/widgets/notification.js
@@ -1,19 +1,22 @@
/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
*
* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
+* GNU Lesser General Public License for more details.
*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
*
**********************************************************************************/
diff --git a/muk_web_utils/static/src/scss/binary.scss b/muk_web_utils/static/src/scss/binary.scss
index 780f924..d4541e2 100644
--- a/muk_web_utils/static/src/scss/binary.scss
+++ b/muk_web_utils/static/src/scss/binary.scss
@@ -1,25 +1,28 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.o_list_view .o_field_widget.o_field_binary_file {
- height: 100%;
- button.btn {
- padding-top: 0.25rem;
- }
-}
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.o_list_view .o_field_widget.o_field_binary_file {
+ height: 100%;
+ button.btn {
+ padding-top: 0.25rem;
+ }
+}
diff --git a/muk_web_utils/static/src/scss/color.scss b/muk_web_utils/static/src/scss/color.scss
index 693e7ac..297f8f9 100644
--- a/muk_web_utils/static/src/scss/color.scss
+++ b/muk_web_utils/static/src/scss/color.scss
@@ -1,63 +1,66 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.mk_field_color_picker {
- .o_opacity_slider {
- display: none ! important;
- }
- input#opacity {
- display: none ! important;
- }
- label[for="opacity"] {
- display: none ! important;
- }
-}
-
-.o_field_widget.mk_field_color {
- .mk_field_color_input {
- width: auto;
- display: inline-block;
- }
- .mk_field_color_button {
- display: inline-block;
- margin-bottom: 0.25rem;
- line-height: 1.42rem;
- }
-}
-
-span.mk_field_color_index {
- @for $size from 1 through length($o-colors) {
- &.mk_color_index_#{$size - 1} {
- color: nth($o-colors, $size);
- }
- }
-}
-
-select.mk_field_color_index {
- &.mk_color_index_0, .mk_color_index_0 {
- background-color: $white ! important;
- color: nth($o-colors, 1) ! important;
- }
- @for $size from 2 through length($o-colors) {
- &.mk_color_index_#{$size - 1}, .mk_color_index_#{$size - 1} {
- background-color: nth($o-colors, $size) ! important;
- color: $white ! important;
- }
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.mk_field_color_picker {
+ .o_opacity_slider {
+ display: none ! important;
+ }
+ input#opacity {
+ display: none ! important;
+ }
+ label[for="opacity"] {
+ display: none ! important;
+ }
+}
+
+.o_field_widget.mk_field_color {
+ .mk_field_color_input {
+ width: auto;
+ display: inline-block;
+ }
+ .mk_field_color_button {
+ display: inline-block;
+ margin-bottom: 0.25rem;
+ line-height: 1.42rem;
+ }
+}
+
+span.mk_field_color_index {
+ @for $size from 1 through length($o-colors) {
+ &.mk_color_index_#{$size - 1} {
+ color: nth($o-colors, $size);
+ }
+ }
+}
+
+select.mk_field_color_index {
+ &.mk_color_index_0, .mk_color_index_0 {
+ background-color: $white ! important;
+ color: nth($o-colors, 1) ! important;
+ }
+ @for $size from 2 through length($o-colors) {
+ &.mk_color_index_#{$size - 1}, .mk_color_index_#{$size - 1} {
+ background-color: nth($o-colors, $size) ! important;
+ color: $white ! important;
+ }
+ }
}
\ No newline at end of file
diff --git a/muk_web_utils/static/src/scss/copy.scss b/muk_web_utils/static/src/scss/copy.scss
index 7daa798..ff67504 100644
--- a/muk_web_utils/static/src/scss/copy.scss
+++ b/muk_web_utils/static/src/scss/copy.scss
@@ -1,31 +1,34 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.o_field_widget.mk_field_copy {
- .mk_copy_binary {
- margin-left: 0.5rem;
- .mk_copy_button {
- font-size: 0.8rem;
- line-height: 0.5;
- border-radius: 0.2rem;
- margin-bottom: 0.12rem;
- padding: 0.25rem 0.4rem;
- }
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.o_field_widget.mk_field_copy {
+ .mk_copy_binary {
+ margin-left: 0.5rem;
+ .mk_copy_button {
+ font-size: 0.8rem;
+ line-height: 0.5;
+ border-radius: 0.2rem;
+ margin-bottom: 0.12rem;
+ padding: 0.25rem 0.4rem;
+ }
+ }
}
\ No newline at end of file
diff --git a/muk_web_utils/static/src/scss/dropzone.scss b/muk_web_utils/static/src/scss/dropzone.scss
index a4284c1..337ffbf 100644
--- a/muk_web_utils/static/src/scss/dropzone.scss
+++ b/muk_web_utils/static/src/scss/dropzone.scss
@@ -1,61 +1,64 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.mk_dropzone {
- position: relative;
- &:before {
- display:flex;
- z-index: 1052;
- color: gray('700');
- flex-direction:row;
- align-items: center;
- justify-content: center;
- width: #{"calc(100% - 20px)"};
- height: #{"calc(100% - 20px)"};
- border: 2px dashed gray('700');
- @include gradient-y($white, gray('100'));
- @include o-position-absolute(10px, 0, 0, 10px);
- }
- &:after {
- display:flex;
- z-index: 1052;
- color: gray('700');
- flex-direction:row;
- align-items: center;
- justify-content: center;
- width: #{"calc(100% - 20px)"};
- height: #{"calc(100% - 10px)"};
- @include o-position-absolute(0, 0, 0, 0);
- }
- &.mk_dropzone_file {
- &:before {
- font-family: FontAwesome;
- text-decoration: inherit;
- font-style: normal;
- font-weight: normal;
- font-size: 15rem;
- content: "\f0ee";
- }
- &:after {
- padding-top: 18rem;
- font-size: 3rem;
- content: attr(data-dropzone-text);
- }
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.mk_dropzone {
+ position: relative;
+ &:before {
+ display:flex;
+ z-index: 1052;
+ color: gray('700');
+ flex-direction:row;
+ align-items: center;
+ justify-content: center;
+ width: #{"calc(100% - 20px)"};
+ height: #{"calc(100% - 20px)"};
+ border: 2px dashed gray('700');
+ @include gradient-y($white, gray('100'));
+ @include o-position-absolute(10px, 0, 0, 10px);
+ }
+ &:after {
+ display:flex;
+ z-index: 1052;
+ color: gray('700');
+ flex-direction:row;
+ align-items: center;
+ justify-content: center;
+ width: #{"calc(100% - 20px)"};
+ height: #{"calc(100% - 10px)"};
+ @include o-position-absolute(0, 0, 0, 0);
+ }
+ &.mk_dropzone_file {
+ &:before {
+ font-family: FontAwesome;
+ text-decoration: inherit;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 15rem;
+ content: "\f0ee";
+ }
+ &:after {
+ padding-top: 18rem;
+ font-size: 3rem;
+ content: attr(data-dropzone-text);
+ }
+ }
}
\ No newline at end of file
diff --git a/muk_web_utils/static/src/scss/image.scss b/muk_web_utils/static/src/scss/image.scss
index ed1c334..e78e9a3 100644
--- a/muk_web_utils/static/src/scss/image.scss
+++ b/muk_web_utils/static/src/scss/image.scss
@@ -1,81 +1,84 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.o_field_widget.o_field_image {
- @include media-breakpoint-up(sm, $o-extra-grid-breakpoints) {
- .mk_field_image_wrapper {
- min-height: 60px;
- min-width: 80px;
- }
- }
- .mk_form_image_controls {
- @include o-position-absolute($left: 0, $bottom: 0);
- width: 100%;
- color: white;
- background-color: $o-brand-primary;
- opacity: 0;
- transition: opacity ease 400ms;
- > button.fa {
- border: none;
- background-color: transparent;
- }
- > .fa {
- margin: 5px;
- cursor: pointer;
- }
- }
- &:hover .mk_form_image_controls {
- opacity: 0.8;
- }
- @include media-breakpoint-down(xs, $o-extra-grid-breakpoints) {
- .mk_form_image_controls{
- position: initial;
- opacity: 1;
- > .fa{
- width: 50%;
- padding: 6px;
- margin: 0px;
- text-align: center;
- background: $o-brand-secondary;
- }
- }
- }
-}
-
-.o_field_widget.o_field_image.oe_avatar {
- .mk_form_image_controls {
- @include o-position-absolute($left: 0, $bottom: 10px);
- }
- img {
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
- max-width: $o-avatar-size;
- max-height: $o-avatar-size;
- vertical-align: top;
- margin-bottom: 10px;
- border: none;
- }
- @include media-breakpoint-down(xs, $o-extra-grid-breakpoints) {
- .mk_form_image_controls{
- position: initial;
- > .fa{
- background: $o-brand-secondary;
- }
- }
- }
-}
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.o_field_widget.o_field_image {
+ @include media-breakpoint-up(sm, $o-extra-grid-breakpoints) {
+ .mk_field_image_wrapper {
+ min-height: 60px;
+ min-width: 80px;
+ }
+ }
+ .mk_form_image_controls {
+ @include o-position-absolute($left: 0, $bottom: 0);
+ width: 100%;
+ color: white;
+ background-color: $o-brand-primary;
+ opacity: 0;
+ transition: opacity ease 400ms;
+ > button.fa {
+ border: none;
+ background-color: transparent;
+ }
+ > .fa {
+ margin: 5px;
+ cursor: pointer;
+ }
+ }
+ &:hover .mk_form_image_controls {
+ opacity: 0.8;
+ }
+ @include media-breakpoint-down(xs, $o-extra-grid-breakpoints) {
+ .mk_form_image_controls{
+ position: initial;
+ opacity: 1;
+ > .fa{
+ width: 50%;
+ padding: 6px;
+ margin: 0px;
+ text-align: center;
+ background: $o-brand-secondary;
+ }
+ }
+ }
+}
+
+.o_field_widget.o_field_image.oe_avatar {
+ .mk_form_image_controls {
+ @include o-position-absolute($left: 0, $bottom: 10px);
+ }
+ img {
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
+ max-width: $o-avatar-size;
+ max-height: $o-avatar-size;
+ vertical-align: top;
+ margin-bottom: 10px;
+ border: none;
+ }
+ @include media-breakpoint-down(xs, $o-extra-grid-breakpoints) {
+ .mk_form_image_controls{
+ position: initial;
+ > .fa{
+ background: $o-brand-secondary;
+ }
+ }
+ }
+}
diff --git a/muk_web_utils/static/src/scss/mixins.scss b/muk_web_utils/static/src/scss/mixins.scss
index d719f31..4c6e540 100644
--- a/muk_web_utils/static/src/scss/mixins.scss
+++ b/muk_web_utils/static/src/scss/mixins.scss
@@ -1,37 +1,40 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-@mixin mk-flex-container ($direction: row, $wrap: nowrap, $justify: flex-start, $items: stretch, $content: stretch) {
- display: flex;
- flex-wrap: $wrap;
- flex-direction: $direction;
- justify-content: $justify;
- align-content: $content;
- align-items: $items;
-}
-
-@mixin mk-flex-child ($grow: 0, $shrink: 1, $basis: auto, $order: 0) {
- display: flex;
- flex-grow: $grow;
- flex-shrink: $shrink;
- flex-basis: $basis;
- order: $order;
-}
-
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+@mixin mk-flex-container ($direction: row, $wrap: nowrap, $justify: flex-start, $items: stretch, $content: stretch) {
+ display: flex;
+ flex-wrap: $wrap;
+ flex-direction: $direction;
+ justify-content: $justify;
+ align-content: $content;
+ align-items: $items;
+}
+
+@mixin mk-flex-child ($grow: 0, $shrink: 1, $basis: auto, $order: 0) {
+ display: flex;
+ flex-grow: $grow;
+ flex-shrink: $shrink;
+ flex-basis: $basis;
+ order: $order;
+}
+
+
diff --git a/muk_web_utils/static/src/scss/module.scss b/muk_web_utils/static/src/scss/module.scss
index cde97f4..0a30d94 100644
--- a/muk_web_utils/static/src/scss/module.scss
+++ b/muk_web_utils/static/src/scss/module.scss
@@ -1,30 +1,33 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.o_settings_container {
- .o_setting_box {
- .o_setting_left_pane {
- .mk_module_label {
- position: absolute;
- top: 0px;
- right: 40px;
- }
- }
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.o_settings_container {
+ .o_setting_box {
+ .o_setting_left_pane {
+ .mk_module_label {
+ position: absolute;
+ top: 0px;
+ right: 40px;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/muk_web_utils/static/src/scss/notification.scss b/muk_web_utils/static/src/scss/notification.scss
index 9d43d60..4caf339 100644
--- a/muk_web_utils/static/src/scss/notification.scss
+++ b/muk_web_utils/static/src/scss/notification.scss
@@ -1,27 +1,30 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.o_notification {
- .mk_notification_progress {
- padding: 2px 10px 10px 10px;
- .progress {
- background-color: rgba(0, 0, 0, 0.3);
- }
- }
-}
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.o_notification {
+ .mk_notification_progress {
+ padding: 2px 10px 10px 10px;
+ .progress {
+ background-color: rgba(0, 0, 0, 0.3);
+ }
+ }
+}
diff --git a/muk_web_utils/static/src/scss/share.scss b/muk_web_utils/static/src/scss/share.scss
index 8342f0c..37fa64e 100644
--- a/muk_web_utils/static/src/scss/share.scss
+++ b/muk_web_utils/static/src/scss/share.scss
@@ -1,51 +1,54 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.o_field_widget.mk_field_share {
- &.o_field_copy {
- padding-left: 90px;
- .mk_share_dropdown {
- @include o-position-absolute($top: 0, $left: 0);
- .mk_share_button {
- padding: 0 10px;
- }
- &.mk_share_char {
- height: 100%;
-
- }
- &.mk_share_text {
- .dropdown-menu {
- line-height: 0.1
- }
- }
- }
- }
- &.o_form_uri {
- .mk_share_dropdown {
- margin-left: 0.2rem;
- .mk_share_button {
- padding: 0.25rem 0.4rem;
- font-size: 0.8rem;
- line-height: 0.5;
- border-radius: 0.2rem;
- margin-bottom: 0.12rem;
- }
- }
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.o_field_widget.mk_field_share {
+ &.o_field_copy {
+ padding-left: 90px;
+ .mk_share_dropdown {
+ @include o-position-absolute($top: 0, $left: 0);
+ .mk_share_button {
+ padding: 0 10px;
+ }
+ &.mk_share_char {
+ height: 100%;
+
+ }
+ &.mk_share_text {
+ .dropdown-menu {
+ line-height: 0.1
+ }
+ }
+ }
+ }
+ &.o_form_uri {
+ .mk_share_dropdown {
+ margin-left: 0.2rem;
+ .mk_share_button {
+ padding: 0.25rem 0.4rem;
+ font-size: 0.8rem;
+ line-height: 0.5;
+ border-radius: 0.2rem;
+ margin-bottom: 0.12rem;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/muk_web_utils/static/src/scss/switch.scss b/muk_web_utils/static/src/scss/switch.scss
index c76e4f1..7fe9d6e 100644
--- a/muk_web_utils/static/src/scss/switch.scss
+++ b/muk_web_utils/static/src/scss/switch.scss
@@ -1,155 +1,158 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-.switch {
- font-size: $font-size-base;
- position: relative;
-
- input {
- position: absolute;
- height: 1px;
- width: 1px;
- background: none;
- border: 0;
- clip: rect(0 0 0 0);
- clip-path: inset(50%);
- overflow: hidden;
- padding: 0;
-
- + label {
- position: relative;
- min-width: calc(#{$switch-height} * 2);
- border-radius: $switch-border-radius;
- height: $switch-height;
- line-height: $switch-height;
- display: inline-block;
- cursor: pointer;
- outline: none;
- user-select: none;
- vertical-align: middle;
- text-indent: calc(calc(#{$switch-height} * 2) + .5rem);
- }
-
- + label::before,
- + label::after {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- width: calc(#{$switch-height} * 2);
- bottom: 0;
- display: block;
- }
-
- + label::before {
- right: 0;
- background-color: $switch-bg;
- border-radius: $switch-border-radius;
- transition: $switch-transition;
- }
-
- + label::after {
- top: $switch-thumb-padding;
- left: $switch-thumb-padding;
- width: calc(#{$switch-height} - calc(#{$switch-thumb-padding} * 2));
- height: calc(#{$switch-height} - calc(#{$switch-thumb-padding} * 2));
- border-radius: $switch-thumb-border-radius;
- background-color: $switch-thumb-bg;
- transition: $switch-transition;
- }
-
- &:checked + label::before {
- background-color: $switch-checked-bg;
- }
-
- &:checked + label::after {
- margin-left: $switch-height;
- }
-
- &:focus + label::before {
- outline: none;
- box-shadow: $switch-focus-box-shadow;
- }
-
- &:disabled + label {
- color: $switch-disabled-color;
- cursor: not-allowed;
- }
-
- &:disabled + label::before {
- background-color: $switch-disabled-bg;
- }
- }
-
- &.switch-sm {
- font-size: $font-size-sm;
-
- input {
- + label {
- min-width: calc(#{$switch-height-sm} * 2);
- height: $switch-height-sm;
- line-height: $switch-height-sm;
- text-indent: calc(calc(#{$switch-height-sm} * 2) + .5rem);
- }
-
- + label::before {
- width: calc(#{$switch-height-sm} * 2);
- }
-
- + label::after {
- width: calc(#{$switch-height-sm} - calc(#{$switch-thumb-padding} * 2));
- height: calc(#{$switch-height-sm} - calc(#{$switch-thumb-padding} * 2));
- }
-
- &:checked + label::after {
- margin-left: $switch-height-sm;
- }
- }
- }
-
- &.switch-lg {
- font-size: $font-size-lg;
-
- input {
- + label {
- min-width: calc(#{$switch-height-lg} * 2);
- height: $switch-height-lg;
- line-height: $switch-height-lg;
- text-indent: calc(calc(#{$switch-height-lg} * 2) + .5rem);
- }
-
- + label::before {
- width: calc(#{$switch-height-lg} * 2);
- }
-
- + label::after {
- width: calc(#{$switch-height-lg} - calc(#{$switch-thumb-padding} * 2));
- height: calc(#{$switch-height-lg} - calc(#{$switch-thumb-padding} * 2));
- }
-
- &:checked + label::after {
- margin-left: $switch-height-lg;
- }
- }
- }
-
- + .switch {
- margin-left: 1rem;
- }
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+.switch {
+ font-size: $font-size-base;
+ position: relative;
+
+ input {
+ position: absolute;
+ height: 1px;
+ width: 1px;
+ background: none;
+ border: 0;
+ clip: rect(0 0 0 0);
+ clip-path: inset(50%);
+ overflow: hidden;
+ padding: 0;
+
+ + label {
+ position: relative;
+ min-width: calc(#{$switch-height} * 2);
+ border-radius: $switch-border-radius;
+ height: $switch-height;
+ line-height: $switch-height;
+ display: inline-block;
+ cursor: pointer;
+ outline: none;
+ user-select: none;
+ vertical-align: middle;
+ text-indent: calc(calc(#{$switch-height} * 2) + .5rem);
+ }
+
+ + label::before,
+ + label::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: calc(#{$switch-height} * 2);
+ bottom: 0;
+ display: block;
+ }
+
+ + label::before {
+ right: 0;
+ background-color: $switch-bg;
+ border-radius: $switch-border-radius;
+ transition: $switch-transition;
+ }
+
+ + label::after {
+ top: $switch-thumb-padding;
+ left: $switch-thumb-padding;
+ width: calc(#{$switch-height} - calc(#{$switch-thumb-padding} * 2));
+ height: calc(#{$switch-height} - calc(#{$switch-thumb-padding} * 2));
+ border-radius: $switch-thumb-border-radius;
+ background-color: $switch-thumb-bg;
+ transition: $switch-transition;
+ }
+
+ &:checked + label::before {
+ background-color: $switch-checked-bg;
+ }
+
+ &:checked + label::after {
+ margin-left: $switch-height;
+ }
+
+ &:focus + label::before {
+ outline: none;
+ box-shadow: $switch-focus-box-shadow;
+ }
+
+ &:disabled + label {
+ color: $switch-disabled-color;
+ cursor: not-allowed;
+ }
+
+ &:disabled + label::before {
+ background-color: $switch-disabled-bg;
+ }
+ }
+
+ &.switch-sm {
+ font-size: $font-size-sm;
+
+ input {
+ + label {
+ min-width: calc(#{$switch-height-sm} * 2);
+ height: $switch-height-sm;
+ line-height: $switch-height-sm;
+ text-indent: calc(calc(#{$switch-height-sm} * 2) + .5rem);
+ }
+
+ + label::before {
+ width: calc(#{$switch-height-sm} * 2);
+ }
+
+ + label::after {
+ width: calc(#{$switch-height-sm} - calc(#{$switch-thumb-padding} * 2));
+ height: calc(#{$switch-height-sm} - calc(#{$switch-thumb-padding} * 2));
+ }
+
+ &:checked + label::after {
+ margin-left: $switch-height-sm;
+ }
+ }
+ }
+
+ &.switch-lg {
+ font-size: $font-size-lg;
+
+ input {
+ + label {
+ min-width: calc(#{$switch-height-lg} * 2);
+ height: $switch-height-lg;
+ line-height: $switch-height-lg;
+ text-indent: calc(calc(#{$switch-height-lg} * 2) + .5rem);
+ }
+
+ + label::before {
+ width: calc(#{$switch-height-lg} * 2);
+ }
+
+ + label::after {
+ width: calc(#{$switch-height-lg} - calc(#{$switch-thumb-padding} * 2));
+ height: calc(#{$switch-height-lg} - calc(#{$switch-thumb-padding} * 2));
+ }
+
+ &:checked + label::after {
+ margin-left: $switch-height-lg;
+ }
+ }
+ }
+
+ + .switch {
+ margin-left: 1rem;
+ }
}
\ No newline at end of file
diff --git a/muk_web_utils/static/src/scss/variables.scss b/muk_web_utils/static/src/scss/variables.scss
index 6a4a5e9..74fa8ca 100644
--- a/muk_web_utils/static/src/scss/variables.scss
+++ b/muk_web_utils/static/src/scss/variables.scss
@@ -1,36 +1,39 @@
-/**********************************************************************************
-*
-* Copyright (C) 2017 MuK IT GmbH
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*
-**********************************************************************************/
-
-//----------------------------------------------------------
-// Switch
-//----------------------------------------------------------
-
-$switch-bg: #dee2e6;
-$switch-disabled-bg: #e9ecef;
-$switch-disabled-color: #868e96;
-$switch-height: calc(#{$input-height} * .8) !default;
-$switch-height-sm: calc(#{$input-height-sm} * .8) !default;
-$switch-height-lg: calc(#{$input-height-lg} * .8) !default;
-$switch-checked-bg: map-get($theme-colors, 'primary') !default;
-$switch-thumb-bg: $white !default;
-$switch-thumb-border-radius: 50% !default;
-$switch-thumb-padding: 2px !default;
-$switch-transition: .2s all !default;
-$switch-border-radius: $switch-height;
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+
+//----------------------------------------------------------
+// Switch
+//----------------------------------------------------------
+
+$switch-bg: #dee2e6;
+$switch-disabled-bg: #e9ecef;
+$switch-disabled-color: #868e96;
+$switch-height: calc(#{$input-height} * .8) !default;
+$switch-height-sm: calc(#{$input-height-sm} * .8) !default;
+$switch-height-lg: calc(#{$input-height-lg} * .8) !default;
+$switch-checked-bg: map-get($theme-colors, 'primary') !default;
+$switch-thumb-bg: $white !default;
+$switch-thumb-border-radius: 50% !default;
+$switch-thumb-padding: 2px !default;
+$switch-transition: .2s all !default;
+$switch-border-radius: $switch-height;
$switch-focus-box-shadow: 0 0 0 $input-btn-focus-width rgba(map-get($theme-colors, 'primary'), .25);
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/color.xml b/muk_web_utils/static/src/xml/color.xml
index 26e38e8..ecbc10d 100644
--- a/muk_web_utils/static/src/xml/color.xml
+++ b/muk_web_utils/static/src/xml/color.xml
@@ -1,60 +1,65 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/copy.xml b/muk_web_utils/static/src/xml/copy.xml
index 97ff3f7..4a21900 100644
--- a/muk_web_utils/static/src/xml/copy.xml
+++ b/muk_web_utils/static/src/xml/copy.xml
@@ -1,30 +1,35 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/image.xml b/muk_web_utils/static/src/xml/image.xml
index ec5d8e9..824c3af 100644
--- a/muk_web_utils/static/src/xml/image.xml
+++ b/muk_web_utils/static/src/xml/image.xml
@@ -1,29 +1,34 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/module.xml b/muk_web_utils/static/src/xml/module.xml
index b163902..0709de4 100644
--- a/muk_web_utils/static/src/xml/module.xml
+++ b/muk_web_utils/static/src/xml/module.xml
@@ -1,34 +1,39 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
The module could not be found on the server.
-
Click on the download button to be redirected to the store and download the corresponding module.
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
The module could not be found on the server.
+
Click on the download button to be redirected to the store and download the corresponding module.
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/notification.xml b/muk_web_utils/static/src/xml/notification.xml
index 4d6a79d..2ed595a 100644
--- a/muk_web_utils/static/src/xml/notification.xml
+++ b/muk_web_utils/static/src/xml/notification.xml
@@ -1,34 +1,39 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/share.xml b/muk_web_utils/static/src/xml/share.xml
index e080565..64bcee4 100644
--- a/muk_web_utils/static/src/xml/share.xml
+++ b/muk_web_utils/static/src/xml/share.xml
@@ -1,101 +1,106 @@
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/src/xml/switch.xml b/muk_web_utils/static/src/xml/switch.xml
index 1341ab2..cb9e742 100644
--- a/muk_web_utils/static/src/xml/switch.xml
+++ b/muk_web_utils/static/src/xml/switch.xml
@@ -1,49 +1,54 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/static/tests/fields.js b/muk_web_utils/static/tests/fields.js
index 8b69a30..6af0e6f 100644
--- a/muk_web_utils/static/tests/fields.js
+++ b/muk_web_utils/static/tests/fields.js
@@ -1,184 +1,205 @@
-odoo.define('muk_web_utils.tests.fields', function (require) {
-"use strict";
-
-var basicFields = require('web.basic_fields');
-var concurrency = require('web.concurrency');
-var config = require('web.config');
-var core = require('web.core');
-var FormView = require('web.FormView');
-var KanbanView = require('web.KanbanView');
-var ListView = require('web.ListView');
-var session = require('web.session');
-var testUtils = require('web.test_utils');
-var field_registry = require('web.field_registry');
-
-var createView = testUtils.createView;
-var createAsyncView = testUtils.createAsyncView;
-var DebouncedField = basicFields.DebouncedField;
-var JournalDashboardGraph = basicFields.JournalDashboardGraph;
-var _t = core._t;
-
-QUnit.module('muk_web_utils', {}, function () {
-
-QUnit.module('fields', {
- beforeEach: function () {
- this.data = {
- partner: {
- fields: {
- display_name: {
- string: "Displayed name",
- type: "char",
- searchable: true
- },
- short: {
- string: "Short",
- type: "char",
- searchable: true,
- trim: true
- },
- long: {
- string: "Long",
- string: "txt",
- type: "text",
- },
- document: {
- string: "Binary",
- type: "binary",
- attachment: true,
- },
- },
- records: [{
- id: 1,
- display_name: "first record",
- short: "Short Text",
- long: "Super looooooong Text",
- document: 'coucou==\n',
- }],
- },
- };
- }
-}, function () {
- QUnit.module('BinaryFileCopy');
-
- QUnit.test('Fields is correctly rendered', function (assert) {
- assert.expect(2);
-
- var form = createView({
- View: FormView,
- model: 'partner',
- data: this.data,
- arch: (
- ''
- ),
- res_id: 1,
- });
-
- assert.strictEqual(
- form.$('a.o_field_widget[name="document"] > .mk_copy_binary > .mk_copy_button').length,
- 1, "the copy button should be visible in readonly mode"
- );
-
- form.$buttons.find('.o_form_button_edit').click();
-
- assert.strictEqual(
- form.$('a.o_field_widget[name="document"] > .mk_copy_binary').length,
- 0, "the copy button shouldn't be visible in edit mode"
- );
-
- form.destroy();
- });
-
- QUnit.module('CharShare');
-
- QUnit.test('Fields is correctly rendered', function (assert) {
- assert.expect(1);
-
- var form = createView({
- View: FormView,
- model: 'partner',
- data: this.data,
- arch: (
- ''
- ),
- res_id: 1,
- });
-
- assert.strictEqual(
- form.$('span.o_field_widget[name="short"] > .mk_share_dropdown.mk_share_char').length,
- 1, "the copy button should be visible in readonly mode"
- );
-
- form.destroy();
- });
-
- QUnit.module('TextShare');
-
- QUnit.test('Fields is correctly rendered', function (assert) {
- assert.expect(1);
-
- var form = createView({
- View: FormView,
- model: 'partner',
- data: this.data,
- arch: (
- ''
- ),
- res_id: 1,
- });
-
- assert.strictEqual(
- form.$('span.o_field_widget[name="long"] > .mk_share_dropdown.mk_share_text').length,
- 1, "the copy button should be visible in readonly mode"
- );
-
- form.destroy();
- });
-
- QUnit.module('BinaryFileShare');
-
- QUnit.test('Fields is correctly rendered', function (assert) {
- assert.expect(2);
-
- var form = createView({
- View: FormView,
- model: 'partner',
- data: this.data,
- arch: (
- ''
- ),
- res_id: 1,
- });
-
- assert.strictEqual(
- form.$('a.o_field_widget[name="document"] > .mk_share_dropdown > .mk_share_button').length,
- 1, "the share dropdown should be visible in readonly mode"
- );
-
- form.$buttons.find('.o_form_button_edit').click();
-
- assert.strictEqual(
- form.$('a.o_field_widget[name="document"] > .mk_share_dropdown > .mk_share_button').length,
- 0, "the share dropdown shouldn't be visible in edit mode"
- );
-
- form.destroy();
- });
-});
-
-});
-
+/**********************************************************************************
+*
+* Copyright (c) 2017-2019 MuK IT GmbH.
+*
+* This file is part of MuK Web Utils
+* (see https://mukit.at).
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program. If not, see .
+*
+**********************************************************************************/
+odoo.define('muk_web_utils.tests.fields', function (require) {
+"use strict";
+
+var basicFields = require('web.basic_fields');
+var concurrency = require('web.concurrency');
+var config = require('web.config');
+var core = require('web.core');
+var FormView = require('web.FormView');
+var KanbanView = require('web.KanbanView');
+var ListView = require('web.ListView');
+var session = require('web.session');
+var testUtils = require('web.test_utils');
+var field_registry = require('web.field_registry');
+
+var createView = testUtils.createView;
+var createAsyncView = testUtils.createAsyncView;
+var DebouncedField = basicFields.DebouncedField;
+var JournalDashboardGraph = basicFields.JournalDashboardGraph;
+var _t = core._t;
+
+QUnit.module('muk_web_utils', {}, function () {
+
+QUnit.module('fields', {
+ beforeEach: function () {
+ this.data = {
+ partner: {
+ fields: {
+ display_name: {
+ string: "Displayed name",
+ type: "char",
+ searchable: true
+ },
+ short: {
+ string: "Short",
+ type: "char",
+ searchable: true,
+ trim: true
+ },
+ long: {
+ string: "Long",
+ string: "txt",
+ type: "text",
+ },
+ document: {
+ string: "Binary",
+ type: "binary",
+ attachment: true,
+ },
+ },
+ records: [{
+ id: 1,
+ display_name: "first record",
+ short: "Short Text",
+ long: "Super looooooong Text",
+ document: 'coucou==\n',
+ }],
+ },
+ };
+ }
+}, function () {
+ QUnit.module('BinaryFileCopy');
+
+ QUnit.test('Fields is correctly rendered', function (assert) {
+ assert.expect(2);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: (
+ ''
+ ),
+ res_id: 1,
+ });
+
+ assert.strictEqual(
+ form.$('a.o_field_widget[name="document"] > .mk_copy_binary > .mk_copy_button').length,
+ 1, "the copy button should be visible in readonly mode"
+ );
+
+ form.$buttons.find('.o_form_button_edit').click();
+
+ assert.strictEqual(
+ form.$('a.o_field_widget[name="document"] > .mk_copy_binary').length,
+ 0, "the copy button shouldn't be visible in edit mode"
+ );
+
+ form.destroy();
+ });
+
+ QUnit.module('CharShare');
+
+ QUnit.test('Fields is correctly rendered', function (assert) {
+ assert.expect(1);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: (
+ ''
+ ),
+ res_id: 1,
+ });
+
+ assert.strictEqual(
+ form.$('span.o_field_widget[name="short"] > .mk_share_dropdown.mk_share_char').length,
+ 1, "the copy button should be visible in readonly mode"
+ );
+
+ form.destroy();
+ });
+
+ QUnit.module('TextShare');
+
+ QUnit.test('Fields is correctly rendered', function (assert) {
+ assert.expect(1);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: (
+ ''
+ ),
+ res_id: 1,
+ });
+
+ assert.strictEqual(
+ form.$('span.o_field_widget[name="long"] > .mk_share_dropdown.mk_share_text').length,
+ 1, "the copy button should be visible in readonly mode"
+ );
+
+ form.destroy();
+ });
+
+ QUnit.module('BinaryFileShare');
+
+ QUnit.test('Fields is correctly rendered', function (assert) {
+ assert.expect(2);
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: (
+ ''
+ ),
+ res_id: 1,
+ });
+
+ assert.strictEqual(
+ form.$('a.o_field_widget[name="document"] > .mk_share_dropdown > .mk_share_button').length,
+ 1, "the share dropdown should be visible in readonly mode"
+ );
+
+ form.$buttons.find('.o_form_button_edit').click();
+
+ assert.strictEqual(
+ form.$('a.o_field_widget[name="document"] > .mk_share_dropdown > .mk_share_button').length,
+ 0, "the share dropdown shouldn't be visible in edit mode"
+ );
+
+ form.destroy();
+ });
+});
+
+});
+
});
\ No newline at end of file
diff --git a/muk_web_utils/template/assets.xml b/muk_web_utils/template/assets.xml
index 0ae74d1..a74abcd 100644
--- a/muk_web_utils/template/assets.xml
+++ b/muk_web_utils/template/assets.xml
@@ -1,73 +1,78 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/muk_web_utils/tests/__init__.py b/muk_web_utils/tests/__init__.py
index 1a6eaf7..0c50c4c 100644
--- a/muk_web_utils/tests/__init__.py
+++ b/muk_web_utils/tests/__init__.py
@@ -1,19 +1,22 @@
###################################################################################
#
-# Copyright (C) 2018 MuK IT GmbH
+# Copyright (c) 2017-2019 MuK IT GmbH.
+#
+# This file is part of MuK Web Utils
+# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see .
#
###################################################################################
diff --git a/muk_web_utils/tests/test_js.py b/muk_web_utils/tests/test_js.py
index cbad597..39266f6 100644
--- a/muk_web_utils/tests/test_js.py
+++ b/muk_web_utils/tests/test_js.py
@@ -1,19 +1,22 @@
###################################################################################
#
-# Copyright (C) 2018 MuK IT GmbH
+# Copyright (c) 2017-2019 MuK IT GmbH.
+#
+# This file is part of MuK Web Utils
+# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
+# GNU Lesser General Public License for more details.
#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see .
#
###################################################################################
diff --git a/muk_web_utils/views/res_config_settings_view.xml b/muk_web_utils/views/res_config_settings_view.xml
index 2e3526f..e9ea79e 100644
--- a/muk_web_utils/views/res_config_settings_view.xml
+++ b/muk_web_utils/views/res_config_settings_view.xml
@@ -1,44 +1,49 @@
-
-
-
-
-
-
-
- res.config.settings.view.form
- res.config.settings
-
-
-