Browse Source

publish muk_web_theme - 12.0

pull/48/head
MuK IT GmbH 6 years ago
parent
commit
df2cbd6523
  1. 2
      muk_web_theme/__manifest__.py
  2. 5
      muk_web_theme/doc/changelog.rst
  3. 22
      muk_web_theme/models/res_config_settings.py
  4. 2
      muk_web_theme/static/src/scss/appsbar.scss
  5. 2
      muk_web_theme/static/src/scss/colors.scss
  6. 3
      muk_web_theme/views/res_config_settings_view.xml

2
muk_web_theme/__manifest__.py

@ -19,7 +19,7 @@
{
"name": "MuK Backend Theme",
"summary": "Odoo 12.0 community backend theme",
"version": "12.0.1.1.17",
"version": "12.0.1.2.0",
"category": "Themes/Backend",
"license": "AGPL-3",
"author": "MuK IT",

5
muk_web_theme/doc/changelog.rst

@ -1,3 +1,8 @@
`1.2.0`
-------
- Added AppBar Color Options
`1.1.0`
-------

22
muk_web_theme/models/res_config_settings.py

@ -41,18 +41,28 @@ class ResConfigSettings(models.TransientModel):
theme_color_primary = fields.Char(
string="Theme Primary Color")
theme_color_appbar = fields.Char(
string="Theme AppBar Color")
@api.multi
def set_values(self):
res = super(ResConfigSettings, self).set_values()
variables = [
'o-brand-odoo',
'o-brand-primary',
'mk-appbar-background'
]
colors = self.env['muk_utils.scss_editor'].get_values(
SCSS_URL, XML_ID, ['o-brand-odoo', 'o-brand-primary']
SCSS_URL, XML_ID, variables
)
brand_changed = self.theme_color_brand != colors['o-brand-odoo']
primary_changed = self.theme_color_primary != colors['o-brand-primary']
if(brand_changed or primary_changed):
appbar_changed = self.theme_color_appbar != colors['mk-appbar-background']
if(brand_changed or primary_changed or appbar_changed):
variables = [
{'name': 'o-brand-odoo', 'value': self.theme_color_brand or "#243742"},
{'name': 'o-brand-primary', 'value': self.theme_color_primary or "#5D8DA8"},
{'name': 'mk-appbar-background', 'value': self.theme_color_appbar or "#000000"},
]
self.env['muk_utils.scss_editor'].replace_values(
SCSS_URL, XML_ID, variables
@ -62,11 +72,17 @@ class ResConfigSettings(models.TransientModel):
@api.model
def get_values(self):
res = super(ResConfigSettings, self).get_values()
variables = [
'o-brand-odoo',
'o-brand-primary',
'mk-appbar-background'
]
colors = self.env['muk_utils.scss_editor'].get_values(
SCSS_URL, XML_ID, ['o-brand-odoo', 'o-brand-primary']
SCSS_URL, XML_ID, variables
)
res.update({
'theme_color_brand': colors['o-brand-odoo'],
'theme_color_primary': colors['o-brand-primary'],
'theme_color_appbar': colors['mk-appbar-background'],
})
return res

2
muk_web_theme/static/src/scss/appsbar.scss

@ -22,7 +22,7 @@
position: fixed;
overflow-y: auto;
top: $o-navbar-height;
background-color: $black;
background-color: $mk-appbar-background;
.mk_apps_sidebar {
padding: 0;
white-space: nowrap;

2
muk_web_theme/static/src/scss/colors.scss

@ -24,6 +24,8 @@
$o-brand-odoo: #243742;
$o-brand-primary: #5D8DA8;
$mk-appbar-background: #000000;
$mk-brand-gradient-start: lighten($o-brand-odoo, 10%);
$mk-brand-gradient-end: lighten($o-brand-odoo, 20%);

3
muk_web_theme/views/res_config_settings_view.xml

@ -58,6 +58,9 @@
<div class="w-100"></div>
<label for="theme_color_primary" string="Primary" class="col-lg-3 o_light_label"/>
<field name="theme_color_primary" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="theme_color_appbar" string="AppBar" class="col-lg-3 o_light_label"/>
<field name="theme_color_appbar" widget="color" class="oe_inline"/>
</div>
</div>
</div>

Loading…
Cancel
Save