Browse Source

publish muk_web_branding - 12.0

pull/115/head
MuK IT GmbH 6 years ago
parent
commit
76a9b7d38a
  1. 2
      muk_web_branding/__manifest__.py
  2. 5
      muk_web_branding/doc/changelog.rst
  3. 100
      muk_web_branding/models/res_config_settings.py
  4. 15
      muk_web_branding/static/src/scss/bootstrap_colors.scss
  5. 62
      muk_web_branding/views/res_config_settings_view.xml

2
muk_web_branding/__manifest__.py

@ -20,7 +20,7 @@
{ {
"name": "MuK Web Branding", "name": "MuK Web Branding",
"summary": """Branding and Debranding""", "summary": """Branding and Debranding""",
"version": "12.0.1.0.4",
"version": "12.0.1.1.0",
"category": "Extra Tools", "category": "Extra Tools",
"license": "AGPL-3", "license": "AGPL-3",
"website": "http://www.mukit.at", "website": "http://www.mukit.at",

5
muk_web_branding/doc/changelog.rst

@ -1,3 +1,8 @@
`1.1.0`
-------
- Added Gray Colors
`1.0.0` `1.0.0`
------- -------

100
muk_web_branding/models/res_config_settings.py

@ -119,6 +119,39 @@ class ResConfigSettings(models.TransientModel):
branding_color_dark = fields.Char( branding_color_dark = fields.Char(
string="Dark Color") string="Dark Color")
branding_color_white = fields.Char(
string="White Color")
branding_color_black = fields.Char(
string="Black Color")
branding_color_gray_100 = fields.Char(
string="Gray 100 Color")
branding_color_gray_200 = fields.Char(
string="Gray 200 Color")
branding_color_gray_300 = fields.Char(
string="Gray 300 Color")
branding_color_gray_400 = fields.Char(
string="Gray 400 Color")
branding_color_gray_500 = fields.Char(
string="Gray 500 Color")
branding_color_gray_600 = fields.Char(
string="Gray 600 Color")
branding_color_gray_700 = fields.Char(
string="Gray 700 Color")
branding_color_gray_800 = fields.Char(
string="Gray 800 Color")
branding_color_gray_900 = fields.Char(
string="Gray 900 Color")
#---------------------------------------------------------- #----------------------------------------------------------
# Helper # Helper
@ -212,6 +245,17 @@ class ResConfigSettings(models.TransientModel):
'danger', 'danger',
'light', 'light',
'dark', 'dark',
'white',
'black',
'gray-100',
'gray-200',
'gray-300',
'gray-400',
'gray-500',
'gray-600',
'gray-700',
'gray-800',
'gray-900',
] ]
colors = self.env['muk_utils.scss_editor'].get_values( colors = self.env['muk_utils.scss_editor'].get_values(
BOOTSTRAP_SCSS_URL, BOOTSTRAP_XML_ID, variables BOOTSTRAP_SCSS_URL, BOOTSTRAP_XML_ID, variables
@ -222,7 +266,17 @@ class ResConfigSettings(models.TransientModel):
'branding_color_warning': colors['warning'], 'branding_color_warning': colors['warning'],
'branding_color_danger': colors['danger'], 'branding_color_danger': colors['danger'],
'branding_color_light': colors['light'], 'branding_color_light': colors['light'],
'branding_color_dark': colors['dark'],
'branding_color_white': colors['white'],
'branding_color_black': colors['black'],
'branding_color_gray_100': colors['gray-100'],
'branding_color_gray_200': colors['gray-200'],
'branding_color_gray_300': colors['gray-300'],
'branding_color_gray_400': colors['gray-400'],
'branding_color_gray_500': colors['gray-500'],
'branding_color_gray_600': colors['gray-600'],
'branding_color_gray_700': colors['gray-700'],
'branding_color_gray_800': colors['gray-800'],
'branding_color_gray_900': colors['gray-900'],
} }
def _check_branding_colors(self, colors, variables): def _check_branding_colors(self, colors, variables):
@ -360,6 +414,50 @@ class ResConfigSettings(models.TransientModel):
'name': 'dark', 'name': 'dark',
'field': 'branding_color_dark', 'field': 'branding_color_dark',
'value': self.branding_color_dark or "#343a40" 'value': self.branding_color_dark or "#343a40"
}, {
'name': 'white',
'field': 'branding_color_white',
'value': self.branding_color_white or "#ffffff"
}, {
'name': 'black',
'field': 'branding_color_black',
'value': self.branding_color_black or "#000000"
}, {
'name': 'gray-100',
'field': 'branding_color_gray_100',
'value': self.branding_color_gray_100 or "#f8f9fa"
}, {
'name': 'gray-200',
'field': 'branding_color_gray_200',
'value': self.branding_color_gray_200 or "#e9ecef"
}, {
'name': 'gray-300',
'field': 'branding_color_gray_300',
'value': self.branding_color_gray_300 or "#dee2e6"
}, {
'name': 'gray-400',
'field': 'branding_color_gray_400',
'value': self.branding_color_gray_400 or "#ced4da"
}, {
'name': 'gray-500',
'field': 'branding_color_gray_500',
'value': self.branding_color_gray_500 or "#adb5bd"
}, {
'name': 'gray-600',
'field': 'branding_color_gray_600',
'value': self.branding_color_gray_600 or "#6c757d"
}, {
'name': 'gray-700',
'field': 'branding_color_gray_700',
'value': self.branding_color_gray_700 or "#495057"
}, {
'name': 'gray-800',
'field': 'branding_color_gray_800',
'value': self.branding_color_gray_800 or "#343a40"
}, {
'name': 'gray-900',
'field': 'branding_color_gray_900',
'value': self.branding_color_gray_900 or "#212529"
}] }]
colors = self._get_branding_bootstrap_colors() colors = self._get_branding_bootstrap_colors()
if self._check_branding_colors(colors, variables): if self._check_branding_colors(colors, variables):

