diff --git a/jazzy_backend_theme/__init__.py b/jazzy_backend_theme/__init__.py index e37e5632d..26bd4be6e 100644 --- a/jazzy_backend_theme/__init__.py +++ b/jazzy_backend_theme/__init__.py @@ -19,4 +19,4 @@ # If not, see . # ############################################################################# -from . import models \ No newline at end of file +from . import models diff --git a/jazzy_backend_theme/__manifest__.py b/jazzy_backend_theme/__manifest__.py index 70da50731..035263f46 100644 --- a/jazzy_backend_theme/__manifest__.py +++ b/jazzy_backend_theme/__manifest__.py @@ -22,10 +22,11 @@ { "name": "Jazzy Backend Theme v16", - "description": """Minimalist and elegant backend theme for Odoo 16, Backend Theme, Theme""", + "description": """Minimalist and elegant backend theme for Odoo 16, + Backend Theme, Theme""", "summary": "Jazzy backed Theme V16 is an attractive theme for backend", "category": "Themes/Backend", - "version": "16.0.1.0.0", + "version": "16.0.1.1.0", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', @@ -33,7 +34,7 @@ "depends": ['base', 'web', 'mail'], "data": [ 'views/style.xml', - 'views/res_config_settings.xml', + 'views/res_config_settings_views.xml', ], 'assets': { 'web.assets_backend': [ diff --git a/jazzy_backend_theme/doc/RELEASE_NOTES.md b/jazzy_backend_theme/doc/RELEASE_NOTES.md index c1ef73b8a..c6dfc2d5d 100644 --- a/jazzy_backend_theme/doc/RELEASE_NOTES.md +++ b/jazzy_backend_theme/doc/RELEASE_NOTES.md @@ -2,4 +2,9 @@ #### Version 16.0.1.0.0 ##### ADD -##### Initial Commit for Jazzy Backend Theme +- Initial Commit for Jazzy Backend Theme + + +#### 27.09.2023 +#### Version 16.0.1.0.1 +##### UPDT diff --git a/jazzy_backend_theme/models/__init__.py b/jazzy_backend_theme/models/__init__.py index bc6de62ac..f52198f7a 100644 --- a/jazzy_backend_theme/models/__init__.py +++ b/jazzy_backend_theme/models/__init__.py @@ -19,4 +19,5 @@ # If not, see . # ############################################################################# +from . import res_company from . import res_config_settings diff --git a/jazzy_backend_theme/models/res_company.py b/jazzy_backend_theme/models/res_company.py new file mode 100644 index 000000000..0e2abdf2e --- /dev/null +++ b/jazzy_backend_theme/models/res_company.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +""" +This module helps user to change the backend theme of the odoo according to +there choices +""" +from odoo import models, fields + + +class ResCompany(models.Model): + """Inherits the Res Company Model""" + _inherit = 'res.company' + + background_image = fields.Binary(string="Background Image", attachment=True) diff --git a/jazzy_backend_theme/models/res_config_settings.py b/jazzy_backend_theme/models/res_config_settings.py index 94892e75b..0b2e1e8ed 100644 --- a/jazzy_backend_theme/models/res_config_settings.py +++ b/jazzy_backend_theme/models/res_config_settings.py @@ -19,17 +19,13 @@ # If not, see . # ############################################################################# - +""" +This module helps user to change the backend theme of the odoo according to +the users choices +""" from odoo import models, fields -class ResCompany(models.Model): - """Inherits the Res Company Model""" - _inherit = 'res.company' - - background_image = fields.Binary(string="Background Image", attachment=True) - - class ResConfigSettings(models.TransientModel): """Inherits the Configuration settings Model""" _inherit = 'res.config.settings' @@ -37,61 +33,50 @@ class ResConfigSettings(models.TransientModel): theme_background = fields.Binary(string="App menu Background", related='company_id.background_image', readonly=False) - app_bar_color = fields.Char(string='Appbar color', config_parameter='jazzy_backend_theme.appbar_color', default='#000000') primary_accent = fields.Char(string="Navbar color", config_parameter='jazzy_backend_theme.primary_accent_color', default='#004589') - secondary_accent = fields.Char(string="Navbar color", - config_parameter='jazzy_backend_theme.secondary_color', - default='#0C4D9D') - - kanban_bg_color = fields.Char(string="Kanban Bg Color", - config_parameter='jazzy_backend_theme.kanban_bg_color', - default='#F7F7F7') - primary_hover = fields.Char(string="Hover Primary Color", config_parameter='jazzy_backend_theme.primary_hover', default='#00376E') - light_hover = fields.Char(string="Light Hover", - config_parameter='jazzy_backend_theme.light_hover', - default='#ffffff') appbar_text = fields.Char(string="Home Menu Text Color", config_parameter='jazzy_backend_theme.appbar_text', default='#ffffff') - secoundary_hover = fields.Char(string="AppBar Hover", - config_parameter='jazzy_backend_theme.secoundary_hover', - default='#F2F2F3') + secondary_hover = fields.Char(string="AppBar Hover", + config_parameter='jazzy_backend_theme.secondary_hover', + default='#F2F2F3') + kanban_bg_color = fields.Char(string="Kanban Bg Color", + config_parameter='jazzy_backend_theme.kanban_bg_color', + default='#F7F7F7') def config_color_settings(self): """Define the configuration color settings""" - colors = {} - colors['full_bg_img'] = self.env.user.company_id.background_image - colors['appbar_color'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.appbar_color') - colors['primary_accent'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.primary_accent_color') - colors['secondary_color'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.secondary_color') - colors['kanban_bg_color'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.kanban_bg_color') - colors['primary_hover'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.primary_hover') - colors['light_hover'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.light_hover') - colors['appbar_text'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.appbar_text') - colors['secoundary_hover'] = self.env[ - 'ir.config_parameter'].sudo().get_param( - 'jazzy_backend_theme.secoundary_hover') - + colors = {'full_bg_img': self.env.user.company_id.background_image, + 'appbar_color': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.appbar_color'), + 'primary_accent': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.primary_accent_color'), + 'secondary_color': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.secondary_color'), + 'kanban_bg_color': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.kanban_bg_color'), + 'primary_hover': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.primary_hover'), + 'light_hover': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.light_hover'), + 'appbar_text': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.appbar_text'), + 'secondary_hover': self.env[ + 'ir.config_parameter'].sudo().get_param( + 'jazzy_backend_theme.secondary_hover')} return colors diff --git a/jazzy_backend_theme/static/src/components/app_menu/menu_order.css b/jazzy_backend_theme/static/src/components/app_menu/menu_order.css index 0ba06bd62..be9096e86 100644 --- a/jazzy_backend_theme/static/src/components/app_menu/menu_order.css +++ b/jazzy_backend_theme/static/src/components/app_menu/menu_order.css @@ -1,102 +1,147 @@ -.nav-container { +@keyframes fadeIn{ + 0%{ + opacity: 0; + } + 100%{ + opacity: 1; + } +} - float: left; - position: relative; - width: 99vw; - height: 100%; - background: #fff; - display: flex; - justify-content: start; - align-items: start; - padding: 0px 20rem; - margin-top: 2rem; - -} -/*.search-results {*/ -/* float: left;*/ -/* position: relative;*/ -/* width: 100vw;*/ -/* height: 100vh;*/ -/* background: #fff;*/ -/* display: flex;*/ -/* justify-content: center;*/ -/* align-items: center;*/ -/* padding: 0 20rem;*/ -/*}*/ -.o_main_navbar .dropdown-menu .show { - max-height: auto !important; - min-width: 100%; - overflow: auto; - margin-top: 0; - position: static; - top: 0; +o_setting_search { + position: relative; +} + + .o_setting_search .searchInput { + height: 28px; + padding: 0px; + border: 0px; + box-shadow: none; + font-weight: 500; +} + .o_setting_search .searchIcon { + color: gray('700'); +} + +.o_kanban_renderer{ + background-color: var(--kanban-bg-color); +} + +.oe_kanban_global_click{ + border-radius: 15px; +} + + .search-container.has-results .search-input { + height: 3em; +} + .search-container.has-results .search-results { + height: calc(100% - 3em); + overflow: auto; + margin-top: 10px; +} + +.o_setting_search.col-md-10{ + padding: 20px; +} +.app-menu { + width: 100%; display: flex; - box-shadow: none; - border: none; flex-wrap: wrap; - flex-direction: row; - overflow: unset; + padding-left: calc((100vw - 850px) / 2); + padding-right: calc((100vw - 850px) / 2); + +} + +.o-menu-search-result.dropdown-item.col-12.ml-auto.mr-auto { + background-repeat: no-repeat; + background-size: contain; + padding-left: 5.5rem; +} +.form-control { + padding: 0 !important; +} +@media (max-width: 1371px){ + +} + +@media (max-width:992px) { + +} +@media (max-width:400px) { + +} +.o_main_navbar .o_menu_brand { + text-decoration: none !important; + margin-left: 10px; } -.dropdown-item.o_app.mt0 { - flex-basis: 20%; + +.o_navbar .o_main_navbar .dropdown-toggle .dropdown-menu .search-container { + padding-left: calc((100vw - 850px) / 2); + padding-right: calc((100vw - 850px) / 2); + padding-top:20px; + padding-bottom:20px; + display: table; +} +.o_apps_menu_opened .o_main_navbar .o_menu_brand{ + display:none; +} +.app_components { + position: absolute; + height: 100vh; + width: 100%; + background: #f5f5f5f0; + z-index: 99; + top: 40px; + display:none; + background: url("../../src/img/home-menu-bg-overlay.svg"), linear-gradient(to bottom, #71639e, #b0adba); +} +.app-menu a{ + flex-basis: 19%; display: flex; justify-content: center; align-items: center; flex-direction: column; margin-bottom: 23px; } -.o_setting_search { - position: relative; - - .searchInput { - height: 28px; - padding: 0px; - border: 0px; - border-dropdown-item bottom: 1px solid gray('400'); - border-color: gray('700'); - box-shadow: none; - font-weight: 500; - } - - .searchIcon { - @include o-position-absolute(4px, 0); - color: gray('700'); - } - } - .search-container.has-results { - height: 100%; - - .search-input { - height: 3em; - } - - .search-results { - height: calc(100% - 3em); - overflow: auto; - } - } +o_setting_search { + position: relative; +} + .o_setting_search .searchInput { + height: 28px; + padding: 0px; + border: 0px; + box-shadow: none; + font-weight: 500; +} + .o_setting_search .searchIcon { + color: gray('700'); +} -.app-menu { + .search-container.has-results .search-input { + height: 3em; + display: table; +} + .search-container.has-results .search-results { + height: calc(100% - 3em); + overflow: auto; + margin-top: 10px; +} +.o_setting_search.col-md-10{ + padding: 20px; +} +.app-menu { width: 100%; display: flex; flex-wrap: wrap; + padding-left: calc((100vw - 850px) / 2); + padding-right: calc((100vw - 850px) / 2); } -.o_main_navbar .dropdown-menu.show { - max-height: none !important; - min-width: 100vw; - min-heigt: 100vh; - overflow: auto; - margin-top: 0; -} -.o-menu-search-result.dropdown-item.col-12.ml-auto.mr-auto { +.o-menu-search-result.dropdown-item.col-12.ml-auto.mr-auto { background-repeat: no-repeat; - background-size: 100%; - padding-left: 30%; - margin-bottom: 5%; - + background-size: contain; + padding-left: 3rem; } .form-control { padding: 0 !important; @@ -108,7 +153,70 @@ @media (max-width:992px) { } - @media (max-width:400px) { -} \ No newline at end of file +} +.o_main_navbar .o_menu_brand { + text-decoration: none !important; + margin-left: 10px; +} + +.o_navbar .o_main_navbar .dropdown-toggle .dropdown-menu .search-container { + padding-left: calc((100vw - 850px) / 2); + padding-right: calc((100vw - 850px) / 2); + padding-top:20px; + padding-bottom:20px; +} +.o_apps_menu_opened .o_main_navbar .o_menu_brand{ + display:none; +} +.app_components { + position: absolute; + height: 100vh; + width: 100%; + background: #f5f5f5f0; + z-index: 99; + top: 40px; + display:none; + background: url("../../img/home-menu-bg-overlay.svg"), linear-gradient(to bottom, #71639e, #b0adba); +} +.app-menu a{ + flex-basis: 19%; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + margin-bottom: 23px; + cursor:pointer; +} +.app_components .search-input{ + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.1); + border-radius: 4px; + width:100%; + background-color: rgba(255, 255, 255, 0.1); + margin-bottom:1rem; + text-shadow: 0 1px 0 rgb(0 0 0 / 50%); +} + +.o_navbar .o_main_navbar .o_main-menu-button:hover{ + background:rgba(0, 0, 0, 0.08); + cursor: pointer; +} +@media (max-width: 850px) { + .app_components .search-input { + width:90%; + margin:0 auto; + } + .app-menu { + width:90%; + margin:0 auto; + } +} +@media (max-width: 444px) { + .app-menu{ + width:80%; + } + .app-menu a{ + flex-basis: 25%; + } +} diff --git a/jazzy_backend_theme/static/src/components/app_menu/search_apps.js b/jazzy_backend_theme/static/src/components/app_menu/search_apps.js index 453f6b145..6a1fb2f3e 100644 --- a/jazzy_backend_theme/static/src/components/app_menu/search_apps.js +++ b/jazzy_backend_theme/static/src/components/app_menu/search_apps.js @@ -1,14 +1,11 @@ /** @odoo-module */ - import { NavBar } from "@web/webclient/navbar/navbar"; import { registry } from "@web/core/registry"; const { fuzzyLookup } = require('@web/core/utils/search'); import { computeAppsAndMenuItems } from "@web/webclient/menus/menu_helpers"; import core from 'web.core'; - const commandProviderRegistry = registry.category("command_provider"); const { onMounted } = owl; - import { patch } from 'web.utils'; var rpc = require('web.rpc'); patch(NavBar.prototype, 'jazzy_backend_theme/static/src/js/appMenu.js', { @@ -40,21 +37,22 @@ patch(NavBar.prototype, 'jazzy_backend_theme/static/src/js/appMenu.js', { document.documentElement.style.setProperty("--app-bar-accent",result.appbar_color);} if (result.primary_hover !== false){ document.documentElement.style.setProperty("--primary-hover",result.primary_hover);} - if (result.secondary_color !== false){ - document.documentElement.style.setProperty("--primary-accent-border",result.secondary_color);} - if (result.full_bg_img !== false){ - document.documentElement.style.setProperty("--full-screen-bg",'url(data:image/png;base64,'+result.full_bg_img+')'); - + if (result.full_bg_img !== false) { + var imageUrl = 'url(data:image/png;base64,' + result.full_bg_img + ')'; + var appComponentsDivs = document.getElementsByClassName('app_components'); + for (var i = 0; i < appComponentsDivs.length; i++) { + appComponentsDivs[i].style.backgroundImage = imageUrl; + } } if (result.appbar_text !== false){ document.documentElement.style.setProperty("--app-menu-font-color",result.appbar_text);} - if (result.secoundary_hover !== false){ - document.documentElement.style.setProperty("--secoundary-hover",result.secoundary_hover);} - if (result.kanban_bg_color !== false){ - document.documentElement.style.setProperty("--kanban-bg-color",result.kanban_bg_color);} + if (result.secondary_hover !== false){ + document.documentElement.style.setProperty("--secondary-hover",result.secondary_hover);} + if (result.kanban_bg_color !== false) { + document.documentElement.style.setProperty("--kanban-bg-color", result.kanban_bg_color); + } }); }, - onMounted() { this.$search_container = $(".search-container"); this.$search_input = $(".search-input input"); @@ -68,10 +66,8 @@ patch(NavBar.prototype, 'jazzy_backend_theme/static/src/js/appMenu.js', { this._search_def.reject(); this._search_def = $.Deferred(); setTimeout(this._search_def.resolve.bind(this._search_def), 50); - this._search_def.done(this._searchMenus.bind(this)); }, - _searchMenus: function () { var query = this.$search_input.val(); if (query === "") { @@ -92,7 +88,6 @@ patch(NavBar.prototype, 'jazzy_backend_theme/static/src/js/appMenu.js', { webIconData: menu.webIconData, }); }); - fuzzyLookup(query, this._searchableMenus, (menu) => (menu.parents + " / " + menu.label).split("/").reverse().join("/") ).forEach((menu) => { @@ -103,7 +98,6 @@ patch(NavBar.prototype, 'jazzy_backend_theme/static/src/js/appMenu.js', { id: menu.id, }); }); - this.$search_container.toggleClass( "has-results", Boolean(results.length) @@ -118,4 +112,28 @@ patch(NavBar.prototype, 'jazzy_backend_theme/static/src/js/appMenu.js', { ) ); }, + OnClickMainMenu() { + if ($('.app_components').css("display") === "none") { + $('.app_components').fadeIn(250); + $('.o_menu_sections').attr('style','display: none !important'); + $('.o_menu_brand').attr('style','display: none !important'); + $('.o_action_manager').attr('style','display: none !important'); + $('.sidebar_panel').attr('style','display: none !important'); + } else { + $('.app_components').fadeOut(50); + $('.o_menu_sections').attr('style','display: flex !important'); + $('.o_menu_brand').attr('style','display: block !important'); + $('.o_action_manager').attr('style','display: block !important'); + $('.sidebar_panel').attr('style','display: block !important'); + } + }, + onNavBarDropdownItemSelection(app) { + var appComponentsDiv = document.querySelector('.app_components'); + appComponentsDiv.style.display = 'none'; + $('.o_action_manager').attr('style','display: block !important'); + $('.sidebar_panel').attr('style','display: block !important'); + $('.o_menu_brand').attr('style','display: flex !important'); + $('.o_menu_sections').attr('style','display: flex !important'); + this._super(app); +} }); \ No newline at end of file diff --git a/jazzy_backend_theme/static/src/components/app_menu/side_menu.xml b/jazzy_backend_theme/static/src/components/app_menu/side_menu.xml index c84926fbf..b79c4c2c6 100644 --- a/jazzy_backend_theme/static/src/components/app_menu/side_menu.xml +++ b/jazzy_backend_theme/static/src/components/app_menu/side_menu.xml @@ -1,98 +1,105 @@ + - +
+
+
+ + + + + + + +
+
+ - + style="color:white;" + onclick="$('.o_menu_sections').css('display','flex');$('.search-results').addClass('o_hidden');$('.o_menu_brand').css('display','flex');$('.app_components').css('display','none'); $('.app-menu').removeClass('o_hidden'); $('.search-input input').val('');$('.o_action_manager').attr('style','display: block !important');$('.sidebar_panel').attr('style','display: block !important');"/> - + - - - - - -
\ No newline at end of file + + + + diff --git a/jazzy_backend_theme/static/src/layout/style/layout_colors.scss b/jazzy_backend_theme/static/src/layout/style/layout_colors.scss index c63498970..7148b6f91 100644 --- a/jazzy_backend_theme/static/src/layout/style/layout_colors.scss +++ b/jazzy_backend_theme/static/src/layout/style/layout_colors.scss @@ -27,6 +27,6 @@ $fullscreen-bg-color: var(--fullscreen-bg-color) !important; --color-white : #ffffff !important; --primary-hover: #00376e; --light-hover: #d5d5d5 ; - --secoundary-hover:#ffffff; + --secondary-hover:#ffffff; --fullscreen-bg-color: #C5F0FC !important; } \ No newline at end of file diff --git a/jazzy_backend_theme/static/src/layout/style/layout_style.scss b/jazzy_backend_theme/static/src/layout/style/layout_style.scss index 25c7078be..f137cac64 100644 --- a/jazzy_backend_theme/static/src/layout/style/layout_style.scss +++ b/jazzy_backend_theme/static/src/layout/style/layout_style.scss @@ -15,7 +15,7 @@ } .app_bar .app_container a:hover{ - background:var(--secoundary-hover) !important; + background:var(--secondary-hover) !important; } .fullscreen-menu{ @@ -249,9 +249,6 @@ .o_form_view .oe_button_box .oe_stat_button .o_button_icon { color: var(--primary-accent) !important; } -//.o_required_modifier.o_input, .o_required_modifier .o_input { -// background-color: var(--primary-accent) !important; -//} //small icons .o_search_panel .o_search_panel_category .o_search_panel_section_icon { @@ -373,13 +370,9 @@ } .nav-container { - /*float: left;*/ position: relative; width: 100vw !important; - /*height: 100%;*/ - /*background: #fff;*/ display: flex; - /* justify-content: start; */ align-items: start; margin-top: 2rem; } @@ -429,12 +422,6 @@ margin-top: 1.5rem; } } -//@media(max-width:716px){ - - //html .o_web_client > .o_action_manager > .o_action > .o_content{ - // overflow-x: hidden !important; - // } -//} @media (max-width:524px){ diff --git a/jazzy_backend_theme/static/src/layout/style/sidebar.scss b/jazzy_backend_theme/static/src/layout/style/sidebar.scss index c5dd9d690..19dd0a380 100644 --- a/jazzy_backend_theme/static/src/layout/style/sidebar.scss +++ b/jazzy_backend_theme/static/src/layout/style/sidebar.scss @@ -49,7 +49,7 @@ transition:.3s all; } .sidebar_panel .sidebar .sidebar_menu li:hover a { - background: var(--secoundary-hover) !important; + background: var(--secondary-hover) !important; color: #fff; } diff --git a/jazzy_backend_theme/views/res_config_settings.xml b/jazzy_backend_theme/views/res_config_settings_views.xml similarity index 66% rename from jazzy_backend_theme/views/res_config_settings.xml rename to jazzy_backend_theme/views/res_config_settings_views.xml index 736332b1d..e149238da 100644 --- a/jazzy_backend_theme/views/res_config_settings.xml +++ b/jazzy_backend_theme/views/res_config_settings_views.xml @@ -1,19 +1,22 @@ - - res.config.jazzy.backend.theme + + + res.config.settings.view.form.inherit.jazzy.backend.theme res.config.settings

jazzy Backend Theme

-
+
-
-
-
-
- +
-
@@ -57,19 +62,19 @@
-
- +
-
@@ -79,35 +84,12 @@
-
-
-
- -
-
-
-
- - - - - - - - - - - -