diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1bc2005..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: python - -python: - - "3.6" - -notifications: - email: false - -sudo: false -cache: pip - -addons: - postgresql: "9.6" - apt: - packages: - - expect-dev - - python3-lxml - - python3-simplejson - - python3-serial - -env: - global: - - VERSION="13.0" TESTS="1" LINT_CHECK="0" - matrix: - - TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1" - -install: - - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - - travis_install_nightly - -script: - - travis_run_tests - -after_success: - - travis_after_tests_success diff --git a/README.md b/README.md index f1a10cc..e9cc959 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ [![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0) -[![Build Status](https://travis-ci.org/muk-it/muk_web.svg?branch=13.0)](https://travis-ci.org/muk-it/muk_web) -[![codecov](https://codecov.io/gh/muk-it/muk_web/branch/13.0/graph/badge.svg)](https://codecov.io/gh/muk-it/muk_web) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/eff47569926c435d98a3187623615bc4)](https://www.codacy.com/app/keshrath/muk_web?utm_source=github.com&utm_medium=referral&utm_content=muk-it/muk_web&utm_campaign=Badge_Grade) -[![Weblate](https://weblate.mukit.at/widgets/web-13/-/svg-badge.svg)](https://weblate.mukit.at/projects/web-13/) -[![Demo](https://img.shields.io/badge/demo-Try%20me-243742.svg)](https://mukit.at/r/SgN) +[![Nexus](https://img.shields.io/badge/Nexus-Install%20me-5d8da8.svg)](https://nexus.mukit.at/#browse/browse:odoo) +[![Weblate](https://img.shields.io/badge/Weblate-Translate%20me-0094E9.svg)](https://weblate.mukit.at) +[![Website](https://img.shields.io/badge/Website-Open%20me-243742.svg)](https://mukit.at/) # MuK Odoo Web Modules @@ -36,7 +34,7 @@ underscores are replaced by a dash. **Example:** -`sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo11-addon-muk-utils` +`sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo13-addon-muk-utils` Once the installation has been successfully completed, the app is already in the correct folder. Log on to your Odoo server and go to the diff --git a/muk_web_theme/.gitignore b/muk_web_theme/.gitignore new file mode 100644 index 0000000..d18179b --- /dev/null +++ b/muk_web_theme/.gitignore @@ -0,0 +1,51 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +bin/ +develop-eggs/ +dist/ +eggs/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +*.eggs + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Pycharm +.idea + +# Eclipse +.project +.pydevproject +.settings/ + +# Rope +.ropeproject + +# Sphinx documentation +docs/_build/ + +# Backup files +*~ +*.swp \ No newline at end of file diff --git a/muk_web_theme/README.rst b/muk_web_theme/README.rst deleted file mode 100644 index 1955512..0000000 --- a/muk_web_theme/README.rst +++ /dev/null @@ -1,124 +0,0 @@ -============= -MuK Web Theme -============= - -This module offers a mobile compatible design for Odoo Community. Furthermore -it allows the user to define some design preferences. So he can choose the -size of the sidebar and the position of the chatter. In addition, the background -image of the app menu can be set for each company. - -Installation -============ - -To install this module, you need to: - -Download the module and add it to your Odoo addons folder. Afterward, log on to -your Odoo server and go to the Apps menu. Trigger the debug mode and update the -list by clicking on the "Update Apps List" link. Now install the module by -clicking on the install button. - -Another way to install this module is via the package management for Python -(`PyPI `_). - -To install our modules using the package manager make sure -`odoo-autodiscover `_ is installed -correctly. Then open a console and install the module by entering the following -command: - -``pip install --extra-index-url https://nexus.mukit.at/repository/odoo/simple `` - -The module name consists of the Odoo version and the module name, where -underscores are replaced by a dash. - -**Module:** - -``odoo-addon-`` - -**Example:** - -``sudo -H pip3 install --extra-index-url https://nexus.mukit.at/repository/odoo/simple odoo11-addon-muk-utils`` - -Once the installation has been successfully completed, the app is already in the -correct folder. Log on to your Odoo server and go to the Apps menu. Trigger the -debug mode and update the list by clicking on the "Update Apps List" link. Now -install the module by clicking on the install button. - -The biggest advantage of this variant is that you can now also update the app -using the "pip" command. To do this, enter the following command in your console: - -``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple `` - -When the process is finished, restart your server and update the application in -Odoo. The steps are the same as for the installation only the button has changed -from "Install" to "Upgrade". - -You can also view available Apps directly in our `repository `_ -and find a more detailed installation guide on our `website `_. - -For modules licensed under OPL-1, you will receive access data when you purchase -the module. If the modules were not purchased directly from -`MuK IT `_ please contact our support (support@mukit.at) -with a confirmation of purchase to receive the corresponding access data. - -Upgrade -============ - -To upgrade this module, you need to: - -Download the module and add it to your Odoo addons folder. Restart the server -and log on to your Odoo server. Select the Apps menu and upgrade the module by -clicking on the upgrade button. - -If you installed the module using the "pip" command, you can also update the -module in the same way. Just type the following command into the console: - -``pip install --upgrade --extra-index-url https://nexus.mukit.at/repository/odoo/simple `` - -When the process is finished, restart your server and update the application in -Odoo, just like you would normally. - -Configuration -============= - -No additional configuration is needed to use this module. - -Usage -============= - -After the module is installed, the design is adjusted accordingly. - -Credits -======= - -Contributors ------------- - -* Mathias Markl - -Images ------------- - -Some pictures are based on or inspired by: - -* `Freepik `_ - -Projects ------------- - -Parts of the module are inspired by: - -* `Web Responsive `_ -* `List Range Selection `_ -* `Openworx Backend Theme `_ - -Author & Maintainer -------------------- - -This module is maintained by the `MuK IT GmbH `_. - -MuK IT is an Austrian company specialized in customizing and extending Odoo. -We develop custom solutions for your individual needs to help you focus on -your strength and expertise to grow your business. - -If you want to get in touch please contact us via mail -(sale@mukit.at) or visit our website (https://mukit.at). diff --git a/muk_web_theme/__init__.py b/muk_web_theme/__init__.py index 2fe7983..0bb5ee6 100644 --- a/muk_web_theme/__init__.py +++ b/muk_web_theme/__init__.py @@ -1,8 +1,8 @@ ################################################################################### # -# Copyright (c) 2017-2019 MuK IT GmbH. +# Copyright (c) 2017-today MuK IT GmbH. # -# This file is part of MuK Backend Theme +# This file is part of MuK Grid Snippets # (see https://mukit.at). # # This program is free software: you can redistribute it and/or modify @@ -24,14 +24,10 @@ from odoo import api, SUPERUSER_ID from . import models -#---------------------------------------------------------- -# Hooks -#---------------------------------------------------------- - - XML_ID = "muk_web_theme._assets_primary_variables" SCSS_URL = "/muk_web_theme/static/src/scss/colors.scss" + def _uninstall_reset_changes(cr, registry): env = api.Environment(cr, SUPERUSER_ID, {}) - env['muk_utils.scss_editor'].reset_values(SCSS_URL, XML_ID) \ No newline at end of file + env['muk_web_theme.scss_editor'].reset_values(SCSS_URL, XML_ID) diff --git a/muk_web_theme/__manifest__.py b/muk_web_theme/__manifest__.py index 7af1005..398406c 100644 --- a/muk_web_theme/__manifest__.py +++ b/muk_web_theme/__manifest__.py @@ -1,63 +1,64 @@ -################################################################################### -# -# Copyright (c) 2017-2019 MuK IT GmbH. -# -# This file is part of MuK Backend Theme -# (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 . -# -################################################################################### -{ - "name": "MuK Backend Theme", - "summary": "Odoo Community Backend Theme", - "version": "13.0.1.0.6", - "category": "Themes/Backend", - "license": "LGPL-3", - "author": "MuK IT", - "website": "http://www.mukit.at", - 'live_test_url': 'https://mukit.at/r/SgN', - "contributors": [ - "Mathias Markl ", - "Benedikt Jilek ", - ], - "depends": [ - "muk_web_utils", - ], - "excludes": [ - "web_enterprise", - ], - "data": [ - "template/assets.xml", - "template/web.xml", - "views/res_users.xml", - "views/res_config_settings_view.xml", - "data/res_company.xml", - ], - "qweb": [ - "static/src/xml/*.xml", - ], - "images": [ - 'static/description/banner.png', - 'static/description/theme_screenshot.png' - ], - "external_dependencies": { - "python": [], - "bin": [], - }, - "application": False, - "installable": True, - "auto_install": False, - "uninstall_hook": "_uninstall_reset_changes", -} +################################################################################### +# +# Copyright (c) 2017-today MuK IT GmbH. +# +# This file is part of MuK Grid Snippets +# (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 . +# +################################################################################### + +{ + "name": "MuK Backend Theme", + "summary": "Odoo Community Backend Theme", + "version": "14.0.1.0.0", + "category": "Themes/Backend", + "license": "LGPL-3", + "author": "MuK IT", + "website": "http://www.mukit.at", + 'live_test_url': 'https://mukit.at/r/SgN', + "contributors": [ + "Mathias Markl ", + ], + "depends": [ + "web_editor", + ], + "excludes": [ + "web_enterprise", + ], + "data": [ + "template/assets.xml", + "template/web.xml", + "views/res_users.xml", + "views/res_config_settings_view.xml", + "data/res_company.xml", + ], + "qweb": [ + "static/src/components/control_panel.xml", + "static/src/xml/*.xml", + ], + "images": [ + 'static/description/banner.png', + 'static/description/theme_screenshot.png' + ], + "external_dependencies": { + "python": [], + "bin": [], + }, + "application": False, + "installable": True, + "auto_install": False, + "uninstall_hook": "_uninstall_reset_changes", +} diff --git a/muk_web_theme/data/res_company.xml b/muk_web_theme/data/res_company.xml index 2d1a17e..36d9f3c 100644 --- a/muk_web_theme/data/res_company.xml +++ b/muk_web_theme/data/res_company.xml @@ -2,9 +2,9 @@ + + + + + + + + + + diff --git a/muk_web_theme/static/src/js/chrome/actions.js b/muk_web_theme/static/src/js/chrome/actions.js index a02d23f..37b3c45 100644 --- a/muk_web_theme/static/src/js/chrome/actions.js +++ b/muk_web_theme/static/src/js/chrome/actions.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -21,30 +21,19 @@ **********************************************************************************/ odoo.define('muk_web_theme.ActionManager', function (require) { - "use strict"; +"use strict"; - var rpc = require('web.rpc'); - var session = require('web.session'); - var ActionManager = require('web.ActionManager'); +const ActionManager = require('web.ActionManager'); - rpc.query({ - model: 'res.users', - method: 'search_read', - args: [[['id', '=', session.uid]], ['chatter_position']] - }).then(function (pos) { - var position = pos[0]['chatter_position']; - var clsNames = 'o_action_manager mk_chatter_position_' + position; - ActionManager.include({ - className: clsNames, +ActionManager.include({ + _handleAction(action) { + return this._super(...arguments).then($.proxy(this, '_hideMenusByAction', action)); + }, + _hideMenusByAction(action) { + const unique_selection = '[data-action-id=' + action.id + ']'; + $(_.str.sprintf('.o_menu_apps .dropdown:has(.dropdown-menu.show:has(%s)) > a', unique_selection)).dropdown('toggle'); + $(_.str.sprintf('.o_menu_sections.show:has(%s)', unique_selection)).collapse('hide'); + }, +}); - _handleAction: function (action) { - return this._super.apply(this, arguments).then($.proxy(this, '_hideMenusByAction', action)); - }, - _hideMenusByAction: function (action) { - var unique_selection = '[data-action-id=' + action.id + ']'; - $(_.str.sprintf('.o_menu_apps .dropdown:has(.dropdown-menu.show:has(%s)) > a', unique_selection)).dropdown('toggle'); - $(_.str.sprintf('.o_menu_sections.show:has(%s)', unique_selection)).collapse('hide'); - }, - }) - }); -}) +}); diff --git a/muk_web_theme/static/src/js/chrome/apps.js b/muk_web_theme/static/src/js/chrome/apps.js index dea2e15..8423aa9 100644 --- a/muk_web_theme/static/src/js/chrome/apps.js +++ b/muk_web_theme/static/src/js/chrome/apps.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,15 +23,11 @@ odoo.define('muk_web_theme.AppsMenu', function (require) { "use strict"; -var core = require('web.core'); -var config = require("web.config"); -var session = require("web.session"); +const core = require('web.core'); +const session = require("web.session"); -var AppsMenu = require("web.AppsMenu"); -var MenuSearchMixin = require("muk_web_theme.MenuSearchMixin"); - -var _t = core._t; -var QWeb = core.qweb; +const AppsMenu = require("web.AppsMenu"); +const MenuSearchMixin = require("muk_web_theme.MenuSearchMixin"); AppsMenu.include(_.extend({}, MenuSearchMixin, { events: _.extend({}, AppsMenu.prototype.events, { @@ -41,9 +37,9 @@ AppsMenu.include(_.extend({}, MenuSearchMixin, { "hidden.bs.dropdown": "_onMenuHidden", "hide.bs.dropdown": "_onMenuHide", }), - init: function (parent, menuData) { - this._super.apply(this, arguments); - for (var n in this._apps) { + init(parent, menuData) { + this._super(...arguments); + for (let n in this._apps) { this._apps[n].web_icon_data = menuData.children[n].web_icon_data; } this._searchableMenus = _.reduce( @@ -51,16 +47,16 @@ AppsMenu.include(_.extend({}, MenuSearchMixin, { ); this._search_def = $.Deferred(); }, - start: function () { + start() { this._setBackgroundImage(); this.$search_container = this.$(".mk_search_container"); this.$search_input = this.$(".mk_search_input input"); this.$search_results = this.$(".mk_search_results"); - return this._super.apply(this, arguments); + return this._super(...arguments); }, - _onSearchResultChosen: function (event) { + _onSearchResultChosen(event) { event.preventDefault(); - var $result = $(event.currentTarget), + const $result = $(event.currentTarget), text = $result.text().trim(), data = $result.data(), suffix = ~text.indexOf("/") ? "/" : ""; @@ -69,17 +65,15 @@ AppsMenu.include(_.extend({}, MenuSearchMixin, { id: data.menuId, previous_menu_id: data.parentId, }); - var app = _.find(this._apps, function (_app) { - return text.indexOf(_app.name + suffix) === 0; - }); + const app = _.find(this._apps, (_app) => text.indexOf(_app.name + suffix) === 0); core.bus.trigger("change_menu_section", app.menuID); }, - _onAppsMenuItemClicked: function (event) { - this._super.apply(this, arguments); + _onAppsMenuItemClicked(event) { + this._super(...arguments); event.preventDefault(); }, - _setBackgroundImage: function () { - var url = session.url('/web/image', { + _setBackgroundImage() { + const url = session.url('/web/image', { model: 'res.company', id: session.company_id, field: 'background_image', @@ -94,7 +88,7 @@ AppsMenu.include(_.extend({}, MenuSearchMixin, { }); } }, - _onMenuHide: function(event) { + _onMenuHide(event) { return $('.oe_wait').length === 0 && !this.$('input').is(':focus'); }, })); diff --git a/muk_web_theme/static/src/js/chrome/appsbar.js b/muk_web_theme/static/src/js/chrome/appsbar.js index c4e3645..eaa91d3 100644 --- a/muk_web_theme/static/src/js/chrome/appsbar.js +++ b/muk_web_theme/static/src/js/chrome/appsbar.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,45 +23,38 @@ odoo.define('muk_web_theme.AppsBar', function (require) { "use strict"; -var core = require('web.core'); -var config = require("web.config"); +const Widget = require('web.Widget'); -var Widget = require('web.Widget'); - -var _t = core._t; -var QWeb = core.qweb; - -var AppsBar = Widget.extend({ +const AppsBar = Widget.extend({ events: _.extend({}, Widget.prototype.events, { 'click .nav-link': '_onAppsMenuItemClicked', }), template: "muk_web_theme.AppsBarMenu", - init: function (parent, menu) { - this._super.apply(this, arguments); - this._apps = _.map(menu.children, function (app) { - return { + init(parent, menu) { + this._super(...arguments); + this._apps = _.map(menu.children, (app) => ({ actionID: parseInt(app.action.split(',')[1]), web_icon_data: app.web_icon_data, menuID: app.id, name: app.name, xmlID: app.xmlid, - }; - }); + }) + ); }, - getApps: function () { + getApps() { return this._apps; }, - _openApp: function (app) { + _openApp(app) { this.trigger_up('app_clicked', { action_id: app.actionID, menu_id: app.menuID, }); }, - _onAppsMenuItemClicked: function (ev) { - var $target = $(ev.currentTarget); - var actionID = $target.data('action-id'); - var menuID = $target.data('menu-id'); - var app = _.findWhere(this._apps, { + _onAppsMenuItemClicked(ev) { + const $target = $(ev.currentTarget); + const actionID = $target.data('action-id'); + const menuID = $target.data('menu-id'); + const app = _.findWhere(this._apps, { actionID: actionID, menuID: menuID }); diff --git a/muk_web_theme/static/src/js/chrome/menu.js b/muk_web_theme/static/src/js/chrome/menu.js index 11ac3a3..c1e522f 100644 --- a/muk_web_theme/static/src/js/chrome/menu.js +++ b/muk_web_theme/static/src/js/chrome/menu.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,14 +23,10 @@ odoo.define('muk_web_theme.Menu', function (require) { "use strict"; -var core = require('web.core'); -var config = require("web.config"); +const config = require("web.config"); -var Menu = require("web.Menu"); -var AppsBar = require("muk_web_theme.AppsBar"); - -var _t = core._t; -var QWeb = core.qweb; +const Menu = require("web.Menu"); +const AppsBar = require("muk_web_theme.AppsBar"); Menu.include({ events: _.extend({}, Menu.prototype.events, { @@ -41,40 +37,42 @@ Menu.include({ }), menusTemplate: config.device.isMobile ? 'muk_web_theme.MobileMenu.sections' : Menu.prototype.menusTemplate, - start: function () { - var res = this._super.apply(this, arguments); + start() { + const res = this._super(...arguments); this.$menu_toggle = this.$(".mk_menu_sections_toggle"); this.$menu_apps_sidebar = this.$('.mk_apps_sidebar_panel'); this._appsBar = new AppsBar(this, this.menu_data); - this._appsBar.appendTo(this.$menu_apps_sidebar); - this.$menu_apps_sidebar.renderScrollBar(); + const appsBarProm = this._appsBar.appendTo(this.$menu_apps_sidebar); + appsBarProm.then(() => { + this.$menu_apps_sidebar.renderScrollBar(); + }); if (config.device.isMobile) { - var menu_ids = _.keys(this.$menu_sections); - for (var i = 0; i < menu_ids.length; i++) { - var $section = this.$menu_sections[menu_ids[i]]; - $section.on('click', 'a[data-menu]', this, function(ev) { + const menu_ids = _.keys(this.$menu_sections); + for (let i = 0; i < menu_ids.length; i++) { + const $section = this.$menu_sections[menu_ids[i]]; + $section.on('click', 'a[data-menu]', this, (ev) => { ev.stopPropagation(); }); } } - return res; + return Promise.all([ + res, appsBarProm + ]); }, - _hideMobileSubmenus: function () { + _hideMobileSubmenus() { if (this.$menu_toggle.is(":visible") && $('.oe_wait').length === 0 && this.$section_placeholder.is(":visible")) { this.$section_placeholder.collapse("hide"); } }, - _updateMenuBrand: function () { - if (!config.device.isMobile) { - return this._super.apply(this, arguments); - } + _updateMenuBrand() { + return !config.device.isMobile ? this._super(...arguments) : null; }, - _onAppsMenuClick: function(event, checkedCanBeRemoved) { - var action_manager = this.getParent().action_manager; - var controller = action_manager.getCurrentController(); + _onAppsMenuClick(event, checkedCanBeRemoved) { + const action_manager = this.getParent().action_manager; + const controller = action_manager.getCurrentController(); if (controller && !checkedCanBeRemoved) { - controller.widget.canBeRemoved().then(function () { + controller.widget.canBeRemoved().then(() => { $(event.currentTarget).trigger('click', [true]); $(event.currentTarget).off('.bs.dropdown'); }); @@ -82,10 +80,10 @@ Menu.include({ event.preventDefault(); } }, - _onMobileSectionClick: function (event) { + _onMobileSectionClick(event) { event.preventDefault(); event.stopPropagation(); - var $section = $(event.currentTarget); + const $section = $(event.currentTarget); if ($section.hasClass('show')) { $section.removeClass('show'); $section.find('.show').removeClass('show'); diff --git a/muk_web_theme/static/src/js/chrome/pager.js b/muk_web_theme/static/src/js/chrome/pager.js deleted file mode 100644 index 7f56107..0000000 --- a/muk_web_theme/static/src/js/chrome/pager.js +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme -* (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_theme.Pager', function (require) { -"use strict"; - -var core = require('web.core'); -var config = require("web.config"); - -var Pager = require('web.Pager'); - -var _t = core._t; -var QWeb = core.qweb; - -Pager.include({ - _render: function () { - this._super.apply(this, arguments); - if (this.state.size !== 0 && config.device.isMobile) { - this.$value.html(Math.ceil(this.state.current_max / this.state.limit)); - this.$limit.html(Math.ceil(this.state.size / this.state.limit)); - } - }, - _onEdit: function (event) { - if (!config.device.isMobile) { - this._super.apply(this, arguments); - } - event.stopPropagation(); - }, -}); - -}); \ No newline at end of file diff --git a/muk_web_theme/static/src/js/chrome/sidebar.js b/muk_web_theme/static/src/js/chrome/sidebar.js deleted file mode 100644 index af7c128..0000000 --- a/muk_web_theme/static/src/js/chrome/sidebar.js +++ /dev/null @@ -1,50 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme -* (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_theme.Sidebar', function (require) { -"use strict"; - -var core = require('web.core'); -var config = require("web.config"); - -var Sidebar = require('web.Sidebar'); - -var _t = core._t; -var QWeb = core.qweb; - -Sidebar.include({ - init: function () { - this._super.apply(this, arguments); - if (config.device.isMobile) { - _.each(this.sections, function(element) { - if(element.name === 'print') { - element.icon = 'fa fa-print'; - } - if(element.name === 'other') { - element.icon = 'fa fa-cogs'; - } - }); - } - }, -}); - -}); \ No newline at end of file diff --git a/muk_web_theme/static/src/js/core/search.js b/muk_web_theme/static/src/js/core/search.js index dea4c9e..0bf5996 100644 --- a/muk_web_theme/static/src/js/core/search.js +++ b/muk_web_theme/static/src/js/core/search.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,17 +23,15 @@ odoo.define('muk_web_theme.MenuSearchMixin', function (require) { "use strict"; -var core = require('web.core'); -var config = require("web.config"); -var session = require("web.session"); +const core = require('web.core'); +const config = require("web.config"); -var _t = core._t; -var QWeb = core.qweb; +const QWeb = core.qweb; -var MenuSearchMixin = { - _findNames: function (memo, menu) { +const MenuSearchMixin = { + _findNames(memo, menu) { if (menu.action) { - var key = menu.parent_id ? menu.parent_id[1] + "/" : ""; + const key = menu.parent_id ? menu.parent_id[1] + "/" : ""; memo[key + menu.name] = menu; } if (menu.children.length) { @@ -41,38 +39,38 @@ var MenuSearchMixin = { } return memo; }, - _menuInfo: function (key) { - var original = this._searchableMenus[key]; + _menuInfo(key) { + const original = this._searchableMenus[key]; return _.extend({ action_id: parseInt(original.action.split(',')[1], 10), }, original); }, - _searchFocus: function () { + _searchFocus() { if (!config.device.isMobile) { this.$search_input.focus(); } else { this.$search_input.blur(); } }, - _searchReset: function () { + _searchReset() { this.$search_container.removeClass("has-results"); this.$search_results.empty(); this.$search_input.val(""); }, - _searchMenusSchedule: function () { + _searchMenusSchedule() { this._search_def.reject(); this._search_def = $.Deferred(); setTimeout(this._search_def.resolve.bind(this._search_def), 50); this._search_def.then(this._searchMenus.bind(this)); }, - _searchMenus: function () { - var query = this.$search_input.val(); + _searchMenus() { + const query = this.$search_input.val(); if (query === "") { this.$search_container.removeClass("has-results"); this.$search_results.empty(); return; } - var results = fuzzy.filter(query, _.keys(this._searchableMenus), { + const results = fuzzy.filter(query, _.keys(this._searchableMenus), { pre: "", post: "", }); @@ -82,15 +80,15 @@ var MenuSearchMixin = { widget: this, })); }, - _onSearchResultsNavigate: function (event) { + _onSearchResultsNavigate(event) { if (this.$search_results.html().trim() === "") { this._searchMenusSchedule(); return; } - var all = this.$search_results.find(".mk_menu_search_result"); - var key = event.key || String.fromCharCode(event.which); - var pre_focused = all.filter(".active") || $(all[0]); - var offset = all.index(pre_focused); + const all = this.$search_results.find(".mk_menu_search_result"); + const key = event.key || String.fromCharCode(event.which); + const pre_focused = all.filter(".active") || $(all[0]); + const offset = all.index(pre_focused); if (key === "Tab") { event.preventDefault(); key = event.shiftKey ? "ArrowUp" : "ArrowDown"; @@ -114,7 +112,7 @@ var MenuSearchMixin = { } else if (offset >= all.length) { offset -= all.length; } - var new_focused = $(all[offset]); + const new_focused = $(all[offset]); pre_focused.removeClass("active"); new_focused.addClass("active"); this.$search_results.scrollTo(new_focused, { @@ -123,10 +121,10 @@ var MenuSearchMixin = { }, }); }, - _onMenuShown: function(event) { + _onMenuShown(event) { this._searchFocus(); }, - _onMenuHidden: function(event) { + _onMenuHidden(event) { this._searchReset(); }, }; diff --git a/muk_web_theme/static/src/js/fields/relational.js b/muk_web_theme/static/src/js/fields/relational.js index 4f29831..71133ce 100644 --- a/muk_web_theme/static/src/js/fields/relational.js +++ b/muk_web_theme/static/src/js/fields/relational.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,18 +23,14 @@ odoo.define('muk_web_theme.relational_fields', function (require) { "use strict"; -var core = require('web.core'); -var config = require("web.config"); -var fields = require('web.relational_fields'); - -var _t = core._t; -var QWeb = core.qweb; +const config = require("web.config"); +const fields = require('web.relational_fields'); fields.FieldStatus.include({ - _setState: function () { - this._super.apply(this, arguments); + _setState() { + this._super(...arguments); if (config.device.isMobile) { - _.map(this.status_information, function (value) { + _.map(this.status_information, (value) => { value.fold = true; }); } @@ -42,10 +38,10 @@ fields.FieldStatus.include({ }); fields.FieldOne2Many.include({ - _renderButtons: function () { - var result = this._super.apply(this, arguments); + _renderButtons() { + const result = this._super(...arguments); if (config.device.isMobile && this.$buttons) { - var $buttons = this.$buttons.find('.btn-secondary'); + const $buttons = this.$buttons.find('.btn-secondary'); $buttons.addClass('btn-primary mk_mobile_add'); $buttons.removeClass('btn-secondary'); } @@ -54,10 +50,10 @@ fields.FieldOne2Many.include({ }); fields.FieldMany2Many.include({ - _renderButtons: function () { - var result = this._super.apply(this, arguments); + _renderButtons() { + const result = this._super(...arguments); if (config.device.isMobile && this.$buttons) { - var $buttons = this.$buttons.find('.btn-secondary'); + const $buttons = this.$buttons.find('.btn-secondary'); $buttons.addClass('btn-primary mk_mobile_add'); $buttons.removeClass('btn-secondary'); } diff --git a/muk_web_utils/static/src/js/libs/scrollbar.js b/muk_web_theme/static/src/js/libs/scrollbar.js similarity index 91% rename from muk_web_utils/static/src/js/libs/scrollbar.js rename to muk_web_theme/static/src/js/libs/scrollbar.js index 2c889fd..3842f53 100644 --- a/muk_web_utils/static/src/js/libs/scrollbar.js +++ b/muk_web_theme/static/src/js/libs/scrollbar.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Web Utils +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/js/views/form_renderer.js b/muk_web_theme/static/src/js/views/form_renderer.js index cd9ff72..87a202d 100644 --- a/muk_web_theme/static/src/js/views/form_renderer.js +++ b/muk_web_theme/static/src/js/views/form_renderer.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,32 +23,28 @@ odoo.define('muk_web_theme.FormRenderer', function (require) { "use strict"; -var dom = require('web.dom'); -var core = require('web.core'); -var config = require("web.config"); +const core = require('web.core'); +const config = require("web.config"); -var FormRenderer = require('web.FormRenderer'); - -var _t = core._t; -var QWeb = core.qweb; +const FormRenderer = require('web.FormRenderer'); FormRenderer.include({ - _renderHeaderButtons: function() { - const $buttons = this._super.apply(this, arguments); - if ( - !config.device.isMobile || - !$buttons.is(":has(>:not(.o_invisible_modifier))") - ) { - return $buttons; - } + _renderHeaderButtons() { + const $buttons = this._super(...arguments); + if ( + !config.device.isMobile || + !$buttons.is(":has(>:not(.o_invisible_modifier))") + ) { + return $buttons; + } - $buttons.addClass("dropdown-menu"); - const $dropdown = $( - core.qweb.render("muk_web_theme.MenuStatusbarButtons") - ); - $buttons.addClass("dropdown-menu").appendTo($dropdown); - return $dropdown; - }, + $buttons.addClass("dropdown-menu"); + const $dropdown = $( + core.qweb.render("muk_web_theme.MenuStatusbarButtons") + ); + $buttons.addClass("dropdown-menu").appendTo($dropdown); + return $dropdown; + }, }); }); \ No newline at end of file diff --git a/muk_web_theme/static/src/js/views/form_view.js b/muk_web_theme/static/src/js/views/form_view.js index f8d01e5..3bd2610 100644 --- a/muk_web_theme/static/src/js/views/form_view.js +++ b/muk_web_theme/static/src/js/views/form_view.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -23,19 +23,14 @@ odoo.define('muk_web_theme.FormView', function (require) { "use strict"; -var dom = require('web.dom'); -var core = require('web.core'); -var config = require("web.config"); +const config = require("web.config"); -var FormView = require('web.FormView'); -var QuickCreateFormView = require('web.QuickCreateFormView'); - -var _t = core._t; -var QWeb = core.qweb; +const FormView = require('web.FormView'); +const QuickCreateFormView = require('web.QuickCreateFormView'); FormView.include({ - init: function () { - this._super.apply(this, arguments); + init() { + this._super(...arguments); if (config.device.isMobile) { this.controllerParams.disableAutofocus = true; } @@ -43,8 +38,8 @@ FormView.include({ }); QuickCreateFormView.include({ - init: function () { - this._super.apply(this, arguments); + init() { + this._super(...arguments); if (config.device.isMobile) { this.controllerParams.disableAutofocus = true; } diff --git a/muk_web_utils/static/src/scss/binary.scss b/muk_web_theme/static/src/js/views/kanban_column.js similarity index 65% rename from muk_web_utils/static/src/scss/binary.scss rename to muk_web_theme/static/src/js/views/kanban_column.js index d4541e2..0cdc8dd 100644 --- a/muk_web_utils/static/src/scss/binary.scss +++ b/muk_web_theme/static/src/js/views/kanban_column.js @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Web Utils +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -19,10 +19,24 @@ * 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; - } + +odoo.define('muk_web_theme.KanbanColumn', function (require) { +"use strict"; + +const config = require('web.config'); + +const KanbanColumn = require('web.KanbanColumn'); + +if (!config.device.isMobile) { + return; } + +KanbanColumn.include({ + init() { + this._super(...arguments); + this.recordsDraggable = false; + this.canBeFolded = false; + }, +}); + +}); diff --git a/muk_web_utils/static/src/js/fields/abstract.js b/muk_web_theme/static/src/js/views/kanban_quick_create.js similarity index 60% rename from muk_web_utils/static/src/js/fields/abstract.js rename to muk_web_theme/static/src/js/views/kanban_quick_create.js index 39ac1bd..b86ed52 100644 --- a/muk_web_utils/static/src/js/fields/abstract.js +++ b/muk_web_theme/static/src/js/views/kanban_quick_create.js @@ -1,46 +1,44 @@ -/********************************************************************************** -* -* 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.abstract', function(require) { -"use strict"; - -var core = require('web.core'); -var session = require('web.session'); -var utils = require('web.field_utils'); -var fields = require('web.basic_fields'); -var registry = require('web.field_registry'); - -var AbstractField = require('web.AbstractField'); - -var _t = core._t; -var QWeb = core.qweb; - -AbstractField.include({ - isFocusable: function () { - if(!!this.attrs.skip_focus){ - return false; - } - return this._super.apply(this, arguments); - }, -}); - -}); +/********************************************************************************** +* +* Copyright (c) 2017-today MuK IT GmbH. +* +* This file is part of MuK Grid Snippets +* (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_theme.kanban_column_quick_create', function (require) { +"use strict"; + +const config = require('web.config'); + +const KanbanRenderer = require('web.kanban_column_quick_create'); + +KanbanRenderer.include({ + init() { + this._super(...arguments); + this.isMobile = config.device.isMobile; + }, + _cancel() { + if (!config.device.isMobile) { + this._super(...arguments); + } else if (!this.folded) { + this.$input.val(''); + } + }, +}); + +}); diff --git a/muk_web_theme/static/src/js/views/kanban_renderer.js b/muk_web_theme/static/src/js/views/kanban_renderer.js new file mode 100644 index 0000000..2cdd94d --- /dev/null +++ b/muk_web_theme/static/src/js/views/kanban_renderer.js @@ -0,0 +1,271 @@ +/********************************************************************************** +* +* Copyright (c) 2017-today MuK IT GmbH. +* +* This file is part of MuK Grid Snippets +* (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_theme.KanbanRenderer', function (require) { +"use strict"; + +const config = require('web.config'); +const core = require('web.core'); + +const KanbanRenderer = require('web.KanbanRenderer'); + +const _t = core._t; +const qweb = core.qweb; + +if (!config.device.isMobile) { + return; +} + +KanbanRenderer.include({ + custom_events: _.extend({}, KanbanRenderer.prototype.custom_events || {}, { + quick_create_column_created: '_onColumnAdded', + }), + events: _.extend({}, KanbanRenderer.prototype.events, { + 'click .o_kanban_mobile_tab': '_onMobileTabClicked', + 'click .o_kanban_mobile_add_column': '_onMobileQuickCreateClicked', + }), + ANIMATE: true, + init() { + this._super.apply(this, arguments); + this.activeColumnIndex = 0; + this._scrollPosition = null; + }, + on_attach_callback() { + if (this._scrollPosition && this.state.groupedBy.length && this.widgets.length) { + var $column = this.widgets[this.activeColumnIndex].$el; + $column.scrollLeft(this._scrollPosition.left); + $column.scrollTop(this._scrollPosition.top); + } + this._computeTabPosition(); + this._super.apply(this, arguments); + }, + on_detach_callback() { + if (this.state.groupedBy.length && this.widgets.length) { + var $column = this.widgets[this.activeColumnIndex].$el; + this._scrollPosition = { + left: $column.scrollLeft(), + top: $column.scrollTop(), + }; + } else { + this._scrollPosition = null; + } + this._super.apply(this, arguments); + }, + addQuickCreate() { + if(this._canCreateColumn() && !this.quickCreate.folded) { + this._onMobileQuickCreateClicked(); + } + return this.widgets[this.activeColumnIndex].addQuickCreate(); + }, + updateColumn(localID) { + var index = _.findIndex(this.widgets, {db_id: localID}); + var $column = this.widgets[index].$el; + var scrollTop = $column.scrollTop(); + return this._super.apply(this, arguments) + .then(() => this._layoutUpdate(false)) + .then(() => $column.scrollTop(scrollTop)); + }, + _canCreateColumn: function() { + return this.quickCreateEnabled && this.quickCreate && this.widgets.length; + }, + _computeColumnPosition(animate) { + if (this.widgets.length) { + const rtl = _t.database.parameters.direction === 'rtl'; + this.$('.o_kanban_group').show(); + const $columnAfter = this._toNode(this.widgets.filter((widget, index) => index > this.activeColumnIndex)); + const promiseAfter = this._updateColumnCss($columnAfter, rtl ? {right: '100%'} : {left: '100%'}, animate); + const $columnBefore = this._toNode(this.widgets.filter((widget, index) => index < this.activeColumnIndex)); + const promiseBefore = this._updateColumnCss($columnBefore, rtl ? {right: '-100%'} : {left: '-100%'}, animate); + const $columnCurrent = this._toNode(this.widgets.filter((widget, index) => index === this.activeColumnIndex)); + const promiseCurrent = this._updateColumnCss($columnCurrent, rtl ? {right: '0%'} : {left: '0%'}, animate); + promiseAfter + .then(promiseBefore) + .then(promiseCurrent) + .then(() => { + $columnAfter.hide(); + $columnBefore.hide(); + }); + } + }, + _computeCurrentColumn() { + if (this.widgets.length) { + var column = this.widgets[this.activeColumnIndex]; + if (!column) { + return; + } + var columnID = column.id || column.db_id; + this.$('.o_kanban_mobile_tab.o_current, .o_kanban_group.o_current') + .removeClass('o_current'); + this.$('.o_kanban_group[data-id="' + columnID + '"], ' + + '.o_kanban_mobile_tab[data-id="' + columnID + '"]') + .addClass('o_current'); + } + }, + _computeTabPosition() { + this._computeTabJustification(); + this._computeTabScrollPosition(); + }, + _computeTabScrollPosition() { + if (this.widgets.length) { + var lastItemIndex = this.widgets.length - 1; + var moveToIndex = this.activeColumnIndex; + var scrollToLeft = 0; + for (var i = 0; i < moveToIndex; i++) { + var columnWidth = this._getTabWidth(this.widgets[i]); + if (moveToIndex !== lastItemIndex && i === moveToIndex - 1) { + var partialWidth = 0.75; + scrollToLeft += columnWidth * partialWidth; + } else { + scrollToLeft += columnWidth; + } + } + this.$('.o_kanban_mobile_tabs').scrollLeft(scrollToLeft); + } + }, + _computeTabJustification() { + if (this.widgets.length) { + var self = this; + var widthChilds = this.widgets.reduce(function (total, column) { + return total + self._getTabWidth(column); + }, 0); + var $tabs = this.$('.o_kanban_mobile_tabs'); + $tabs.toggleClass('justify-content-between', $tabs.outerWidth() >= widthChilds); + } + }, + _enableSwipe() { + var self = this; + var step = _t.database.parameters.direction === 'rtl' ? -1 : 1; + this.$el.swipe({ + excludedElements: ".o_kanban_mobile_tabs", + swipeLeft() { + var moveToIndex = self.activeColumnIndex + step; + if (moveToIndex < self.widgets.length) { + self._moveToGroup(moveToIndex, self.ANIMATE); + } + }, + swipeRight() { + var moveToIndex = self.activeColumnIndex - step; + if (moveToIndex > -1) { + self._moveToGroup(moveToIndex, self.ANIMATE); + } + } + }); + }, + _getTabWidth (column) { + var columnID = column.id || column.db_id; + return this.$('.o_kanban_mobile_tab[data-id="' + columnID + '"]').outerWidth(); + }, + _layoutUpdate (animate) { + this._computeCurrentColumn(); + this._computeTabPosition(); + this._computeColumnPosition(animate); + }, + _moveToGroup(moveToIndex, animate) { + if (moveToIndex < 0 || moveToIndex >= this.widgets.length) { + this._layoutUpdate(animate); + return Promise.resolve(); + } + this.activeColumnIndex = moveToIndex; + var column = this.widgets[this.activeColumnIndex]; + if (column.data.isOpen) { + this._layoutUpdate(animate); + } else { + this.trigger_up('column_toggle_fold', { + db_id: column.db_id, + onSuccess: () => this._layoutUpdate(animate) + }); + } + this._enableSwipe(); + return Promise.resolve(); + }, + _renderGrouped(fragment) { + var self = this; + var newFragment = document.createDocumentFragment(); + this._super.apply(this, [newFragment]); + this.defs.push(Promise.all(this.defs).then(function () { + var data = []; + _.each(self.state.data, function (group) { + if (!group.value) { + group = _.extend({}, group, {value: _t('Undefined')}); + data.unshift(group); + } else { + data.push(group); + } + }); + + var kanbanColumnContainer = document.createElement('div'); + kanbanColumnContainer.classList.add('o_kanban_columns_content'); + kanbanColumnContainer.appendChild(newFragment); + fragment.appendChild(kanbanColumnContainer); + $(qweb.render('KanbanView.MobileTabs', { + data: data, + quickCreateEnabled: self._canCreateColumn() + })).prependTo(fragment); + })); + }, + _renderView() { + var self = this; + return this._super.apply(this, arguments).then(function () { + if (self.state.groupedBy.length) { + return self._moveToGroup(0); + } else { + if(self._canCreateColumn()) { + self._onMobileQuickCreateClicked(); + } + return Promise.resolve(); + } + }); + }, + _toNode(widgets) { + const selectorCss = widgets + .map(widget => '.o_kanban_group[data-id="' + (widget.id || widget.db_id) + '"]') + .join(', '); + return this.$(selectorCss); + }, + _updateColumnCss($column, cssProperties, animate) { + if (animate) { + return new Promise(resolve => $column.animate(cssProperties, 'fast', resolve)); + } else { + $column.css(cssProperties); + return Promise.resolve(); + } + }, + _onColumnAdded() { + this._computeTabPosition(); + if(this._canCreateColumn() && !this.quickCreate.folded) { + this.quickCreate.toggleFold(); + } + }, + _onMobileQuickCreateClicked: function() { + this.$('.o_kanban_group').toggle(); + this.quickCreate.toggleFold(); + }, + _onMobileTabClicked(event) { + if(this._canCreateColumn() && !this.quickCreate.folded) { + this.quickCreate.toggleFold(); + } + this._moveToGroup($(event.currentTarget).index(), true); + }, + _renderExampleBackground() {}, +}); + +}); \ No newline at end of file diff --git a/muk_web_theme/static/src/js/views/list_renderer.js b/muk_web_theme/static/src/js/views/list_renderer.js deleted file mode 100644 index b5eb947..0000000 --- a/muk_web_theme/static/src/js/views/list_renderer.js +++ /dev/null @@ -1,107 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme -* (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_theme.ListRenderer', function (require) { -"use strict"; - -var dom = require('web.dom'); -var core = require('web.core'); -var config = require("web.config"); - -var ListRenderer = require('web.ListRenderer'); - -var _t = core._t; -var QWeb = core.qweb; - -ListRenderer.include({ - _range_history: [], - _render: function() { - var res = this._super.apply(this, arguments); - this.$table = this.$el.find('.o_list_view'); - return res; - }, - _getRangeSelection: function() { - var self = this; - var start = null, end = null; - this.$el.find('td.o_list_record_selector input').each(function (i, el) { - var id = $(el).closest('tr').data('id'); - var checked = self._range_history.indexOf(id) !== -1; - if (checked && $(el).is(':checked')) { - if (start == null) { - start = i; - } else { - end = i; - } - } - }); - var new_range = this._getSelectionByRange(start, end); - var current_selection = this.selection; - current_selection = _.uniq(current_selection.concat(new_range)); - return current_selection; - }, - _getSelectionByRange: function(start, end) { - var result = []; - this.$el.find('td.o_list_record_selector input').closest('tr').each(function (i, el) { - var record_id = $(el).data('id'); - if (start != null && end != null && i >= start && i <= end) { - result.push(record_id); - } else if(start != null && end == null && start == i) { - result.push(record_id); - } - }); - return result; - }, - _pushRangeHistory: function(id) { - if (this._range_history.length === 2) { - this._range_history = []; - } - this._range_history.push(id); - }, - _deselectTable: function() { - window.getSelection().removeAllRanges(); - }, - _onSelectRecord: function(event) { - var res = this._super.apply(this, arguments); - var element = $(event.currentTarget); - if (/firefox/i.test(navigator.userAgent) && event.shiftKey) { - element.find('input').prop('checked', !element.find('input').prop('checked')); - } - if (element.find('input').prop('checked')) { - this._pushRangeHistory(element.closest('tr').data('id')); - } - if (event.shiftKey) { - var selection = this._getRangeSelection(); - var $rows = this.$el.find('td.o_list_record_selector input').closest('tr'); - $rows.each(function () { - var record_id = $(this).data('id'); - if (selection.indexOf(record_id) !== -1) { - $(this).find('td.o_list_record_selector input').prop('checked', true); - } - }); - this._updateSelection(); - this._deselectTable(); - } - return res; - } -}); - -}); \ No newline at end of file diff --git a/muk_web_theme/static/src/scss/apps.scss b/muk_web_theme/static/src/scss/apps.scss index e9b1739..6374c1c 100644 --- a/muk_web_theme/static/src/scss/apps.scss +++ b/muk_web_theme/static/src/scss/apps.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/appsbar.scss b/muk_web_theme/static/src/scss/appsbar.scss index 200fdbc..61194c8 100644 --- a/muk_web_theme/static/src/scss/appsbar.scss +++ b/muk_web_theme/static/src/scss/appsbar.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/colors.scss b/muk_web_theme/static/src/scss/colors.scss index c484d4e..f7489d9 100644 --- a/muk_web_theme/static/src/scss/colors.scss +++ b/muk_web_theme/static/src/scss/colors.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/control_panel.scss b/muk_web_theme/static/src/scss/control_panel.scss index 5ecbb84..0456945 100644 --- a/muk_web_theme/static/src/scss/control_panel.scss +++ b/muk_web_theme/static/src/scss/control_panel.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -20,67 +20,70 @@ * **********************************************************************************/ - @include media-breakpoint-down(sm) { .o_control_panel { padding-left: $o-horizontal-padding /2; padding-right: $o-horizontal-padding /2; - .breadcrumb, .o_cp_left, .o_cp_right, .o_cp_searchview { - flex: 1 1 100%; - @include media-breakpoint-up(md) { - flex-basis: 50%; + .o_cp_top { + justify-content: space-between; + .o_cp_top_left { + max-width: 35%; + .breadcrumb { + overflow: hidden; + display: block; + white-space: nowrap; + text-overflow: ellipsis; + } } + .o_cp_top_right { + min-height: 35px; + min-width: 65%; + flex-grow: 1; + } } - .breadcrumb { - max-width: 80%; - overflow: hidden; - display: block; - white-space: nowrap; - text-overflow: ellipsis; - } - .o_cp_searchview { - min-height: 35px; - &.o_searchview_quick { - width: 100%; - display: flex; - align-items: flex-start; - .o_searchview { - border: none; - display: flex; - flex: 1 1 auto; - align-items: center; - .o_searchview_input_container { - flex: 1 1 auto; + .o_cp_bottom { + justify-content: space-between; + .o_cp_bottom_left { + flex-grow: 1; + .o_cp_action_menus, .o_cp_buttons { + flex: 1 1 100%; + } + .o_cp_action_menus .o_dropdown .o_dropdown_toggler_btn { + .o_dropdown_title { + display: none; } - .o_enable_searchview { - margin-left: 0; - padding-left: 0; - &:before { - padding-right: 5px; - } + i:last-of-type{ + display: none; + } + &::after{ + display: inline-block; + width: 0; + height: 0; + margin-left: 0.255em; + vertical-align: 0.255em; + content: ""; + border-top: 0.3em solid; + border-right: 0.3em solid transparent; + border-bottom: 0; + border-left: 0.3em solid transparent; } } } - } - .o_cp_left { - flex-basis: 50%; - white-space: nowrap; - .o_cp_buttons, .o_cp_sidebar { - flex: 1 1 100%; - } - } - .o_cp_right { - flex-basis: 10%; - } - .o_cp_pager { - white-space: nowrap; - .o_pager_counter { - max-width: 60px; - @include o-text-overflow; + .o_cp_bottom_right { + .o_cp_pager { + white-space: nowrap; + .o_pager_counter { + max-width: 60px; + @include o-text-overflow; + } + .o_pager_previous, .o_pager_next { + border: none; + } + } + .o_search_options { + display: none; + } } - .o_pager_previous, .o_pager_next { - border: none; - } } .breadcrumb-item { &:not(.active) { @@ -108,8 +111,8 @@ .o_cp_buttons .btn.d-block:not(.d-none) { display: inline-block !important; } - .o_cp_switch_buttons.show { - .dropdown-menu { + .o_cp_switch_buttons { + &.show > .dropdown-menu { display: flex; min-width: 0px; flex-direction: row; @@ -124,4 +127,7 @@ } } } + .o_controller_with_searchpanel .o_search_panel { + display: none; + } } diff --git a/muk_web_theme/static/src/scss/fields.scss b/muk_web_theme/static/src/scss/fields.scss index cf06fad..f9a903d 100644 --- a/muk_web_theme/static/src/scss/fields.scss +++ b/muk_web_theme/static/src/scss/fields.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ * along with this program. If not, see . * **********************************************************************************/ - + .o_field_widget { &.o_field_many2one .o_external_button { color: $o-brand-odoo diff --git a/muk_web_theme/static/src/scss/fonts.scss b/muk_web_theme/static/src/scss/fonts.scss index 23a5862..ce7bf2f 100644 --- a/muk_web_theme/static/src/scss/fonts.scss +++ b/muk_web_theme/static/src/scss/fonts.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/form_view.scss b/muk_web_theme/static/src/scss/form_view.scss index 89f03ec..3c5acc0 100644 --- a/muk_web_theme/static/src/scss/form_view.scss +++ b/muk_web_theme/static/src/scss/form_view.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -61,10 +61,13 @@ white-space: nowrap; } } + > .tab-content > .tab-pane > :first-child { + margin-top: 0; + } } } @include media-breakpoint-down(sm) { - .o_form_sheet, .oe_chatter { + .o_form_sheet { min-width: 100% !important; max-width: 100% !important; margin-top: 15px !important; @@ -138,7 +141,7 @@ flex: 1 1 auto; overflow: auto; } - > .o_chatter { + > .o_FormRenderer_chatterContainer { flex: 1 1 auto; overflow: auto; min-width: $mk-chatter-min-width; @@ -147,4 +150,4 @@ } } } -} \ No newline at end of file +} diff --git a/muk_web_theme/static/src/scss/kanban_view.scss b/muk_web_theme/static/src/scss/kanban_view.scss index 75e8cfb..73e29aa 100644 --- a/muk_web_theme/static/src/scss/kanban_view.scss +++ b/muk_web_theme/static/src/scss/kanban_view.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -20,5 +20,81 @@ * **********************************************************************************/ -.o_kanban_view { -} \ No newline at end of file +@include media-breakpoint-down(sm) { + .o_kanban_view.o_kanban_grouped { + display: block; + position: relative; + overflow-x: hidden; + .o_kanban_mobile_tabs_container { + position: sticky; + display: flex; + justify-content: space-between; + width: 100%; + top: 0; + z-index: 1; + background-color: #5E5E5E; + .o_kanban_mobile_add_column { + height: $o-kanban-mobile-tabs-height; + padding: 10px; + border-left: grey 1px solid; + color: white; + font-size: 14px; + } + .o_kanban_mobile_tabs { + position: relative; + display: flex; + width: 100%; + height: $o-kanban-mobile-tabs-height; + overflow-x: auto; + .o_kanban_mobile_tab { + height: $o-kanban-mobile-tabs-height; + padding: 10px 20px; + font-size: 14px; + color: white; + &.o_current { + font-weight: bold; + border-bottom: 3px solid $o-brand-primary; + } + .o_column_title { + white-space: nowrap; + text-transform: uppercase; + } + } + } + } + .o_kanban_columns_content { + position: relative; + } + &[class] .o_kanban_group:not(.o_column_folded) { + @include o-position-absolute($top: $o-kanban-mobile-tabs-height, $left: 0, $bottom: 0); + width: 100%; + padding: 0; + margin-left: 0; + border: none; + &.o_current { + position: inherit; + top: 0; + &.o_kanban_no_records { + min-height: $o-kanban-mobile-empty-height; + } + } + .o_kanban_header { + display: none; + } + .o_kanban_record, .o_kanban_quick_create { + border: none; + border-bottom: 1px solid lightgray; + padding: 10px 16px; + margin: 0; + } + } + } + .o_kanban_view .o_column_quick_create { + .o_quick_create_folded { + display: none !important; + } + .o_quick_create_unfolded{ + width: 100%; + } + } +} diff --git a/muk_web_theme/static/src/scss/layout.scss b/muk_web_theme/static/src/scss/layout.scss index 8e887ef..beea338 100644 --- a/muk_web_theme/static/src/scss/layout.scss +++ b/muk_web_theme/static/src/scss/layout.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/list_view.scss b/muk_web_theme/static/src/scss/list_view.scss index 5a7716b..dd2c86b 100644 --- a/muk_web_theme/static/src/scss/list_view.scss +++ b/muk_web_theme/static/src/scss/list_view.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -20,55 +20,40 @@ * **********************************************************************************/ -.o_list_view.table { - overflow-x: hidden; -} - -.o_list_view.table, -.o_list_view.table thead, -.o_list_view.table tfoot, -.o_list_view.table td, -.o_list_view.table th { - border: none; -} - -.o_list_view.table thead { - background-color: white; - th.o_column_sortable:hover { - background-color: white; +.o_list_view { + table { + overflow-x: hidden; } -} - -.table-striped > tbody > tr { - background-color: white; - &:nth-of-type(2n+1) { - background-color: gray('200'); + table, thead, tfoot, td, th { + border: none !important; + } + thead { + background-color: white; + th.o_column_sortable:hover { + background-color: white; + } + } + tfoot { + color: white !important; + cursor: default; + font-weight: normal; } - &:hover { - background-color: gray('300'); - } } -.o_list_view_grouped.table tbody tr { +.o_list_table_grouped.table tbody tr { &:nth-of-type(2n+1) { background-color: white; } &.o_group_header { background-image: none; - background-color: gray('300'); - box-shadow: inset 0 1px 0 gray('400'); + background-color: gray('200'); + box-shadow: inset 0 1px 0 gray('300'); } &:hover { - background-color: gray('300'); + background-color: gray('200'); } } -.o_list_view tfoot { - color: white !important; - cursor: default; - font-weight: normal; -} - .o_content, .modal-content { > div > .table-responsive { overflow-x: initial; diff --git a/muk_web_theme/static/src/scss/mixins.scss b/muk_web_theme/static/src/scss/mixins.scss index 1329c0a..c1c32cf 100644 --- a/muk_web_theme/static/src/scss/mixins.scss +++ b/muk_web_theme/static/src/scss/mixins.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ * along with this program. If not, see . * **********************************************************************************/ - + @mixin mk-full-screen-sections { width: 100vw; z-index: 1002; diff --git a/muk_web_theme/static/src/scss/navbar.scss b/muk_web_theme/static/src/scss/navbar.scss index 9ea91fc..999fea5 100644 --- a/muk_web_theme/static/src/scss/navbar.scss +++ b/muk_web_theme/static/src/scss/navbar.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/notification.scss b/muk_web_theme/static/src/scss/notification.scss index 3bb6d2c..52958e4 100644 --- a/muk_web_theme/static/src/scss/notification.scss +++ b/muk_web_theme/static/src/scss/notification.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/search_view.scss b/muk_web_theme/static/src/scss/search_view.scss index cd5d89d..7703b8f 100644 --- a/muk_web_theme/static/src/scss/search_view.scss +++ b/muk_web_theme/static/src/scss/search_view.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/settings.scss b/muk_web_theme/static/src/scss/settings.scss index b4b6e28..93ab8a2 100644 --- a/muk_web_theme/static/src/scss/settings.scss +++ b/muk_web_theme/static/src/scss/settings.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/scss/variables.scss b/muk_web_theme/static/src/scss/variables.scss index 8910836..0b93505 100644 --- a/muk_web_theme/static/src/scss/variables.scss +++ b/muk_web_theme/static/src/scss/variables.scss @@ -1,8 +1,8 @@ /********************************************************************************** * -* Copyright (c) 2017-2019 MuK IT GmbH. +* Copyright (c) 2017-today MuK IT GmbH. * -* This file is part of MuK Backend Theme +* This file is part of MuK Grid Snippets * (see https://mukit.at). * * This program is free software: you can redistribute it and/or modify diff --git a/muk_web_theme/static/src/xml/apps.xml b/muk_web_theme/static/src/xml/apps.xml index 70c912f..06f28a9 100644 --- a/muk_web_theme/static/src/xml/apps.xml +++ b/muk_web_theme/static/src/xml/apps.xml @@ -2,9 +2,9 @@ - - - - - - - - - - \ No newline at end of file diff --git a/muk_web_theme/static/src/xml/views.xml b/muk_web_theme/static/src/xml/views.xml index 11cdad3..56a4e8c 100644 --- a/muk_web_theme/static/src/xml/views.xml +++ b/muk_web_theme/static/src/xml/views.xml @@ -2,9 +2,9 @@ \ No newline at end of file diff --git a/muk_web_theme_mail/static/description/index.html b/muk_web_theme_mail/static/description/index.html deleted file mode 100644 index 0f066b8..0000000 --- a/muk_web_theme_mail/static/description/index.html +++ /dev/null @@ -1,133 +0,0 @@ -
-
-

