diff --git a/CHANGELOG.md b/CHANGELOG.md index 890e599c5..e83c0ca1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ * **Build 15x** (2014-10-x) + - Back-end area can now be customized with colors and logo, via System > Customize Back-end. - Added twig filters `|trans` for `Lang::get(...)` and `|transchoice` for `Lang::choice(...)`. - `SettingsModel` behavior now uses a cached database query. diff --git a/modules/backend/layouts/_custom_styles.htm b/modules/backend/layouts/_custom_styles.htm index 902db3121..643d16010 100644 --- a/modules/backend/layouts/_custom_styles.htm +++ b/modules/backend/layouts/_custom_styles.htm @@ -3,6 +3,6 @@ ?> - \ No newline at end of file + diff --git a/modules/backend/models/BrandSettings.php b/modules/backend/models/BrandSettings.php index 95034ebcd..961491a51 100644 --- a/modules/backend/models/BrandSettings.php +++ b/modules/backend/models/BrandSettings.php @@ -57,6 +57,11 @@ class BrandSettings extends Model $this->secondary_color_dark = self::SECONDARY_DARK; } + public function beforeValidate() + { + $this->rendered_css = self::renderCss(); + } + public static function getLogo() { $settings = self::instance(); @@ -78,7 +83,7 @@ class BrandSettings extends Model 'secondary-color-dark' => self::get('secondary_color_dark', self::SECONDARY_DARK), ]); - $parser->parse(File::get(__DIR__.'/brandsettings/custom.less')); + $parser->parse(File::get(__DIR__.'/brandsettings/custom.less').self::get('custom_css')); $css = $parser->getCss(); return $css; diff --git a/modules/backend/models/brandsettings/fields.yaml b/modules/backend/models/brandsettings/fields.yaml index 7f1e4ecfb..558f1cd04 100644 --- a/modules/backend/models/brandsettings/fields.yaml +++ b/modules/backend/models/brandsettings/fields.yaml @@ -54,5 +54,6 @@ tabs: type: codeeditor tab: Styles size: giant + language: css