15
muk_web_branding/static/src/scss/bootstrap_colors.scss

@ -26,4 +26,17 @@ $info: #17a2b8;
$warning: #ffc107; $warning: #ffc107;
$danger: #dc3545; $danger: #dc3545;
$light: #f8f9fa; $light: #f8f9fa;
$dark: #343a40;
$dark: #343a40;
$white: #ffffff;
$black: #000000;
$gray-100: #f8f9fa;
$gray-200: #e9ecef;
$gray-300: #dee2e6;
$gray-400: #ced4da;
$gray-500: #adb5bd;
$gray-600: #6c757d;
$gray-700: #495057;
$gray-800: #343a40;
$gray-900: #212529;

62
muk_web_branding/views/res_config_settings_view.xml

@ -255,6 +255,68 @@
</div> </div>
</div> </div>
</div> </div>
<h2>Gray Palette</h2>
<div class="row mt16 o_settings_container" name="branding_component_colors">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Palette</span>
<div class="text-muted">
Set the color palette
</div>
<div class="content-group">
<div class="mt16 row">
<label for="branding_color_white" string="White" class="col-lg-3 o_light_label"/>
<field name="branding_color_white" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_100" string="Gray 100" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_100" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_200" string="Gray 200" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_200" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_300" string="Gray 300" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_300" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_400" string="Gray 400" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_400" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_500" string="Gray 500" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_500" widget="color" class="oe_inline"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<span class="o_form_label">Palette</span>
<div class="text-muted">
Set the color palette
</div>
<div class="content-group">
<div class="mt16 row">
<label for="branding_color_gray_600" string="Gray 600" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_600" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_700" string="Gray 700" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_700" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_800" string="Gray 800" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_800" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_gray_900" string="Gray 900" class="col-lg-3 o_light_label"/>
<field name="branding_color_gray_900" widget="color" class="oe_inline"/>
<div class="w-100"></div>
<label for="branding_color_black" string="Black" class="col-lg-3 o_light_label"/>
<field name="branding_color_black" widget="color" class="oe_inline"/>
</div>
</div>
</div>
</div>
</div>
</xpath> </xpath>
</field> </field>
</record> </record>

Loading…
Cancel
Save