MuK Backend Theme Mail

-

Community Backend Theme Mail Extension

-

MuK IT GmbH - - www.mukit.at

-
- -
-
-
- -
-
-
-

Overview

-

- This module complements the Backend Theme module by customizing the chatter - to better integrate with the theme. In addition, this module offers - a better user experience for the chatter on mobile devices. -

-
-
-
- -
- -
- -
-
-
- - -
-
-
- -
-

Help and Support

-
Feel free to - contact us, if you need any help with your Odoo integration or - addiontal features.
-
You will get 30 - Days free support incase of any bugs or issues (Except data recovery - or migration).
- - -
\ No newline at end of file diff --git a/muk_web_theme_mail/static/description/logo.png b/muk_web_theme_mail/static/description/logo.png deleted file mode 100644 index 9427ce3..0000000 Binary files a/muk_web_theme_mail/static/description/logo.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/preview.png b/muk_web_theme_mail/static/description/preview.png deleted file mode 100644 index 1deb1cc..0000000 Binary files a/muk_web_theme_mail/static/description/preview.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/screenshot.png b/muk_web_theme_mail/static/description/screenshot.png deleted file mode 100644 index 2ab1f4b..0000000 Binary files a/muk_web_theme_mail/static/description/screenshot.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/service_customization.png b/muk_web_theme_mail/static/description/service_customization.png deleted file mode 100644 index 3eac664..0000000 Binary files a/muk_web_theme_mail/static/description/service_customization.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/service_development.png b/muk_web_theme_mail/static/description/service_development.png deleted file mode 100644 index 580d460..0000000 Binary files a/muk_web_theme_mail/static/description/service_development.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/service_implementation.png b/muk_web_theme_mail/static/description/service_implementation.png deleted file mode 100644 index d64b66b..0000000 Binary files a/muk_web_theme_mail/static/description/service_implementation.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/service_integration.png b/muk_web_theme_mail/static/description/service_integration.png deleted file mode 100644 index 76c5e80..0000000 Binary files a/muk_web_theme_mail/static/description/service_integration.png and /dev/null differ diff --git a/muk_web_theme_mail/static/description/service_support.png b/muk_web_theme_mail/static/description/service_support.png deleted file mode 100644 index 4c530fa..0000000 Binary files a/muk_web_theme_mail/static/description/service_support.png and /dev/null differ diff --git a/muk_web_theme_mail/static/src/js/chatter.js b/muk_web_theme_mail/static/src/js/chatter.js deleted file mode 100644 index 7c85f4b..0000000 --- a/muk_web_theme_mail/static/src/js/chatter.js +++ /dev/null @@ -1,45 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme Mail -* (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_theme_mail.Chatter', function (require) { -"use strict"; - -var core = require('web.core'); -var config = require("web.config"); -var session = require("web.session"); - -var Chatter = require('mail.Chatter'); - -var _t = core._t; -var QWeb = core.qweb; - -Chatter.include({ - _openComposer: function (options) { - if (this._composer && options.isLog === this._composer.options.isLog && this._composer.$el.is(':visible')) { - this._closeComposer(false); - } else { - this._super.apply(this, arguments); - } - } -}); - -}); \ No newline at end of file diff --git a/muk_web_theme_mail/static/src/js/discuss.js b/muk_web_theme_mail/static/src/js/discuss.js deleted file mode 100644 index 2664c30..0000000 --- a/muk_web_theme_mail/static/src/js/discuss.js +++ /dev/null @@ -1,211 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme Mail -* (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_theme_mail.Discuss', function (require) { -"use strict"; - -const config = require("web.config"); -const core = require("web.core"); - -const Discuss = require("mail.Discuss"); - -const QWeb = core.qweb; - -if (!config.device.isMobile) { - return; -} - -Discuss.include({ - contentTemplate: "mail.discuss_mobile", - events: Object.assign({}, Discuss.prototype.events, { - "click .o_mail_mobile_tab": "_onClickMobileTab", - "click .o_mailbox_inbox_item": "_onClickMobileMailboxItem", - "click .o_mail_preview": "_onClickMobileMailPreview", - }), - init: function() { - this._super.apply(this, arguments); - this._currentState = this._defaultThreadID; - }, - start: function() { - this._$mainContent = this.$(".o_mail_discuss_content"); - return this._super - .apply(this, arguments) - .then(this._updateControlPanel.bind(this)); - }, - on_attach_callback: function() { - if (this._thread && this._isInInboxTab()) { - this._threadWidget.scrollToPosition( - this._threadsScrolltop[this._thread.getID()] - ); - } - }, - on_detach_callback: function() { - if (this._isInInboxTab()) { - this._threadsScrolltop[ - this._thread.getID() - ] = this._threadWidget.getScrolltop(); - } - }, - _isInInboxTab: function() { - return _.contains(["mailbox_inbox", "mailbox_starred"], this._currentState); - }, - _renderButtons: function() { - this._super.apply(this, arguments); - _.each(["dm_chat", "multi_user_channel"], type => { - const selector = ".o_mail_discuss_button_" + type; - this.$buttons.on("click", selector, this._onAddThread.bind(this)); - }); - }, - _restoreThreadState: function() { - if (this._isInInboxTab()) { - this._super.apply(this, arguments); - } - }, - _selectMessage: function() { - this._super.apply(this, arguments); - this.$(".o_mail_mobile_tabs").addClass("o_hidden"); - }, - _setThread: function(threadID) { - const thread = this.call("mail_service", "getThread", threadID); - this._thread = thread; - if (thread.getType() !== "mailbox") { - this.call("mail_service", "openThreadWindow", threadID); - return Promise.resolve(); - } - return this._super.apply(this, arguments); - }, - _storeThreadState: function() { - if (this._thread && this._isInInboxTab()) { - this._super.apply(this, arguments); - } - }, - _unselectMessage: function() { - this._super.apply(this, arguments); - this.$(".o_mail_mobile_tabs").removeClass("o_hidden"); - }, - _updateThreads: function() { - return this._updateContent(this._currentState); - }, - _updateContent: function(type) { - const inMailbox = type === "mailbox_inbox" || type === "mailbox_starred"; - if (!inMailbox && this._isInInboxTab()) { - this._storeThreadState(); - } - const previouslyInInbox = this._isInInboxTab(); - this._currentState = type; - let def = false; - if (inMailbox) { - def = this._fetchAndRenderThread(); - } else { - const allChannels = this.call("mail_service", "getChannels"); - const channels = _.filter(allChannels, function(channel) { - return channel.getType() === type; - }); - def = this.call("mail_service", "getChannelPreviews", channels); - } - return def.then(previews => { - if (inMailbox) { - if (!previouslyInInbox) { - this.$(".o_mail_discuss_tab_pane").remove(); - this._$mainContent.append(this._threadWidget.$el); - this._$mainContent.append(this._extendedComposer.$el); - } - this._restoreThreadState(); - } else { - this._threadWidget.$el.detach(); - this._extendedComposer.$el.detach(); - const $content = $( - QWeb.render("mail.discuss.MobileTabPane", { - previews: previews, - type: type, - }) - ); - this._prepareAddThreadInput( - $content.find(".o_mail_add_thread input"), - type - ); - this._$mainContent.html($content); - } - this.$buttons - .find("button") - .removeClass("d-block") - .addClass("d-none"); - this.$buttons - .find(".o_mail_discuss_button_" + type) - .removeClass("d-none") - .addClass("d-block"); - this.$buttons - .find(".o_mail_discuss_button_mark_all_read") - .toggleClass("d-none", type !== "mailbox_inbox") - .toggleClass("d-block", type === "mailbox_inbox"); - this.$buttons - .find(".o_mail_discuss_button_unstar_all") - .toggleClass("d-none", type !== "mailbox_starred") - .toggleClass("d-block", type === "mailbox_starred"); - if (inMailbox) { - this.$(".o_mail_discuss_mobile_mailboxes_buttons").removeClass( - "o_hidden" - ); - this.$(".o_mailbox_inbox_item") - .removeClass("btn-primary") - .addClass("btn-secondary"); - this.$(".o_mailbox_inbox_item[data-type=" + type + "]") - .removeClass("btn-secondary") - .addClass("btn-primary"); - } else { - this.$(".o_mail_discuss_mobile_mailboxes_buttons").addClass( - "o_hidden" - ); - } - this.$(".o_mail_mobile_tab").removeClass("active"); - const type_n = type === "mailbox_starred" ? "mailbox_inbox" : type; - this.$(".o_mail_mobile_tab[data-type=" + type_n + "]").addClass( - "active" - ); - }); - }, - _onAddThread: function() { - this.$(".o_mail_add_thread") - .show() - .find("input") - .focus(); - }, - _onClickMobileMailboxItem: function(ev) { - const mailboxID = $(ev.currentTarget).data("type"); - this._setThread(mailboxID); - this._updateContent(this._thread.getID()); - }, - _onClickMobileTab: function(ev) { - const type = $(ev.currentTarget).data("type"); - if (type === "mailbox") { - const inbox = this.call("mail_service", "getMailbox", "inbox"); - this._setThread(inbox); - } - this._updateContent(type); - }, - _onClickMobileMailPreview: function(ev) { - const threadID = $(ev.currentTarget).data("preview-id"); - this.call("mail_service", "openThreadWindow", threadID); - }, -}); - -}); \ No newline at end of file diff --git a/muk_web_theme_mail/static/src/js/keyboard.js b/muk_web_theme_mail/static/src/js/keyboard.js deleted file mode 100644 index dcc52d5..0000000 --- a/muk_web_theme_mail/static/src/js/keyboard.js +++ /dev/null @@ -1,42 +0,0 @@ -/********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme Mail -* (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_theme.KeyboardNavigationMixin', function (require) { -"use strict"; - -var core = require('web.core'); -var config = require("web.config"); -var session = require("web.session"); - -var AbstractWebClient = require('web.AbstractWebClient'); - -var _t = core._t; -var QWeb = core.qweb; - -AbstractWebClient.include({ - _getAllUsedAccessKeys: function () { - return _.union(this._super.apply(this, arguments), ['M', 'T']); - }, -}); - -}); - diff --git a/muk_web_theme_mail/static/src/scss/chatter.scss b/muk_web_theme_mail/static/src/scss/chatter.scss deleted file mode 100644 index 2e6d652..0000000 --- a/muk_web_theme_mail/static/src/scss/chatter.scss +++ /dev/null @@ -1,110 +0,0 @@ - /********************************************************************************** -* -* Copyright (c) 2017-2019 MuK IT GmbH. -* -* This file is part of MuK Backend Theme Mail -* (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_form_view { - @include media-breakpoint-down(sm) { - .o_chatter { - .o_thread_composer { - padding-left: $o-mail-thread-avatar-size * 0.5; - .o_chatter_avatar { - display: none; - } - } - .o_chatter_topbar { - height: auto; - flex-wrap: wrap-reverse; - margin-top: $grid-gutter-width* 0.25; - > .o_topbar_right_area { - max-width: 100%; - min-width: 100%; - flex-basis: 100%; - display: flex; - flex: 1 0 auto; - flex-wrap: wrap; - justify-content: space-between; - border-bottom: 1px solid gray('300'); - .o_followers { - display: initial !important; - margin-bottom: 0; - } - } - > .o_active { - border-top: none; - } - .o_chatter_button_attachment { - margin-right: 5px; - } - } - } - } -} - -.mk_chatter_position_sided { - @include media-breakpoint-up(xxl, $o-extra-grid-breakpoints) { - .o_form_view:not(.o_form_nosheet) > .o_chatter { - .o_chatter_topbar { - top: -1px; - z-index: 2; - height: auto; - position: sticky; - flex-wrap: wrap-reverse; - background-color: $o-view-background-color; - margin-top: $grid-gutter-width* 0.25; - > .o_topbar_right_area { - max-width: 100%; - min-width: 100%; - flex-basis: 100%; - display: flex; - flex: 1 0 auto; - flex-wrap: wrap; - justify-content: space-between; - border-bottom: 1px solid gray('300'); - .o_followers { - margin-bottom: 0; - min-width: 100px; - } - } - > .o_active { - border-top: none; - } - > .btn-link { - border-top: none; - border-bottom: none; - } - .o_chatter_button_attachment { - margin-right: 5px; - } - } - .o_thread_composer { - position: sticky; - border: 1px solid gray('300'); - background-color: $o-view-background-color; - z-index: 1; - top: 68px; - .o_composer_mention_dropdown > .dropdown-menu.show { - top: 100%; - bottom: auto; - } - } - } - } -} \ No newline at end of file diff --git a/muk_web_theme_mail/static/src/xml/discuss.xml b/muk_web_theme_mail/static/src/xml/discuss.xml deleted file mode 100644 index 030f808..0000000 --- a/muk_web_theme_mail/static/src/xml/discuss.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - btn btn-secondary o_mail_discuss_button_multi_user_channel d-md-block d-none - - - - \ No newline at end of file diff --git a/muk_web_theme_mail/static/src/xml/shortcuts.xml b/muk_web_theme_mail/static/src/xml/shortcuts.xml deleted file mode 100644 index bcff3b0..0000000 --- a/muk_web_theme_mail/static/src/xml/shortcuts.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - Open the activities - - Alt + t - - - Control + Alt + t - - - - Open the messages - - Alt + m - - - Control + Alt + m - - - - - - \ No newline at end of file diff --git a/muk_web_theme_mail/static/src/xml/systray.xml b/muk_web_theme_mail/static/src/xml/systray.xml deleted file mode 100644 index facfb9f..0000000 --- a/muk_web_theme_mail/static/src/xml/systray.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/muk_web_theme_mail/template/assets.xml b/muk_web_theme_mail/template/assets.xml deleted file mode 100644 index 4ff1515..0000000 --- a/muk_web_theme_mail/template/assets.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -