Browse Source

[UPDT] Issue fixed in top bar

pull/195/head
Ajmal Cybro 3 years ago
parent
commit
6b499e78b8
  1. 2
      code_backend_theme/__manifest__.py
  2. 6
      code_backend_theme/static/src/js/chrome/sidebar_menu.js
  3. 136
      code_backend_theme/static/src/scss/theme.scss
  4. 149
      code_backend_theme/static/src/xml/top_bar.xml

2
code_backend_theme/__manifest__.py

@ -25,7 +25,7 @@
"description": """Minimalist and elegant backend theme for Odoo 14, Backend Theme, Theme""", "description": """Minimalist and elegant backend theme for Odoo 14, Backend Theme, Theme""",
"summary": "Code Backend Theme V15 is an attractive theme for backend", "summary": "Code Backend Theme V15 is an attractive theme for backend",
"category": "Themes/Backend", "category": "Themes/Backend",
"version": "15.0.0.0.1", "version": "15.0.1.0.2",
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',

6
code_backend_theme/static/src/js/chrome/sidebar_menu.js

@ -13,7 +13,7 @@ odoo.define('code_backend_theme.SidebarMenu', function (require) {
$(document).on("click", "#openSidebar", function(event){ $(document).on("click", "#openSidebar", function(event){
$("#sidebar_panel").css({'display':'block'}); $("#sidebar_panel").css({'display':'block'});
$(".o_action_manager").css({'margin-left': '200px','transition':'all .1s linear'}); $(".o_action_manager").css({'margin-left': '200px','transition':'all .1s linear'});
$(".top_heading").css({'margin-left': '200px','transition':'all .1s linear'}); $(".top_heading").css({'margin-left': '200px','transition':'all .1s linear', 'width':'auto'});
//add class in navbar //add class in navbar
var navbar = $(".o_main_navbar"); var navbar = $(".o_main_navbar");
@ -36,7 +36,7 @@ odoo.define('code_backend_theme.SidebarMenu', function (require) {
$(document).on("click", "#closeSidebar", function(event){ $(document).on("click", "#closeSidebar", function(event){
$("#sidebar_panel").css({'display':'none'}); $("#sidebar_panel").css({'display':'none'});
$(".o_action_manager").css({'margin-left': '0px'}); $(".o_action_manager").css({'margin-left': '0px'});
$(".top_heading").css({'margin-left': '0px'}); $(".top_heading").css({'margin-left': '0px', 'width':'100%'});
//remove class in navbar //remove class in navbar
var navbar = $(".o_main_navbar"); var navbar = $(".o_main_navbar");
@ -68,7 +68,7 @@ odoo.define('code_backend_theme.SidebarMenu', function (require) {
//sidebar close on menu-item click //sidebar close on menu-item click
$("#sidebar_panel").css({'display':'none'}); $("#sidebar_panel").css({'display':'none'});
$(".o_action_manager").css({'margin-left': '0px'}); $(".o_action_manager").css({'margin-left': '0px'});
$(".top_heading").css({'margin-left': '0px'}); $(".top_heading").css({'margin-left': '0px', 'width':'100%'});
$("#closeSidebar").hide(); $("#closeSidebar").hide();
$("#openSidebar").show(); $("#openSidebar").show();

136
code_backend_theme/static/src/scss/theme.scss

@ -1,5 +1,4 @@
//Top Bar //Top Bar
// @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
@font-face { @font-face {
font-family: 'Poppins' !important; font-family: 'Poppins' !important;
src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap'); src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
@ -19,12 +18,12 @@ a.btn {
} }
.o_main_navbar, .o_searchview_facet_label { .o_main_navbar, .o_searchview_facet_label {
background-color: transparent !important; background-color: transparent !important;
color: $f_color !important; color: $f_color !important;
border:1px !important; border:1px !important;
} }
.o_menu_sections, .o_menu_systray, .o_web_client > header{ .o_menu_sections, .o_menu_systray, .o_web_client > header{
background: $bg_white !important; background: $bg_white !important;
} }
.oe_topbar_name { .oe_topbar_name {
color: $f_color !important; color: $f_color !important;
@ -34,30 +33,28 @@ background: $bg_white !important;
font-size: 16px !important; font-size: 16px !important;
} }
.o_main_navbar { .o_main_navbar {
height: 65px; align-items: center;
// display: flex; border-bottom: 0px solid #5f5e97 !important;
// justify-content: space-between; -webkit-box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03) !important;
align-items: center; box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03) !important;
border-bottom: 0px solid #5f5e97 !important; background-color: #fff !important;
-webkit-box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03) !important;
box-shadow: 0 0.75rem 1.5rem rgba(18,38,63,.03) !important;
background-color: #fff !important;
} }
.top_heading { .top_heading {
display: flex; display: flex;
justify-content: center; justify-content: flex-start;
align-items: center; align-items: center;
width: 100%;
} }
.top_heading ul { .top_heading ul {
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
.top_heading > a { .top_heading > a {
margin-left: 10px; margin-left: 10px;
font-size: 20px; font-size: 20px;
} }
.top_heading li { .top_heading li {
list-style: none; list-style: none;
} }
.o-no-caret > i, button[aria-pressed="true"] { .o-no-caret > i, button[aria-pressed="true"] {
@ -69,7 +66,10 @@ background: $bg_white !important;
color: $f_color !important; color: $f_color !important;
line-height: 46px; line-height: 46px;
} }
.o_main_navbar > .o_menu_sections > li > a:hover, .o_main_navbar > .o_menu_systray > li > a:hover, .o_main_navbar > .o_menu_sections > li.show > a, .o_main_navbar > .o_menu_systray > li.show > a { .o_main_navbar > .o_menu_sections > li > a:hover,
.o_main_navbar > .o_menu_systray > li > a:hover,
.o_main_navbar > .o_menu_sections > li.show > a,
.o_main_navbar > .o_menu_systray > li.show > a {
background-color: $bg_white !important; background-color: $bg_white !important;
} }
@ -418,36 +418,36 @@ th.o_list_record_selector {
// Checkbox // Checkbox
.custom-checkbox label { .custom-checkbox label {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
} }
.custom-checkbox label:before { .custom-checkbox label:before {
content:''; content:'';
-webkit-appearance: none; -webkit-appearance: none;
background-color: transparent; background-color: transparent;
border: 1px solid #0079bf; border: 1px solid #0079bf;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);
padding: 10px; padding: 10px;
display: inline-block; display: inline-block;
position: relative; position: relative;
vertical-align: middle; vertical-align: middle;
cursor: pointer; cursor: pointer;
margin-right: 5px; margin-right: 5px;
margin-top: 0px; margin-top: 0px;
} }
.custom-checkbox input:checked + label:after { .custom-checkbox input:checked + label:after {
content: ''; content: '';
display: block; display: block;
position: absolute; position: absolute;
top: 2px; top: 2px;
left: 9px; left: 9px;
width: 6px; width: 6px;
height: 14px; height: 14px;
border: solid #0079bf; border: solid #0079bf;
border-width: 0 2px 2px 0; border-width: 0 2px 2px 0;
transform: rotate(45deg); transform: rotate(45deg);
} }
.custom-checkbox label::before { .custom-checkbox label::before {
@ -584,7 +584,7 @@ th.o_list_record_selector {
.o_required_modifier > .o_input_dropdown > .ui-autocomplete-input { .o_required_modifier > .o_input_dropdown > .ui-autocomplete-input {
border-left: solid 3px #f46a6a !important; border-left: solid 3px #f46a6a !important;
} }
.fa-building-o{ .fa-building-o {
color: #555b6d !important; color: #555b6d !important;
} }
//sheet end //sheet end
@ -939,7 +939,7 @@ select {
box-shadow: 0 0.75rem 1.5rem rgba(18,38,63, .03) !important; box-shadow: 0 0.75rem 1.5rem rgba(18,38,63, .03) !important;
background-color: #f8f8fb; background-color: #f8f8fb;
} }
.o_action{ .o_action {
background: #f8f8fb; background: #f8f8fb;
} }
//common ends //common ends
@ -1059,8 +1059,7 @@ td.o_main:hover {
//Purchase app ends //Purchase app ends
//input inside colour starts //input inside colour starts
.o_searchview .o_searchview_facet .o_facet_values {
.o_searchview .o_searchview_facet .o_facet_values{
border :1px solid white; border :1px solid white;
} }
@ -1076,8 +1075,8 @@ select, input {
.o_datepicker.o_field_date.o_field_widget.o_required_modifier > input { .o_datepicker.o_field_date.o_field_widget.o_required_modifier > input {
color: #4c4c4c !important; color: #4c4c4c !important;
} }
.o_field_widget.o_field_many2manytags .o_tag_color_0{ .o_field_widget.o_field_many2manytags .o_tag_color_0 {
max-height:20px; max-height:20px;
} }
//input inside colour ends //input inside colour ends
@ -1270,22 +1269,22 @@ select, input {
background-color: #556ee6 !important; background-color: #556ee6 !important;
} }
.badge-secondary { .badge-secondary {
background-color: #74788d; background-color: #74788d;
} }
.badge-success { .badge-success {
background-color: #34c38f; background-color: #34c38f;
} }
.badge-info { .badge-info {
background-color: #50a5f1; background-color: #50a5f1;
} }
.badge-danger { .badge-danger {
background-color: #f46a6a; background-color: #f46a6a;
} }
.badge-warning { .badge-warning {
background-color: #f1b44c; background-color: #f1b44c;
} }
.badge-dark { .badge-dark {
background-color: #343a40; background-color: #343a40;
} }
.bg-success { .bg-success {
background-color: #34c38f !important; background-color: #34c38f !important;
@ -1386,7 +1385,7 @@ div.o_boolean_toggle.custom-control.custom-checkbox > label.custom-control-label
border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px;
} }
.wysiwyg_iframe, .note-editor { .wysiwyg_iframe, .note-editor {
border: 1px solid #556ee640 !important; border: 1px, bold !important;
border-radius: 5px; border-radius: 5px;
} }
//note editor ends //note editor ends
@ -1452,10 +1451,10 @@ ul.o_menu_systray.topbar_icon {
ul.o_menu_sections { ul.o_menu_sections {
padding-left: 20px; padding-left: 20px;
} }
@media (max-width: 1371px){ @media (max-width: 1371px) {
nav.o_main_navbar { nav.o_main_navbar {
display: flex; display: flex;
flex-wrap: wrap; //flex-wrap: wrap;
justify-content: right; justify-content: right;
height: auto; height: auto;
} }
@ -1463,6 +1462,16 @@ ul.o_menu_sections {
margin-left: auto; margin-left: auto;
} }
} }
@media (max-width: 575.98px) {
.o_main_navbar .o_menu_sections {
max-width: 200px;
overflow-x: auto;
flex-wrap: nowrap !important;
}
.o_search_panel {
flex: auto;
}
}
//top menu bar ends //top menu bar ends
//datetimepicker starts //datetimepicker starts
@ -1472,7 +1481,7 @@ ul.o_menu_sections {
.datepicker span { .datepicker span {
padding: 0.5rem !important; padding: 0.5rem !important;
} }
div.dropdown-menu.bootstrap-datetimepicker-widget{ div.dropdown-menu.bootstrap-datetimepicker-widget {
width: auto !important; width: auto !important;
} }
//datetimepicker ends //datetimepicker ends
@ -1504,7 +1513,6 @@ div.dropdown-menu.bootstrap-datetimepicker-widget{
.sidebar_panel .sidebar_close { .sidebar_panel .sidebar_close {
display: block !important; display: block !important;
} }
} }
@media (max-width:480px) { @media (max-width:480px) {
ul.o_menu_apps { ul.o_menu_apps {
@ -1606,9 +1614,8 @@ div.dropdown-menu.bootstrap-datetimepicker-widget{
} }
} }
//Responsive ends //Responsive ends
//New changes
//New changes
.o_main_navbar .dropdown .dropdown-toggle, .o_main_navbar .o_menu_sections .dropdown .dropdown-toggle, .o_main_navbar .dropdown .dropdown-toggle, .o_main_navbar .o_menu_sections .dropdown .dropdown-toggle,
.o_main_navbar .o_menu_systray .dropdown .dropdown-toggle, .o_main_navbar .o_nav_entry, .o_main_navbar .o_menu_systray .dropdown .dropdown-toggle, .o_main_navbar .o_nav_entry,
.o_main_navbar .o_menu_sections .o_nav_entry, .o_main_navbar .o_menu_systray .o_nav_entry, .o_main_navbar .o_menu_sections .o_nav_entry, .o_main_navbar .o_menu_systray .o_nav_entry,
@ -1625,7 +1632,6 @@ div.dropdown-menu.bootstrap-datetimepicker-widget{
} }
//new fix //new fix
.o_form_view .oe_button_box + .oe_title, .o_form_view .oe_button_box + .oe_avatar + .oe_title .o_form_view .oe_button_box + .oe_title, .o_form_view .oe_button_box + .oe_avatar + .oe_title {
{
width: 100% !important; width: 100% !important;
} }

149
code_backend_theme/static/src/xml/top_bar.xml

@ -1,86 +1,83 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-inherit="web.NavBar" t-inherit-mode="extension" owl="1"> <t t-inherit="web.NavBar" t-inherit-mode="extension" owl="1">
<xpath expr="//nav[hasclass('o_main_navbar')]" position="replace"> <xpath expr="//nav[hasclass('o_main_navbar')]" position="replace">
<nav class="o_main_navbar"
t-on-dropdown-item-selected="onNavBarDropdownItemSelection"
data-command-category="navbar">
<div class="top_heading">
<!-- Apps Menu -->
<t t-call="web.NavBar.AppsMenu">
<t t-set="apps" t-value="menuService.getApps()"/>
</t>
<!-- App Brand -->
<MenuItem t-if="currentApp"
href="getMenuItemHref(currentApp)"
payload="currentApp"
t-esc="currentApp.name"
class="o_menu_brand"
t-ref="menuBrand"
/>
<!-- Current App Sections -->
<t t-if="currentAppSections.length" t-call="web.NavBar.SectionsMenu">
<t t-set="sections" t-value="currentAppSections" />
</t>
</div>
<nav class="o_main_navbar" <!-- Systray -->
t-on-dropdown-item-selected="onNavBarDropdownItemSelection" <div class="o_menu_systray" role="menu">
data-command-category="navbar"> <t t-foreach="systrayItems" t-as="item" t-key="item_index">
<div class="top_heading"> <NotUpdatable>
<!-- Apps Menu --> <ErrorHandler onError="error => handleItemError(error, item)">
<t t-call="web.NavBar.AppsMenu"> <t t-component="item.Component" t-props="item.props" />
<t t-set="apps" t-value="menuService.getApps()"/> </ErrorHandler>
</t> </NotUpdatable>
<!-- App Brand --> </t>
<MenuItem t-if="currentApp" </div>
href="getMenuItemHref(currentApp)" </nav>
payload="currentApp" <div class="sidebar_panel" id="sidebar_panel">
t-esc="currentApp.name" <div class="sidebar">
class="o_menu_brand" <div class="sidebar_close">
t-ref="menuBrand" <a id="closeSidebar" style="cursor: pointer;">
/> <img src="/code_backend_theme/static/src/img/icons/close.png"/>
</div> </a>
</div>
<!-- Current App Sections --> <div class="sidebar_logo">
<t t-if="currentAppSections.length" t-call="web.NavBar.SectionsMenu"> <img src="/web/binary/company_logo" class="logo_img"/>
<t t-set="sections" t-value="currentAppSections" /> </div>
</t> <h6 class="sidebar_head">MENU</h6>
<ul class="sidebar_menu">
<!-- Systray --> <t t-foreach="menuService.getApps()" t-as="app">
<div class="o_menu_systray" role="menu"> <li>
<t t-foreach="systrayItems" t-as="item" t-key="item_index"> <a role="menuitem"
<NotUpdatable> t-attf-href="#menu_id={{app.id}}"
<ErrorHandler onError="error => handleItemError(error, item)"> class="nav-link">
<t t-component="item.Component" t-props="item.props" /> <img class="sidebar_img"
</ErrorHandler> t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
</NotUpdatable> <span class="sidebar_app_name">
</t> <t t-esc="app.name"/>
</div> </span>
</nav> </a>
<div class="sidebar_panel" id="sidebar_panel"> </li>
<div class="sidebar"> </t>
<div class="sidebar_close"> </ul>
<a id="closeSidebar" style="cursor: pointer;"> </div>
<img src="/code_backend_theme/static/src/img/icons/close.png"/> </div>
</a> </xpath>
</div> </t>
<div class="sidebar_logo">
<img src="/web/binary/company_logo" class="logo_img"/>
</div>
<h6 class="sidebar_head">MENU</h6>
<ul class="sidebar_menu">
<t t-foreach="menuService.getApps()" t-as="app">
<li>
<a role="menuitem"
t-attf-href="#menu_id={{app.id}}"
class="nav-link">
<img class="sidebar_img"
t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
<span class="sidebar_app_name">
<t t-esc="app.name"/>
</span>
</a>
</li>
</t>
</ul>
</div>
</div>
</xpath>
</t>
<t t-inherit="web.NavBar.AppsMenu" t-inherit-mode="extension" owl="1"> <t t-inherit="web.NavBar.AppsMenu" t-inherit-mode="extension" owl="1">
<xpath expr="//Dropdown[hasclass('o_navbar_apps_menu')]" position="replace"> <xpath expr="//Dropdown[hasclass('o_navbar_apps_menu')]" position="replace">
<li class="dropdown"> <li class="dropdown">
<a id="openSidebar" style="display: block; cursor: pointer;"> <a id="openSidebar" style="display: block; cursor: pointer;">
<i class="fa fa-bars fa-lg"/> <i class="fa fa-bars fa-lg"/>
</a> </a>
<a id="closeSidebar" style="display: none; cursor: pointer;"> <a id="closeSidebar" style="display: none; cursor: pointer;">
<i class="fa fa-bars fa-lg"/> <i class="fa fa-bars fa-lg"/>
</a> </a>
</li> </li>
</xpath> </xpath>
</t> </t>
<t t-inherit="web.UserMenu" t-inherit-mode="extension" owl="1"> <t t-inherit="web.UserMenu" t-inherit-mode="extension" owl="1">
<xpath expr="//span[hasclass('oe_topbar_name')]" position="replace"> <xpath expr="//span[hasclass('oe_topbar_name')]" position="replace">

Loading…
Cancel
Save