add code_backend_theme from cybrosys

This commit is contained in:
Luis 2025-03-28 12:33:05 +01:00
parent fb8b2fd9e0
commit 612b72778e
136 changed files with 4110 additions and 0 deletions

View file

@ -0,0 +1,93 @@
odoo.define('code_backend_theme.SidebarMenu', function (require) {
"use strict";
//sidebar toggle effect
$(document).on("click", "#closeSidebar", function(event){
$("#closeSidebar").hide();
$("#openSidebar").show();
});
$(document).on("click", "#openSidebar", function(event){
$("#openSidebar").hide();
$("#closeSidebar").show();
});
$(document).on("click", "#openSidebar", function(event){
$("#sidebar_panel").css({'display':'block'});
$(".o_action_manager").css({'margin-left': '200px','transition':'all .1s linear'});
$(".top_heading").css({'margin-left': '200px','transition':'all .1s linear', 'width':'auto'});
//add class in navbar
var navbar = $(".o_main_navbar");
var navbar_id = navbar.data("id");
$("nav").addClass(navbar_id);
navbar.addClass("small_nav");
//add class in action-manager
var action_manager = $(".o_action_manager");
var action_manager_id = action_manager.data("id");
$("div").addClass(action_manager_id);
action_manager.addClass("sidebar_margin");
//add class in top_heading
var top_head = $(".top_heading");
var top_head_id = top_head.data("id");
$("div").addClass(top_head_id);
top_head.addClass("sidebar_margin");
});
$(document).on("click", "#closeSidebar", function(event){
$("#sidebar_panel").css({'display':'none'});
$(".o_action_manager").css({'margin-left': '0px'});
$(".top_heading").css({'margin-left': '0px', 'width':'100%'});
//remove class in navbar
var navbar = $(".o_main_navbar");
var navbar_id = navbar.data("id");
$("nav").removeClass(navbar_id);
navbar.removeClass("small_nav");
//remove class in action-manager
var action_manager = $(".o_action_manager");
var action_manager_id = action_manager.data("id");
$("div").removeClass(action_manager_id);
action_manager.removeClass("sidebar_margin");
//remove class in top_heading
var top_head = $(".top_heading");
var top_head_id = top_head.data("id");
$("div").removeClass(top_head_id);
top_head.removeClass("sidebar_margin");
});
$(document).on("click", ".sidebar a", function(event){
var menu = $(".sidebar a");
var $this = $(this);
var id = $this.data("id");
$("header").removeClass().addClass(id);
menu.removeClass("active");
$this.addClass("active");
//sidebar close on menu-item click
$("#sidebar_panel").css({'display':'none'});
$(".o_action_manager").css({'margin-left': '0px'});
$(".top_heading").css({'margin-left': '0px', 'width':'100%'});
$("#closeSidebar").hide();
$("#openSidebar").show();
//remove class in navbar
var navbar = $(".o_main_navbar");
var navbar_id = navbar.data("id");
$("nav").removeClass(navbar_id);
navbar.removeClass("small_nav");
//remove class in action-manager
var action_manager = $(".o_action_manager");
var action_manager_id = action_manager.data("id");
$("div").removeClass(action_manager_id);
action_manager.removeClass("sidebar_margin");
//remove class in top_heading
var top_head = $(".top_heading");
var top_head_id = top_head.data("id");
$("div").removeClass(top_head_id);
top_head.removeClass("sidebar_margin");
});
});

View file

@ -0,0 +1,10 @@
/** @odoo-module **/
import { getColor } from "@web/views/graph/colors";
var code_backend_color = ["#556ee6", "#f1b44c", "#50a5f1", "#ffbb78", "#34c38f", "#98df8a", "#d62728",
"#ff9896", "#9467bd", "#c5b0d5", "#8c564b", "#c49c94", "#e377c2", "#f7b6d2",
"#7f7f7f", "#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5"];
for (let i=0;i<code_backend_color.length;i++){
getColor[i] = code_backend_color[i]
}