Browse Source

publish muk_web_utils - 12.0

pull/62/head
MuK IT GmbH 6 years ago
parent
commit
d067015d2e
  1. 2
      muk_web_utils/__manifest__.py
  2. 20
      muk_web_utils/static/src/js/fields/binary.js
  3. 13
      muk_web_utils/static/src/js/fields/image.js
  4. 2
      muk_web_utils/static/src/scss/image.scss
  5. 136
      muk_web_utils/template/assets.xml

2
muk_web_utils/__manifest__.py

@ -20,7 +20,7 @@
{ {
"name": "MuK Web Utils", "name": "MuK Web Utils",
"summary": """Utility Features""", "summary": """Utility Features""",
"version": "12.0.2.8.13",
"version": "12.0.2.8.15",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"author": "MuK IT", "author": "MuK IT",

20
muk_web_utils/static/src/js/fields/binary.js

@ -38,16 +38,16 @@ fields.FieldBinaryFile.include({
}.bind(this)); }.bind(this));
return this._super.apply(this, arguments); return this._super.apply(this, arguments);
}, },
});
fields.FieldBinaryImage.include({
willStart: function () {
var def = this._rpc({
route: '/params/muk_web_utils.binary_max_size',
}).done(function(result) {
this.max_upload_size = result.max_upload_size * 1024 * 1024;
}.bind(this));
return this._super.apply(this, arguments);
_renderReadonly: function () {
this._super.apply(this, arguments);
var $wrapper = $('<div/>', {
class: "mk_field_binary_wrapper"
});
$wrapper.addClass(this.$el.attr('class'));
this.$el.removeClass("o_field_widget");
this.$el.removeClass("o_hidden");
$wrapper.append(this.$el);
this.setElement($wrapper);
}, },
}); });

13
muk_web_utils/static/src/js/fields/image.js

@ -44,13 +44,20 @@ var _t = core._t;
var QWeb = core.qweb; var QWeb = core.qweb;
fields.FieldBinaryImage.include({ fields.FieldBinaryImage.include({
willStart: function () {
var def = this._rpc({
route: '/params/muk_web_utils.binary_max_size',
}).done(function(result) {
this.max_upload_size = result.max_upload_size * 1024 * 1024;
}.bind(this));
return this._super.apply(this, arguments);
},
_render: function () { _render: function () {
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.$('.mk_form_image_wrapper').remove();
this.$('img').wrap($('<div/>', { this.$('img').wrap($('<div/>', {
class: "mk_form_image_wrapper"
class: "mk_field_image_wrapper"
})); }));
var $wrapper = $('.mk_form_image_wrapper');
var $wrapper = $('.mk_field_image_wrapper');
var width = this.nodeOptions.size ? var width = this.nodeOptions.size ?
this.nodeOptions.size[0] : this.attrs.width; this.nodeOptions.size[0] : this.attrs.width;
var height = this.nodeOptions.size ? var height = this.nodeOptions.size ?

2
muk_web_utils/static/src/scss/image.scss

@ -19,7 +19,7 @@
.o_field_widget.o_field_image { .o_field_widget.o_field_image {
@include media-breakpoint-up(sm, $o-extra-grid-breakpoints) { @include media-breakpoint-up(sm, $o-extra-grid-breakpoints) {
.mk_form_image_wrapper {
.mk_field_image_wrapper {
min-height: 60px; min-height: 60px;
min-width: 80px; min-width: 80px;
} }

136
muk_web_utils/template/assets.xml

@ -1,69 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<template id="assets_backend" name="Backend Assets" inherit_id="web.assets_backend">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/css" href="/muk_web_utils/static/libs/simplebar/simplebar.css" />
</xpath>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/muk_web_utils/static/libs/simplebar/simplebar.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/libs/jquery.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/libs/scrollbar.js" />
</xpath>
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/variables.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/mixins.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/switch.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/dropzone.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/module.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/color.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/image.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/copy.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/share.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/notification.scss" />
</xpath>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/utils.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/async.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/files.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/dropzone.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/dialog.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/services/notification_service.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/widgets/notification.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/utils.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/color.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/image.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/copy.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/share.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/path.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/binary.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/module.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/views/form/renderer.js" />
</xpath>
</template>
<template id="qunit_suite" name="QUnit Assets" inherit_id="web.qunit_suite">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/muk_web_utils/static/tests/fields.js" />
</xpath>
</template>
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 <http://www.gnu.org/licenses/>.
-->
<odoo>
<template id="assets_backend" name="Backend Assets" inherit_id="web.assets_backend">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/css" href="/muk_web_utils/static/libs/simplebar/simplebar.css" />
</xpath>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/muk_web_utils/static/libs/simplebar/simplebar.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/libs/jquery.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/libs/scrollbar.js" />
</xpath>
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/variables.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/mixins.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/switch.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/dropzone.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/module.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/color.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/image.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/copy.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/share.scss" />
<link rel="stylesheet" type="text/scss" href="/muk_web_utils/static/src/scss/notification.scss" />
</xpath>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/utils.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/async.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/files.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/dropzone.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/core/dialog.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/services/notification_service.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/widgets/notification.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/utils.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/color.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/image.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/copy.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/share.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/path.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/binary.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/fields/module.js" />
<script type="text/javascript" src="/muk_web_utils/static/src/js/views/form/renderer.js" />
</xpath>
</template>
<template id="qunit_suite" name="QUnit Assets" inherit_id="web.qunit_suite">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/muk_web_utils/static/tests/fields.js" />
</xpath>
</template>
</odoo> </odoo>
Loading…
Cancel
Save