@ -0,0 +1,41 @@ |
|||||
|
Chameleon Multi color Backend Theme |
||||
|
=================================== |
||||
|
|
||||
|
Backend Theme. |
||||
|
|
||||
|
Depends |
||||
|
======= |
||||
|
[website] addon Odoo |
||||
|
[portal] addon Odoo |
||||
|
[web_responsive] addon Odoo |
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
- www.odoo.com/documentation/14.0/setup/install.html |
||||
|
- Install our Theme |
||||
|
|
||||
|
Bug Tracker |
||||
|
=========== |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
* Cybrosys Techno Solutions <https://www.cybrosys.com> |
||||
|
|
||||
|
Author |
||||
|
------ |
||||
|
Cybrosys Technologies <odoo@cybrosys.com> |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Linto CT |
||||
|
* Sanjith Rashin |
||||
|
* V14 Dino |
||||
|
|
||||
|
Maintainer |
||||
|
---------- |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit https://www.cybrosys.com. |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>) |
||||
|
# you can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import models |
||||
|
from . import controllers |
@ -0,0 +1,58 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>) |
||||
|
# you can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
{ |
||||
|
"name": "Chameleon Multi Color Backend Theme", |
||||
|
"summary": "Configurable multi color backend theme for Odoo 14", |
||||
|
"version": "14.0.1.0.0", |
||||
|
"category": "Theme/Backend", |
||||
|
"website": "https://www.cybrosys.com", |
||||
|
"description": """ |
||||
|
Configurable multi color backend theme for Odoo 14 |
||||
|
""", |
||||
|
'images': [ |
||||
|
'static/description/banner.png', |
||||
|
'static/description/theme_screenshot.jpg', |
||||
|
], |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
"depends": [ |
||||
|
'website', |
||||
|
'portal', |
||||
|
'web_responsive', |
||||
|
'mail' |
||||
|
], |
||||
|
"data": [ |
||||
|
'security/ir.model.access.csv', |
||||
|
'data/theme_data.xml', |
||||
|
'views/assets.xml', |
||||
|
'views/login_templates.xml', |
||||
|
], |
||||
|
'qweb': [ |
||||
|
'static/src/xml/base_ext.xml', |
||||
|
'static/src/xml/sidebar_menu_icon.xml', |
||||
|
'static/src/xml/systray_ext.xml', |
||||
|
], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>) |
||||
|
# you can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import main |
@ -0,0 +1,37 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>) |
||||
|
# you can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
import json |
||||
|
|
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
class LoginPage(http.Controller): |
||||
|
@http.route(['/active_theme'], auth='public', type='http') |
||||
|
def find_active_theme(self): |
||||
|
active_theme = request.env['theme.config'].search_read( |
||||
|
domain=[('theme_active', '=', True)], |
||||
|
fields=['theme_main_color', |
||||
|
'view_font_color', |
||||
|
'theme_font_color']) |
||||
|
active_theme = active_theme[0] if active_theme else [] |
||||
|
print("active_theme_from cont",active_theme) |
||||
|
return json.dumps(active_theme) |
@ -0,0 +1,6 @@ |
|||||
|
## Module <multicolor_backend_theme> |
||||
|
|
||||
|
#### 25.05.2021 |
||||
|
#### Version 14.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial commit |
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (<https://www.cybrosys.com>) |
||||
|
# you can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# 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 (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from . import theme_config |
|
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 715 KiB |
After Width: | Height: | Size: 8.9 MiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 152 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 715 KiB |
@ -0,0 +1,52 @@ |
|||||
|
.img-upload-btn { |
||||
|
position: relative; |
||||
|
overflow: hidden; |
||||
|
padding-top: 95%; |
||||
|
} |
||||
|
|
||||
|
.img-upload-btn input[type=file] { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
min-width: 100%; |
||||
|
min-height: 100%; |
||||
|
font-size: 100px; |
||||
|
text-align: right; |
||||
|
filter: alpha(opacity=0); |
||||
|
opacity: 0; |
||||
|
outline: none; |
||||
|
background: white; |
||||
|
cursor: inherit; |
||||
|
display: block; |
||||
|
} |
||||
|
|
||||
|
.img-upload-btn i { |
||||
|
position: absolute; |
||||
|
height: 16px; |
||||
|
width: 16px; |
||||
|
top: 50%; |
||||
|
left: 50%; |
||||
|
margin-top: -8px; |
||||
|
margin-left: -8px; |
||||
|
} |
||||
|
|
||||
|
.btn-radio { |
||||
|
position: relative; |
||||
|
overflow: hidden; |
||||
|
} |
||||
|
|
||||
|
.btn-radio input[type=radio] { |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
min-width: 100%; |
||||
|
min-height: 100%; |
||||
|
font-size: 100px; |
||||
|
text-align: right; |
||||
|
filter: alpha(opacity=0); |
||||
|
opacity: 0; |
||||
|
outline: none; |
||||
|
background: white; |
||||
|
cursor: inherit; |
||||
|
display: block; |
||||
|
} |
After Width: | Height: | Size: 106 KiB |
@ -0,0 +1,94 @@ |
|||||
|
(function ($) { |
||||
|
|
||||
|
$.fn.imagePicker = function (options) { |
||||
|
|
||||
|
// Define plugin options
|
||||
|
var settings = $.extend({ |
||||
|
// Input name attribute
|
||||
|
name: "", |
||||
|
// Classes for styling the input
|
||||
|
class: "form-control btn btn-default btn-block", |
||||
|
// Icon which displays in center of input
|
||||
|
icon: "fa fa-plus" |
||||
|
}, options); |
||||
|
|
||||
|
// Create an input inside each matched element
|
||||
|
return this.each(function () { |
||||
|
$(this).html(create_btn(this, settings)); |
||||
|
}); |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
// Private function for creating the input element
|
||||
|
function create_btn(that, settings) { |
||||
|
// The input icon element
|
||||
|
var picker_btn_icon = $('<i class="' + settings.icon + '"></i>'); |
||||
|
|
||||
|
if (settings.remove != true && settings.widget.active_theme.sidebar_image) { |
||||
|
var picker_btn_input = create_preview( |
||||
|
that, |
||||
|
settings.widget.active_theme.sidebar_image, |
||||
|
settings); |
||||
|
var picker_btn = picker_btn_input; |
||||
|
} |
||||
|
else { |
||||
|
// The actual file input which stays hidden
|
||||
|
var picker_btn_input = $('<input type="file" name="' + settings.name + '" />'); |
||||
|
var picker_btn = $('<div class="' + settings.class + ' img-upload-btn"></div>') |
||||
|
.append(picker_btn_icon) |
||||
|
.append(picker_btn_input); |
||||
|
} |
||||
|
// The actual element displayed
|
||||
|
|
||||
|
|
||||
|
// File load listener
|
||||
|
picker_btn_input.change(function () { |
||||
|
if ($(this).prop('files')[0]) { |
||||
|
// Use FileReader to get file
|
||||
|
var reader = new FileReader(); |
||||
|
|
||||
|
// Create a preview once image has loaded
|
||||
|
reader.onload = function (e) { |
||||
|
var preview = create_preview(that, e.target.result, settings); |
||||
|
$(that).html(preview); |
||||
|
settings.widget._onImageLoad(e.target.result); |
||||
|
}; |
||||
|
|
||||
|
// Load image
|
||||
|
reader.readAsDataURL(picker_btn_input.prop('files')[0]); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
return picker_btn |
||||
|
}; |
||||
|
|
||||
|
// Private function for creating a preview element
|
||||
|
function create_preview(that, src, settings) { |
||||
|
|
||||
|
// The preview image
|
||||
|
var picker_preview_image = $('<img src="' + src + '" class="img-responsive img-rounded" />'); |
||||
|
|
||||
|
// The remove image button
|
||||
|
var picker_preview_remove = $('<button class="btn btn-link fa fa-trash-o"><small></small></button>'); |
||||
|
|
||||
|
// The preview element
|
||||
|
var picker_preview = $('<div class="image-container"></div>') |
||||
|
.append(picker_preview_image) |
||||
|
.append(picker_preview_remove); |
||||
|
|
||||
|
// Remove image listener
|
||||
|
picker_preview_remove.click(function () { |
||||
|
settings.remove = true; |
||||
|
var btn = create_btn(that, settings); |
||||
|
$(that).html(btn); |
||||
|
settings.widget._onRemoveImage(); |
||||
|
}); |
||||
|
|
||||
|
return picker_preview; |
||||
|
}; |
||||
|
|
||||
|
}(jQuery)); |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
$('.img-picker').imagePicker({name: 'images'}); |
||||
|
}); |
@ -0,0 +1,23 @@ |
|||||
|
odoo.define('multicolor_backend_theme.LoginPage', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var rpc = require('web.rpc'); |
||||
|
|
||||
|
var selected_theme = {}; |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
$.ajax({ |
||||
|
url: '/active_theme', |
||||
|
type: 'get', |
||||
|
}).then(function (result) { |
||||
|
var colors = JSON.parse(result); |
||||
|
$('.cybro-login-btn').css({ |
||||
|
'background-color': colors.theme_main_color, |
||||
|
'color': colors.theme_font_color |
||||
|
}); |
||||
|
$('.cybro-super-btn').css({ |
||||
|
'color': colors.view_font_color |
||||
|
}); |
||||
|
}); |
||||
|
}); |
||||
|
}); |
@ -0,0 +1,27 @@ |
|||||
|
odoo.define('multicolor_backend_theme.sidebar', function (require) { |
||||
|
'use strict'; |
||||
|
|
||||
|
var AppsMenu = require("web.AppsMenu"); |
||||
|
var core = require('web.core'); |
||||
|
var QWeb = core.qweb; |
||||
|
var session = require('web.session'); |
||||
|
|
||||
|
AppsMenu.include({ |
||||
|
init: function (parent, menuData) { |
||||
|
this.user_id = session.uid; |
||||
|
this.session = session; |
||||
|
this._super.apply(this, arguments); |
||||
|
|
||||
|
var sidebar = QWeb.render('AppsMenuSidebar',{ |
||||
|
widget:this |
||||
|
}); |
||||
|
$('.cybro-sidebar').html(sidebar); |
||||
|
$(".sidebar-menus a").on('click', function(){ |
||||
|
$(this).siblings().removeClass('active'); |
||||
|
$(this).addClass('active') |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
}); |
||||
|
}); |
@ -0,0 +1,693 @@ |
|||||
|
odoo.define('multicolor_backend_theme.ThemeMenu', function (require) { |
||||
|
"use strict"; |
||||
|
// console.log("ThemeMenu");
|
||||
|
|
||||
|
var core = require('web.core'); |
||||
|
var session = require('web.session'); |
||||
|
var SystrayMenu = require('web.SystrayMenu'); |
||||
|
var Widget = require('web.Widget'); |
||||
|
var QWeb = core.qweb; |
||||
|
var _t = core._t; |
||||
|
var rpc = require('web.rpc'); |
||||
|
var allowedExtensions = /(\.jpg|\.jpeg)$/i; |
||||
|
var ControlPanel = require('web.ControlPanel'); |
||||
|
var DropdownMenu = require('web.DropdownMenu'); |
||||
|
var FormRenderer = require('web.FormRenderer'); |
||||
|
var ListRenderer = require('web.ListRenderer'); |
||||
|
var KanbanRenderer = require('web.KanbanRenderer'); |
||||
|
var KanbanRecord = require('web.KanbanRecord'); |
||||
|
var Menu = require('web.Menu'); |
||||
|
var AbstractController = require('web.AbstractController'); |
||||
|
var Loading = require('web.Loading'); |
||||
|
var utils = require('web.utils'); |
||||
|
var Chatter = require('mail/static/src/components/chatter/chatter.js'); |
||||
|
|
||||
|
|
||||
|
var AppsMenu = require("web.AppsMenu"); |
||||
|
const Discuss = require('mail/static/src/widgets/discuss/discuss.js'); |
||||
|
|
||||
|
var web_settings_dashboard = require("website.backend.dashboard"); |
||||
|
|
||||
|
var selected_theme = {}; |
||||
|
var themes_to_update = {}; |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'search_read', |
||||
|
domain: [['theme_active', '=', true]], |
||||
|
}).then(function (res) { |
||||
|
var index_str = -1 |
||||
|
if (res[0].sidebar_image){ |
||||
|
index_str= res[0].sidebar_image.indexOf('dataimage/jpegbase64') |
||||
|
} |
||||
|
var res_theme = '' |
||||
|
if (index_str > -1){ |
||||
|
res_theme = res[0].sidebar_image.replace('dataimage/jpegbase64','data:image/jpeg;base64,') |
||||
|
} |
||||
|
else{ |
||||
|
res_theme = res[0].sidebar_image |
||||
|
} |
||||
|
res[0].sidebar_image = res_theme |
||||
|
|
||||
|
selected_theme = res_theme; |
||||
|
}); |
||||
|
}); |
||||
|
var Temple = Widget.extend({ |
||||
|
name: 'activity_menu', |
||||
|
template:'multicolor_backend_theme.systray.ThemeMenu', |
||||
|
events: { |
||||
|
'click .themes_selector_button': '_onThemeSelectorClick', |
||||
|
'change .theme_select': '_onThemeClick', |
||||
|
'click .button-create': '_onThemeCreate', |
||||
|
'click .button-remove': '_onThemeRemove', |
||||
|
'click .button-apply': '_onThemeApply', |
||||
|
'click .row.name i.fa-pencil': '_onNameEdit', |
||||
|
'click .row.name i.fa-check': '_onNameSave', |
||||
|
'change .row.name input#name': '_onNameSave', |
||||
|
'keyup .row.name input#name': '_onNameChange' |
||||
|
}, |
||||
|
start:function(){ |
||||
|
this._loadDefaults(); |
||||
|
this._apply_theme(); |
||||
|
if (session.is_admin == false) { |
||||
|
$('.themes_selector_button').css('display', 'none'); |
||||
|
} |
||||
|
return this._super(); |
||||
|
}, |
||||
|
init: function (parent) { |
||||
|
this.theme_data = {}; |
||||
|
this.selected_theme = {}; |
||||
|
this.themes_by_id = {}; |
||||
|
return this._super.apply(this, arguments); |
||||
|
}, |
||||
|
willStart: function () { |
||||
|
var self = this; |
||||
|
var get_them_data = rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'search_read', |
||||
|
args: [] |
||||
|
}); |
||||
|
console.log("get_them_data",get_them_data) |
||||
|
return $.when(get_them_data).then(function (theme_data) { |
||||
|
self.theme_data = theme_data; |
||||
|
for (var i in theme_data) { |
||||
|
|
||||
|
if (theme_data[i].theme_active == true) { |
||||
|
|
||||
|
self.selected_theme = theme_data[i]; |
||||
|
selected_theme = theme_data[i]; |
||||
|
} |
||||
|
self.themes_by_id[theme_data[i].id] = theme_data[i]; |
||||
|
} |
||||
|
if (!self.selected_theme) { |
||||
|
self.selected_theme = theme_data[0]; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
_loadDefaults: function () { |
||||
|
var self = this; |
||||
|
var item_theme = '' |
||||
|
var theme = '' |
||||
|
|
||||
|
if(self.themes_by_id[$('.theme_select').val()] != undefined){ |
||||
|
item_theme = self.themes_by_id[$('.theme_select').val()] |
||||
|
var index_of = -1 |
||||
|
if (item_theme.sidebar_image){ |
||||
|
index_of = item_theme.sidebar_image.indexOf('dataimage/jpegbase64') |
||||
|
} |
||||
|
if (index_of > -1){ |
||||
|
theme = item_theme.sidebar_image.replace('dataimage/jpegbase64','data:image/jpeg;base64,') |
||||
|
} |
||||
|
else{ |
||||
|
theme = item_theme.sidebar_image |
||||
|
} |
||||
|
item_theme.sidebar_image = theme |
||||
|
} |
||||
|
self.active_theme = item_theme |
||||
|
$('.img-picker').imagePicker({ |
||||
|
name: 'images', |
||||
|
widget: self |
||||
|
}); |
||||
|
// console.log("name image",self)
|
||||
|
var color_el = [ |
||||
|
'theme_main_color', |
||||
|
'theme_font_color', |
||||
|
'view_font_color' |
||||
|
]; |
||||
|
for (var i in color_el) { |
||||
|
var el_color = self.selected_theme[color_el[i]]; |
||||
|
$('#' + color_el[i]).loads({ |
||||
|
layout: 'hex', |
||||
|
flat: false, |
||||
|
enableAlpha: false, |
||||
|
color: el_color, |
||||
|
onSubmit: function(ev) { |
||||
|
var el_id = $(ev.el).attr('id'); |
||||
|
$('#'+el_id).css('background-color', '#' + ev.hex); |
||||
|
$('#'+el_id).val("#" + ev.hex); |
||||
|
$('#'+el_id).hides(); |
||||
|
self._onchangeColor($(ev.el), ev.hex); |
||||
|
}, |
||||
|
onLoaded: function(ev) { |
||||
|
$('.picker').css('color', 'green'); |
||||
|
}, |
||||
|
onChange: function(ev) { |
||||
|
var el_id = $(ev.el).attr('id'); |
||||
|
//$('#'+el_id).css('background-color', '#' + ev.hex);
|
||||
|
$('#'+el_id).setColor(ev.hex, false); |
||||
|
$('.picker').css('color', 'red'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
return; |
||||
|
}, |
||||
|
_onNameEdit: function () { |
||||
|
$('.row.name #name').removeAttr('readonly'); |
||||
|
$('.row.name #name').css('background-color', 'rgb(238, 250, 239)'); |
||||
|
}, |
||||
|
_onRemoveImage: function () { |
||||
|
//this._updateActiveTheme();
|
||||
|
this.themes_by_id[$('.theme_select').val()].sidebar_image = ''; |
||||
|
if (this.themes_by_id[$('.theme_select').val()].theme_active == true) { |
||||
|
this.selected_theme.sidebar_image = ''; |
||||
|
} |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'write', |
||||
|
args: [ |
||||
|
parseInt($('.theme_select').val()), |
||||
|
{'sidebar_image': ''} |
||||
|
] |
||||
|
}).then(function () { |
||||
|
$('.button-apply.fa-check').css('color', 'green'); |
||||
|
themes_to_update[$('.theme_select').val()] = true; |
||||
|
}); |
||||
|
}, |
||||
|
_onNameSave: function () { |
||||
|
var name_inp = $('.row.name input#name').val().trim(); |
||||
|
if (this.themes_by_id[$('.theme_select').val()].theme_active == true) { |
||||
|
this.selected_theme.name = name_inp; |
||||
|
} |
||||
|
//this.selected_theme.name = name_inp;
|
||||
|
this.themes_by_id[$('.theme_select').val()].name = name_inp; |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'write', |
||||
|
args: [ |
||||
|
parseInt($('.theme_select').val()), |
||||
|
{'name': name_inp} |
||||
|
] |
||||
|
}).then(function () { |
||||
|
$('.button-apply.fa-check').css('color', 'green'); |
||||
|
themes_to_update[$('.theme_select').val()] = true; |
||||
|
}); |
||||
|
$('.row.name #name').attr('readonly', 'readonly'); |
||||
|
$('.row.name #name').css('background-color', 'white'); |
||||
|
$('.row.name i').replaceWith( |
||||
|
"<i class='fa fa-pencil'/>" |
||||
|
); |
||||
|
$('option#' + $('.theme_select').val()).text(name_inp); |
||||
|
}, |
||||
|
_onNameChange: function () { |
||||
|
$('.button-apply.fa-check').css('color', 'red'); |
||||
|
delete themes_to_update[$('.theme_select').val()]; |
||||
|
var name_inp = $('.row.name input#name').val().trim(); |
||||
|
if (name_inp && (this.themes_by_id[$('.theme_select').val()].name != name_inp)) { |
||||
|
$('.row.name i').replaceWith( |
||||
|
"<i class='fa fa-check'/>" |
||||
|
); |
||||
|
} |
||||
|
}, |
||||
|
_onThemeSelectorClick: function () { |
||||
|
$('.themes_selector').toggleClass('show'); |
||||
|
$('.row.name #name').attr('readonly', 'readonly'); |
||||
|
$('.row.name #name').css('background-color', 'white'); |
||||
|
}, |
||||
|
_onImageLoad: function (img_data) { |
||||
|
this._onchangeColor("image", img_data); |
||||
|
}, |
||||
|
_onchangeColor: function (element, data) { |
||||
|
var $apply = $('.button-apply.fa-check'); |
||||
|
|
||||
|
var current_theme = this.themes_by_id[$('.theme_select').val()]; |
||||
|
if (element == "image") { |
||||
|
$apply.css('color', 'red'); |
||||
|
delete themes_to_update[$('.theme_select').val()]; |
||||
|
console.log("data on change",data) |
||||
|
current_theme.sidebar_image = data; |
||||
|
this.themes_by_id[current_theme.id].sidebar_image = data; |
||||
|
console.log("data",data) |
||||
|
var index_str= data.indexOf('dataimage/jpegbase64') |
||||
|
if (index_str > -1){ |
||||
|
var img_data = data.replace('dataimage/jpegbase64','data:image/jpeg;base64,') |
||||
|
} |
||||
|
else{ |
||||
|
img_data = data |
||||
|
} |
||||
|
var vals = { |
||||
|
'sidebar_image': img_data, |
||||
|
'theme_id': current_theme.id, |
||||
|
}; |
||||
|
console.log("vals",data) |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'update_image', |
||||
|
args: [vals] |
||||
|
}).then(function () { |
||||
|
$apply.css('color', 'green'); |
||||
|
themes_to_update[$('.theme_select').val()] = true; |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
else if ('#' + data != current_theme[element.attr('id')]) { |
||||
|
$apply.css('color', 'red'); |
||||
|
current_theme[element.attr('id')] = '#' + data; |
||||
|
this.themes_by_id[current_theme.id][element.attr('id')] = '#' + data; |
||||
|
var el_id = element.attr('id'); |
||||
|
var vals = { |
||||
|
'theme_id': current_theme.id, |
||||
|
'key': el_id, |
||||
|
'value': data |
||||
|
}; |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'update_color', |
||||
|
args: [vals] |
||||
|
}).then(function () { |
||||
|
$apply.css('color', 'green'); |
||||
|
}); |
||||
|
} |
||||
|
return; |
||||
|
}, |
||||
|
_onThemeClick: function () { |
||||
|
// console.log("click wrk",multicolor_backend_theme.selected_theme)
|
||||
|
var $theme_el = QWeb.render( |
||||
|
'multicolor_backend_theme.selected_theme', { |
||||
|
widget: { |
||||
|
selected_theme: this.themes_by_id[$('.theme_select').val()] |
||||
|
} |
||||
|
}); |
||||
|
$('div.theme_data').replaceWith($($theme_el)); |
||||
|
this._loadDefaults(); |
||||
|
if (themes_to_update[$('.theme_select').val()] == true) { |
||||
|
$('.button-apply.fa-check').css('color', 'green'); |
||||
|
} |
||||
|
else { |
||||
|
$('.button-apply.fa-check').css('color', '#4c4c4c'); |
||||
|
} |
||||
|
}, |
||||
|
_onThemeCreate: function () { |
||||
|
var self = this; |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'create_new_theme' |
||||
|
}).then(function (result) { |
||||
|
self._updateThemeData(result[1]); |
||||
|
var theme_el = QWeb.render( |
||||
|
'multicolor_backend_theme.selected_theme', { |
||||
|
widget: { |
||||
|
selected_theme: self.themes_by_id[result[0]] |
||||
|
} |
||||
|
}); |
||||
|
$('div.theme_data').replaceWith($(theme_el)); |
||||
|
|
||||
|
var opt_el = "<option value='"+result[0]+"' >" + |
||||
|
self.themes_by_id[result[0]].name + "</option>"; |
||||
|
$('.theme_select').append($(opt_el)); |
||||
|
$('.theme_select').val(result[0]); |
||||
|
self._loadDefaults(); |
||||
|
}); |
||||
|
}, |
||||
|
_onThemeRemove: function () { |
||||
|
var self = this; |
||||
|
var curr_theme = $('.theme_select').val(); |
||||
|
var theme_rec = this.themes_by_id[curr_theme]; |
||||
|
if (theme_rec.theme_active == true) { |
||||
|
alert("You cannot delete an active theme.") |
||||
|
} |
||||
|
else { |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'check_for_removal', |
||||
|
args: [curr_theme] |
||||
|
}).then(function (theme_data) { |
||||
|
if (theme_data) { |
||||
|
self._updateThemeData(theme_data); |
||||
|
|
||||
|
var theme_el = QWeb.render( |
||||
|
'multicolor_backend_theme.selected_theme', { |
||||
|
widget: self |
||||
|
}); |
||||
|
$('div.theme_data').replaceWith($(theme_el)); |
||||
|
$(".theme_select option[value='" + theme_rec.id + "']").remove(); |
||||
|
$(".theme_select").val(self.selected_theme.id); |
||||
|
self._loadDefaults(); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
_onThemeApply: function () { |
||||
|
var curr_theme_id = $('.theme_select').val(); |
||||
|
rpc.query({ |
||||
|
model: 'theme.config', |
||||
|
method: 'update_active_theme', |
||||
|
args: [curr_theme_id] |
||||
|
}).then(function () { |
||||
|
window.location.reload(); |
||||
|
}); |
||||
|
}, |
||||
|
_updateThemeData: function (theme_data) { |
||||
|
this.themes_by_id = {}; |
||||
|
this.theme_data = theme_data; |
||||
|
for (var i in theme_data) { |
||||
|
this.themes_by_id[theme_data[i].id] = theme_data[i]; |
||||
|
console.log("theme_by_id",this.themes_by_id[theme_data[i].id]) |
||||
|
} |
||||
|
return; |
||||
|
}, |
||||
|
|
||||
|
_apply_theme: function () { |
||||
|
if (this.selected_theme) { |
||||
|
// change control panel background-color
|
||||
|
$('nav.o_main_navbar').css('background-color', |
||||
|
this.selected_theme.theme_main_color); |
||||
|
// control panel menu() color
|
||||
|
$('.o_main_navbar > .o_menu_brand').css( |
||||
|
'color', |
||||
|
this.selected_theme.theme_font_color); |
||||
|
$('.o_onboarding.o_onboarding_violet .o_onboarding_wrap').css( |
||||
|
'background-color', |
||||
|
this.selected_theme.theme_main_color); |
||||
|
var index_of = -1 |
||||
|
if (this.selected_theme.sidebar_image){ |
||||
|
index_of = this.selected_theme.sidebar_image.indexOf('dataimage/jpegbase64') |
||||
|
} |
||||
|
var img = '' |
||||
|
if (index_of > -1){ |
||||
|
img = this.selected_theme.sidebar_image.replace('dataimage/jpegbase64','data:image/jpeg;base64,') |
||||
|
} |
||||
|
else{ |
||||
|
img = this.selected_theme.sidebar_image |
||||
|
} |
||||
|
|
||||
|
$('.sidebar-overlay-image').append( |
||||
|
"<img src='" + img + "'/>"); |
||||
|
// console.log("sidebar_img",this.selected_theme.sidebar_image.replace('dataimage/jpegbase64','data:image/jpeg;base64,'))
|
||||
|
$('.cybro-main-menu .input-group-text').css({ |
||||
|
'background-color': this.selected_theme.theme_main_color, |
||||
|
'border-color': this.selected_theme.theme_main_color, |
||||
|
'color': this.selected_theme.theme_font_color, |
||||
|
}); |
||||
|
|
||||
|
$('.o_loading').css({ |
||||
|
'background-color': this.selected_theme.theme_main_color, |
||||
|
'color': this.selected_theme.theme_font_color, |
||||
|
}); |
||||
|
$('.btn-primary').css({ |
||||
|
'background-color': this.selected_theme.theme_main_color, |
||||
|
'color': this.selected_theme.theme_font_color, |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}); |
||||
|
Discuss.include({ |
||||
|
_onDiscussItemClicked: function (ev) { |
||||
|
console.log("Discus.include") |
||||
|
this._super(ev); |
||||
|
this.$('.o_mail_discuss_title_main').css({ |
||||
|
'box-shadow': 'none', |
||||
|
}); |
||||
|
this.$('.o_mail_discuss_title_main.o_active').css({ |
||||
|
'box-shadow': 'inset 3px 0 0 ' + selected_theme.theme_main_color, |
||||
|
}); |
||||
|
}, |
||||
|
_renderSidebar: function (options) { |
||||
|
console.log("options",options) |
||||
|
console.log("poiiuytr") |
||||
|
var res = this._super(options); |
||||
|
res.find('.o_mail_discuss_title_main').css({ |
||||
|
'box-shadow': 'none', |
||||
|
}); |
||||
|
res.find('.o_mail_discuss_title_main.o_active').css({ |
||||
|
'box-shadow': 'inset 3px 0 0 ' + selected_theme.theme_main_color, |
||||
|
}); |
||||
|
|
||||
|
return res; |
||||
|
}, |
||||
|
}); |
||||
|
// web_settings_dashboard.DashboardApps.include({
|
||||
|
// start: function () {
|
||||
|
// console.log("errorororo")
|
||||
|
// this._super.apply(this, arguments);
|
||||
|
// this.$el.find('a').css({
|
||||
|
// 'color': selected_theme.view_font_color,
|
||||
|
// });
|
||||
|
// this.$el.find('.btn-primary').css({
|
||||
|
// 'background-color': selected_theme.theme_main_color,
|
||||
|
// 'color': selected_theme.theme_font_color,
|
||||
|
// });
|
||||
|
// }
|
||||
|
// });
|
||||
|
// web_settings_dashboard.DashboardInvitations.include({
|
||||
|
// start: function () {
|
||||
|
// this._super.apply(this, arguments);
|
||||
|
// this.$el.find('a').css({
|
||||
|
// 'color': selected_theme.view_font_color,
|
||||
|
// });
|
||||
|
// this.$el.find('.btn-primary').css({
|
||||
|
// 'background-color': selected_theme.theme_main_color,
|
||||
|
// 'color': selected_theme.theme_font_color,
|
||||
|
// });
|
||||
|
// }
|
||||
|
// });
|
||||
|
// web_settings_dashboard.DashboardShare.include({
|
||||
|
// start: function () {
|
||||
|
// this._super.apply(this, arguments);
|
||||
|
// this.$el.find('a').css({
|
||||
|
// 'color': selected_theme.view_font_color,
|
||||
|
// });
|
||||
|
// this.$el.find('.btn-primary').css({
|
||||
|
// 'background-color': selected_theme.theme_main_color,
|
||||
|
// 'color': selected_theme.theme_font_color,
|
||||
|
// });
|
||||
|
// }
|
||||
|
// });
|
||||
|
// web_settings_dashboard.DashboardTranslations.include({
|
||||
|
// start: function () {
|
||||
|
// this._super.apply(this, arguments);
|
||||
|
// this.$el.find('a').css({
|
||||
|
// 'color': selected_theme.view_font_color,
|
||||
|
// });
|
||||
|
// this.$el.find('.btn-primary').css({
|
||||
|
// 'background-color': selected_theme.theme_main_color,
|
||||
|
// 'color': selected_theme.theme_font_color,
|
||||
|
// });
|
||||
|
// }
|
||||
|
// });
|
||||
|
// web_settings_dashboard.DashboardCompany.include({
|
||||
|
// start: function () {
|
||||
|
// this._super.apply(this, arguments);
|
||||
|
// this.$el.find('a').css({
|
||||
|
// 'color': selected_theme.view_font_color,
|
||||
|
// });
|
||||
|
// this.$el.find('.btn-primary').css({
|
||||
|
// 'background-color': selected_theme.theme_main_color,
|
||||
|
// 'color': selected_theme.theme_font_color,
|
||||
|
// });
|
||||
|
// }
|
||||
|
// });
|
||||
|
Loading.include({ |
||||
|
on_rpc_event : function(increment) { |
||||
|
if (selected_theme) { |
||||
|
this.$el.css({ |
||||
|
'background-color': selected_theme.theme_main_color, |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
} |
||||
|
this._super(increment); |
||||
|
} |
||||
|
}); |
||||
|
SystrayMenu.Items.push(Temple); |
||||
|
ControlPanel.include({ |
||||
|
_update_search_view: function (searchview, isHidden, groupable, enableTimeRangeMenu) { |
||||
|
this._super(searchview, isHidden, groupable, enableTimeRangeMenu); |
||||
|
if (selected_theme) { |
||||
|
this.$('span.o_searchview_more').css({ |
||||
|
background: selected_theme.theme_main_color, |
||||
|
color: selected_theme.theme_font_color |
||||
|
}); |
||||
|
this.$('.o_searchview .o_searchview_facet .o_searchview_facet_label').css({ |
||||
|
'background-color': selected_theme.theme_main_color |
||||
|
}); |
||||
|
this.$('.o_searchview .o_searchview_input_container .o_searchview_facet .o_searchview_facet_label').css({ |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
// button properties
|
||||
|
this.$('.btn-primary').css({ |
||||
|
'background-color': selected_theme.theme_main_color, |
||||
|
'border-color': selected_theme.theme_main_color, |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
|
||||
|
this.$('.btn-primary:hover').css({ |
||||
|
'background-color': selected_theme.theme_main_color, |
||||
|
'border-color': selected_theme.theme_main_color, |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
update: function (status, options) { |
||||
|
// console.log("update")
|
||||
|
this._super(status, options); |
||||
|
this.$('button.o_dropdown_toggler_btn.btn.btn-secondary.dropdown-toggle').css({ |
||||
|
'background-color': selected_theme.theme_main_color, |
||||
|
'border-color': selected_theme.theme_main_color, |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
}, |
||||
|
/** |
||||
|
* Private function that renders a breadcrumbs' li Jquery element |
||||
|
*/ |
||||
|
_render_breadcrumbs_li: function (bc, index, length) { |
||||
|
var $bc = this._super(bc, index, length); |
||||
|
$bc.find('a').css({ |
||||
|
'color': selected_theme.view_font_color |
||||
|
}); |
||||
|
return $bc; |
||||
|
} |
||||
|
}); |
||||
|
FormRenderer.include({ |
||||
|
_renderTagSheet: function (node) { |
||||
|
var sheet = this._super(node); |
||||
|
sheet.find('.fa, .o_stat_value').css( |
||||
|
'color', selected_theme.view_font_color); |
||||
|
return sheet; |
||||
|
}, |
||||
|
_renderHeaderButtons: function (node) { |
||||
|
var buttons_obj = this._super(node); |
||||
|
buttons_obj.find('.btn-primary').css({ |
||||
|
'background-color': selected_theme.theme_main_color, |
||||
|
'border-color': selected_theme.theme_main_color, |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
buttons_obj.find('.btn-primary:hover').css({ |
||||
|
'background-color': selected_theme.theme_main_color, |
||||
|
'border-color': selected_theme.theme_main_color, |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
|
||||
|
return buttons_obj; |
||||
|
}, |
||||
|
_renderTagHeader: function (node) { |
||||
|
var statusbar_el = this._super(node); |
||||
|
statusbar_el.find('button.btn.o_arrow_button.btn-primary.disabled').css({ |
||||
|
'color': selected_theme.view_font_color |
||||
|
}); |
||||
|
return statusbar_el; |
||||
|
}, |
||||
|
_renderTagForm: function (node) { |
||||
|
var $res = this._super(node); |
||||
|
|
||||
|
$res.find('a').css( |
||||
|
'color', selected_theme.view_font_color); |
||||
|
$res.find('.o_field_widget.o_field_many2one .o_external_button').css( |
||||
|
'color', selected_theme.view_font_color); |
||||
|
$res.find('.btn-primary').css( |
||||
|
'background-color', selected_theme.theme_main_color); |
||||
|
$res.find('.btn-primary').css( |
||||
|
'color', selected_theme.theme_font_color); |
||||
|
|
||||
|
return $res; |
||||
|
}, |
||||
|
}); |
||||
|
ListRenderer.include({ |
||||
|
setRowMode: function (recordID, mode) { |
||||
|
var self = this; |
||||
|
return this._super(recordID, mode).then(function () { |
||||
|
self.$('.o_external_button').css('color', selected_theme.view_font_color); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
KanbanRenderer.include({ |
||||
|
_renderView: function () { |
||||
|
return this._super().then(function () { |
||||
|
$('.btn-primary').css('background-color', |
||||
|
selected_theme.theme_main_color); |
||||
|
$('.btn-primary').css('color', |
||||
|
selected_theme.theme_font_color); |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
KanbanRecord.include({ |
||||
|
_render: function () { |
||||
|
var self = this; |
||||
|
return this._super().then(function () { |
||||
|
self.$el.find('.o_kanban_image_fill_left.d-none.d-md-block').css({ |
||||
|
'border': '2px solid ' + selected_theme.theme_main_color |
||||
|
}); |
||||
|
self.$el.find('.o_field_widget.badge.badge-primary').css({ |
||||
|
'background': selected_theme.theme_main_color |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
Chatter.include({ |
||||
|
_render: function (def) { |
||||
|
var self = this; |
||||
|
console.log("chaaaaaaaaaaaa") |
||||
|
return this._super(def).then(function () { |
||||
|
self.$('.btn-link').css('color', selected_theme.view_font_color); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
DropdownMenu.include({ |
||||
|
_renderMenuItems: function () { |
||||
|
this._super(); |
||||
|
if (selected_theme) { |
||||
|
$('span.o_searchview_more').css({ |
||||
|
background: selected_theme.theme_main_color, |
||||
|
color: selected_theme.theme_font_color |
||||
|
}); |
||||
|
$('.o_searchview .o_searchview_facet .o_searchview_facet_label').css({ |
||||
|
'background-color': selected_theme.theme_main_color |
||||
|
}); |
||||
|
$('.o_searchview .o_searchview_input_container .o_searchview_facet .o_searchview_facet_label').css({ |
||||
|
'color': selected_theme.theme_font_color |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
|
Menu.include({ |
||||
|
change_menu_section: function (primary_menu_id) { |
||||
|
this._super(primary_menu_id); |
||||
|
// control panel icon and font color
|
||||
|
this.$('.o_main_navbar > ul > li > a, .o_main_navbar > ul > li > label').css( |
||||
|
'color', |
||||
|
selected_theme.theme_font_color); |
||||
|
} |
||||
|
}); |
||||
|
AbstractController.include({ |
||||
|
_renderBanner: function () { |
||||
|
var self = this; |
||||
|
return this._super().then(function () { |
||||
|
if (selected_theme) { |
||||
|
self.$('.o_onboarding_wrap').css({ |
||||
|
'background-color': selected_theme.theme_main_color |
||||
|
}); |
||||
|
var color_val = 'color:' + |
||||
|
selected_theme.theme_font_color + |
||||
|
' !important;'; |
||||
|
self.$('.o_onboarding_wrap a,.o_onboarding_wrap p').attr( |
||||
|
'style', color_val |
||||
|
); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
return Temple; |
||||
|
}); |
@ -0,0 +1,202 @@ |
|||||
|
@import url('https://fonts.googleapis.com/css?family=Poppins'); |
||||
|
body { |
||||
|
font-size: 14px; |
||||
|
font-family: lato, sans-serif |
||||
|
} |
||||
|
|
||||
|
h1, h2, h3, h4, h5, h6 { |
||||
|
margin: 0; |
||||
|
font-family: poppins, sans-serif |
||||
|
} |
||||
|
|
||||
|
p { |
||||
|
font-family: lato, sans-serif; |
||||
|
font-size: 15px; |
||||
|
line-height: 26px; |
||||
|
color: #444; |
||||
|
margin-bottom: 0 |
||||
|
} |
||||
|
|
||||
|
p img { |
||||
|
margin: 0 |
||||
|
} |
||||
|
|
||||
|
a, a:visited { |
||||
|
text-decoration: none; |
||||
|
transition: all .3s ease-in-out; |
||||
|
-webkit-transition: all .3s ease-in-out; |
||||
|
-moz-transition: all .3s ease-in-out; |
||||
|
-o-transition: all .3s ease-in-out; |
||||
|
outline: 0; |
||||
|
font-family: poppins, sans-serif |
||||
|
} |
||||
|
|
||||
|
a:hover { |
||||
|
text-decoration: none |
||||
|
} |
||||
|
|
||||
|
a:focus { |
||||
|
text-decoration: none; |
||||
|
outline: 0 |
||||
|
} |
||||
|
|
||||
|
p a, p a:visited { |
||||
|
line-height: inherit; |
||||
|
outline: 0 |
||||
|
} |
||||
|
|
||||
|
ul, ol { |
||||
|
margin-bottom: 0; |
||||
|
margin-top: 0; |
||||
|
padding: 0 |
||||
|
} |
||||
|
|
||||
|
ul { |
||||
|
margin: 0; |
||||
|
list-style-type: none |
||||
|
} |
||||
|
|
||||
|
ol { |
||||
|
list-style: decimal |
||||
|
} |
||||
|
|
||||
|
ol, ul.square, ul.circle, ul.disc { |
||||
|
margin-left: 0 |
||||
|
} |
||||
|
|
||||
|
ul.square { |
||||
|
list-style: square outside |
||||
|
} |
||||
|
|
||||
|
ul.circle { |
||||
|
list-style: circle outside |
||||
|
} |
||||
|
|
||||
|
ul.disc { |
||||
|
list-style: disc outside |
||||
|
} |
||||
|
|
||||
|
ul ul, ul ol, ol ol, ol ul { |
||||
|
margin: 0 |
||||
|
} |
||||
|
|
||||
|
ul ul li, ul ol li, ol ol li, ol ul li { |
||||
|
margin-bottom: 0 |
||||
|
} |
||||
|
|
||||
|
button { |
||||
|
cursor: pointer; |
||||
|
outline: none !important; |
||||
|
letter-spacing: 0 |
||||
|
} |
||||
|
|
||||
|
blockquote { |
||||
|
padding: 60px; |
||||
|
position: relative; |
||||
|
background: #853bfa |
||||
|
} |
||||
|
|
||||
|
blockquote:before { |
||||
|
content: '\f10d'; |
||||
|
font-family: fontawesome; |
||||
|
color: #fff; |
||||
|
font-size: 32px; |
||||
|
position: absolute; |
||||
|
left: 16px; |
||||
|
top: 46px |
||||
|
} |
||||
|
|
||||
|
blockquote p { |
||||
|
font-size: 17px; |
||||
|
color: #fff |
||||
|
} |
||||
|
|
||||
|
.blockquote-footer { |
||||
|
color: #fff |
||||
|
} |
||||
|
/*==============login================*/ |
||||
|
.oe_website_login_container { |
||||
|
padding: 1rem 5rem 5rem; |
||||
|
background: #f1f4f5; |
||||
|
} |
||||
|
.oe_login_form, .oe_signup_form, .oe_reset_password_form { |
||||
|
color: #fff !important; |
||||
|
} |
||||
|
.oe_login_form, .oe_signup_form, .oe_reset_password_form { |
||||
|
max-width: 360px; |
||||
|
position: relative; |
||||
|
margin: 50px auto; |
||||
|
border-radius: 7px; |
||||
|
padding: 3rem; |
||||
|
background: #ffffff; |
||||
|
box-shadow: 0 0 11px 0px #4477d4; |
||||
|
} |
||||
|
|
||||
|
.oe_login_form input { |
||||
|
height: 40px !important; |
||||
|
border-radius: 0 !important; |
||||
|
background: #fff !important; |
||||
|
border: 1px solid #ffffff; |
||||
|
} |
||||
|
|
||||
|
.oe_login_form i.fa.fa-database { |
||||
|
margin-left: 6px; |
||||
|
} |
||||
|
|
||||
|
.oe_login_form a.btn.btn-secondary { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-radius: 0 !important; |
||||
|
} |
||||
|
.cybro-login-btn { |
||||
|
height: 47px; |
||||
|
border-radius: 0; |
||||
|
//background: #3e8df7 !important; |
||||
|
border: none; |
||||
|
//color: #ffffff !important; |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
.cybro-super-btn { |
||||
|
//color: #fff; |
||||
|
font-size: 14px; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
.cybro-super-btn:hover { |
||||
|
color: black !important; |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
.cybro-bg footer{ |
||||
|
background: #303641 !important; |
||||
|
color: #fff; |
||||
|
padding-top: 2rem; |
||||
|
} |
||||
|
.cybro-bg .navbar { |
||||
|
background: #303641 !important; |
||||
|
color: #fff; |
||||
|
} |
||||
|
.cybro-bg footer a,.cybro-bg footer p,.cybro-bg header a,.cybro-bg header p { |
||||
|
color: #fff; |
||||
|
} |
||||
|
.cybro-bg .navbar-light .navbar-nav .nav-link { |
||||
|
color: #ffffff !important; |
||||
|
} |
||||
|
.homepage .dropdown-menu.js_usermenu.dropdown-menu-right.show { |
||||
|
background: #303641; |
||||
|
} |
||||
|
.oe_website_login_container .btn-secondary { |
||||
|
color: #FFFFFF; |
||||
|
background-color: #afafaf; |
||||
|
border-color: #afafae; |
||||
|
} |
||||
|
input { |
||||
|
border: 1px solid #e4eaec !important; |
||||
|
} |
||||
|
.oe_login_form, .oe_signup_form, .oe_reset_password_form { |
||||
|
color: #37474f !important; |
||||
|
font-weight: 300 !important; |
||||
|
} |
||||
|
form label { |
||||
|
font-weight: 300 !important; |
||||
|
} |
||||
|
/*==============//login================*/ |
@ -0,0 +1,22 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<templates id="template" xml:space="preserve"> |
||||
|
<t t-extend="ControlPanel"> |
||||
|
<t t-jquery="div.o_control_panel" t-operation="replace"> |
||||
|
<div class="o_control_panel"> |
||||
|
<div class="o_cp_searchview" role="search"/> |
||||
|
<div class="o_cp_right"> |
||||
|
<div class="btn-group o_search_options" role="search"/> |
||||
|
<nav class="o_cp_pager" role="search" aria-label="Pager"/> |
||||
|
<nav class="btn-group o_cp_switch_buttons" role="toolbar" aria-label="View switcher"/> |
||||
|
</div> |
||||
|
<hr></hr> |
||||
|
<ol class="breadcrumb" role="navigation"/> |
||||
|
<div class="o_cp_left"> |
||||
|
<div class="o_cp_buttons" role="toolbar" aria-label="Control panel toolbar"/> |
||||
|
<aside class="o_cp_sidebar"/> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</templates> |
@ -0,0 +1,68 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<templates id="template" xml:space="preserve"> |
||||
|
<t t-extend="AppsMenu"> |
||||
|
<t t-jquery="div[role='menu']" t-operation="attributes"> |
||||
|
<attribute name="class">dropdown-menu cybro-main-menu</attribute> |
||||
|
</t> |
||||
|
<t t-jquery=".o_app" t-operation="attributes"> |
||||
|
<attribute name="t-attf-href">#menu_id=#{app.menuID}&action_id=#{app.actionID}</attribute> |
||||
|
</t> |
||||
|
<t t-jquery=".o_app" t-operation="attributes"> |
||||
|
<attribute name="class">dropdown-item o_app cybro-mainmenu</attribute> |
||||
|
</t> |
||||
|
<t t-jquery=".full" t-operation="replace"> |
||||
|
<a class="full" data-toggle="dropdown" href="#"> |
||||
|
<i class="fa fa-bars"/> |
||||
|
</a> |
||||
|
</t> |
||||
|
|
||||
|
<t t-jquery=".search-container" t-operation="before"> |
||||
|
<div class="sidebar-user"> |
||||
|
<div class="sidebar-overlay-image"></div> |
||||
|
<div class="sidebar-overlay"></div> |
||||
|
<t t-set="user_img" |
||||
|
t-value="'/web/image?model=res.users&field=image_128&id='+widget.user_id"/> |
||||
|
|
||||
|
<img t-att-src="user_img"/> |
||||
|
<div> |
||||
|
<span t-esc="widget.session.name"/> |
||||
|
<br/> |
||||
|
<span class="sidebar-username" t-esc="widget.session.username"/> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
|
||||
|
<t t-name="AppsMenuSidebar"> |
||||
|
<div class="cybro-sidebar-qweb"> |
||||
|
<div class="sidebar-menus" role="menu"> |
||||
|
<t t-foreach="widget.getApps()" t-as="app"> |
||||
|
<t t-call="multicolor_backend_theme.AppIcon"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
|
||||
|
<t t-name="multicolor_backend_theme.AppIcon"> |
||||
|
<a t-attf-href="#menu_id=#{app.menuID}&action_id=#{app.actionID}"> |
||||
|
<img |
||||
|
class="o-app-icon" |
||||
|
draggable="false" |
||||
|
t-attf-src="/web/image?model=ir.ui.menu&field=web_icon_data&id=#{app.menuID}" |
||||
|
/> |
||||
|
</a> |
||||
|
</t> |
||||
|
<t t-extend="Menu"> |
||||
|
<t t-jquery=".o-menu-toggle" t-operation="replace"> |
||||
|
<!-- Hamburger button to show submenus in sm screens --> |
||||
|
<button class="o-menu-toggle d-md-none" |
||||
|
data-toggle="collapse" |
||||
|
data-target=".o_main_navbar .o_menu_sections"> |
||||
|
<i class="fa fa-ellipsis-v"/> |
||||
|
</button> |
||||
|
</t> |
||||
|
</t> |
||||
|
|
||||
|
|
||||
|
</templates> |
@ -0,0 +1,166 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<templates> |
||||
|
<!--<t t-name="multicolor_backend_theme.theme"> |
||||
|
<li class="new_icon"> |
||||
|
<label class="my_icon" style="margin-bottom:0px;" title="My icon"> |
||||
|
<div class="icon_div"> |
||||
|
<div class="toggle-icon"><i class="fa fa-paint-brush" |
||||
|
id="fa-icon"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</label> |
||||
|
</li> |
||||
|
</t>--> |
||||
|
|
||||
|
<t t-name="multicolor_backend_theme.systray.ThemeMenu"> |
||||
|
<li class="themes_selector_li"> |
||||
|
<a class="themes_selector_button" |
||||
|
data-display="static" aria-expanded="false" title="Themes" |
||||
|
role="button"> |
||||
|
<i class="fa fa-paint-brush" role="img" aria-label="Themes Configuration"/> |
||||
|
</a> |
||||
|
<div class="themes_selector dropdown-menu-right" |
||||
|
role="menu"> |
||||
|
<div class="row"> |
||||
|
<div class="themes_list"> |
||||
|
<div class="row theme_obj"> |
||||
|
<select class="theme_select"> |
||||
|
<t t-foreach="widget.theme_data" |
||||
|
t-as="theme_data"> |
||||
|
<t t-if="widget.selected_theme.id == theme_data.id"> |
||||
|
<option t-att-id="theme_data.id" |
||||
|
selected="selected" |
||||
|
t-att-value="theme_data.id"> |
||||
|
<span t-esc="theme_data.name"/> |
||||
|
</option> |
||||
|
</t> |
||||
|
<t t-else="widget.selected_theme.id == theme_data.id"> |
||||
|
<option t-att-id="theme_data.id" |
||||
|
t-att-value="theme_data.id"> |
||||
|
<span t-esc="theme_data.name"/> |
||||
|
</option> |
||||
|
</t> |
||||
|
</t> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="selected_theme"> |
||||
|
<t t-call="multicolor_backend_theme.selected_theme"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="header_buttons row"> |
||||
|
<div class="button-create cell"> |
||||
|
Create |
||||
|
</div> |
||||
|
<div class="button-remove cell"> |
||||
|
Remove |
||||
|
</div> |
||||
|
<div class="button-apply cell fa fa-check"> |
||||
|
Apply |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</li> |
||||
|
</t> |
||||
|
<t t-name="multicolor_backend_theme.selected_theme"> |
||||
|
<div class="theme_data"> |
||||
|
<t t-set="selected_theme" t-value="widget.selected_theme"/> |
||||
|
<div class="theme_extra"> |
||||
|
<t t-if="selected_theme.theme_active==true"> |
||||
|
<div class="theme-active"><p>Active</p></div> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div class="row name"> |
||||
|
<div class="cell"> |
||||
|
<p>Name</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<input type="text" |
||||
|
id="name" |
||||
|
readonly="readonly" |
||||
|
t-att-value="selected_theme.name"/> |
||||
|
<i class="fa fa-pencil"></i> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row theme_image"> |
||||
|
<div class="cell"> |
||||
|
<p>Sidebar image</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="img-picker" |
||||
|
t-att-id="'selected_'+selected_theme.id"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="color_selector"> |
||||
|
<div class="row theme_main_color"> |
||||
|
<div class="cell"> |
||||
|
<p>Base color</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="theme_main_color" |
||||
|
t-att-style="'background-color:'+selected_theme.theme_main_color"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row theme_font_color"> |
||||
|
<div class="cell"> |
||||
|
<p>Font color</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="theme_font_color" |
||||
|
t-att-style="'background-color:'+selected_theme.theme_font_color"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row view_font_color"> |
||||
|
<div class="cell"> |
||||
|
<p>View font color</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="view_font_color" |
||||
|
t-att-style="'background-color:'+selected_theme.view_font_color"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- <div class="row header_icon_color"> |
||||
|
<div class="cell"> |
||||
|
<p>Header icons</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="header_icon_color" |
||||
|
t-att-style="'background-color:'+selected_theme.header_icon_color"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row button_background"> |
||||
|
<div class="cell"> |
||||
|
<p>Button background</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="button_background" |
||||
|
t-att-style="'background-color:'+selected_theme.button_background"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row button_color"> |
||||
|
<div class="cell"> |
||||
|
<p>Button font</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="button_color" |
||||
|
t-att-style="'background-color:'+selected_theme.button_color"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row view_font_color"> |
||||
|
<div class="cell"> |
||||
|
<p>Views</p> |
||||
|
</div> |
||||
|
<div class="cell"> |
||||
|
<div class="color" id="view_font_color" |
||||
|
t-att-style="'background-color:'+selected_theme.view_font_color"/> |
||||
|
</div> |
||||
|
</div>--> |
||||
|
</div> |
||||
|
</t> |
||||
|
</templates> |
||||
|
|
@ -0,0 +1,40 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
|
||||
|
<odoo> |
||||
|
<data> |
||||
|
<template id="assets_frontend" name="Backend Theme" |
||||
|
inherit_id="web.assets_frontend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<link rel="stylesheet" |
||||
|
href="/multicolor_backend_theme/static/src/scss/theme_style.scss"/> |
||||
|
<script type="text/javascript" |
||||
|
src="/multicolor_backend_theme/static/src/js/login_page.js" |
||||
|
/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<template id="assets_backend" name="Backend Theme" |
||||
|
inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside" > |
||||
|
<link rel="stylesheet" |
||||
|
href="/multicolor_backend_theme/static/src/scss/theme_style_backend.scss"/> |
||||
|
<link rel="stylesheet" |
||||
|
href="/multicolor_backend_theme/static/src/css/img_picker.css"/> |
||||
|
<link rel="stylesheet" |
||||
|
href="/multicolor_backend_theme/static/src/wcolpick/wcolpick.css"/> |
||||
|
<script type="application/javascript" |
||||
|
src="/multicolor_backend_theme/static/src/js/sidebar_menu.js" |
||||
|
/> |
||||
|
<script type="text/javascript" |
||||
|
src="/multicolor_backend_theme/static/src/wcolpick/wcolpick.js" |
||||
|
/> |
||||
|
<script type="text/javascript" |
||||
|
src="/multicolor_backend_theme/static/src/js/jquery_img_picker.js" |
||||
|
/> |
||||
|
<script type="text/javascript" |
||||
|
src="/multicolor_backend_theme/static/src/js/systray_theme_menu.js" |
||||
|
/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,42 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<template id="login_templated_ext" inherit_id="web.login" |
||||
|
name="Login Ext"> |
||||
|
<xpath expr="//button[@type='submit'][1]" position="replace"> |
||||
|
<button type="submit" |
||||
|
class="btn btn-primary btn-block cybro-login-btn">Log |
||||
|
in |
||||
|
</button> |
||||
|
</xpath> |
||||
|
<xpath expr="//t[@t-if='debug']/button" position="replace"> |
||||
|
<button type="submit" name="redirect" |
||||
|
value="/web/become" |
||||
|
class="btn btn-link btn-sm btn-block cybro-super-btn">Log in |
||||
|
as |
||||
|
superuser |
||||
|
</button> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
<template id="layout" name="Main layout Ext" |
||||
|
inherit_id="portal.frontend_layout"> |
||||
|
<xpath expr="//div[@id='wrapwrap']" position="attributes"> |
||||
|
<attribute name="t-attf-class" |
||||
|
add="cybro-bg #{pageName or ''} #{direction == 'rtl' and 'o_rtl' or ''} #{'o_portal' if is_portal else ''}" |
||||
|
separator=" "/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
<template id="webclient_bootstrap_ext" inherit_id="web.webclient_bootstrap"> |
||||
|
<xpath expr="//t[@t-set='head']" position="after"> |
||||
|
<div class="cybro-sidebar"></div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<!-- <template inherit_id="web.webclient_bootstrap" id="webclient_bootstrap_ext">--> |
||||
|
<!-- <xpath expr="//main[hasclass('o_main_content')]" position="before">--> |
||||
|
<!-- <div class="cybro-sidebar"></div>--> |
||||
|
<!-- </xpath>--> |
||||
|
<!-- </template>--> |
||||
|
|
||||
|
</odoo> |