Cache BrandSettings compiled CSS
This commit is contained in:
parent
fbaab26bfb
commit
1203043a45
|
|
@ -1,4 +1,5 @@
|
||||||
* **Build 15x** (2014-10-x)
|
* **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(...)`.
|
- Added twig filters `|trans` for `Lang::get(...)` and `|transchoice` for `Lang::choice(...)`.
|
||||||
- `SettingsModel` behavior now uses a cached database query.
|
- `SettingsModel` behavior now uses a cached database query.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@
|
||||||
?>
|
?>
|
||||||
<?php if (BrandSettings::isConfigured()): ?>
|
<?php if (BrandSettings::isConfigured()): ?>
|
||||||
<style>
|
<style>
|
||||||
<?= BrandSettings::renderCss() ?>
|
<?= BrandSettings::get('rendered_css') ?>
|
||||||
</style>
|
</style>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,11 @@ class BrandSettings extends Model
|
||||||
$this->secondary_color_dark = self::SECONDARY_DARK;
|
$this->secondary_color_dark = self::SECONDARY_DARK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function beforeValidate()
|
||||||
|
{
|
||||||
|
$this->rendered_css = self::renderCss();
|
||||||
|
}
|
||||||
|
|
||||||
public static function getLogo()
|
public static function getLogo()
|
||||||
{
|
{
|
||||||
$settings = self::instance();
|
$settings = self::instance();
|
||||||
|
|
@ -78,7 +83,7 @@ class BrandSettings extends Model
|
||||||
'secondary-color-dark' => self::get('secondary_color_dark', self::SECONDARY_DARK),
|
'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();
|
$css = $parser->getCss();
|
||||||
|
|
||||||
return $css;
|
return $css;
|
||||||
|
|
|
||||||
|
|
@ -54,5 +54,6 @@ tabs:
|
||||||
type: codeeditor
|
type: codeeditor
|
||||||
tab: Styles
|
tab: Styles
|
||||||
size: giant
|
size: giant
|
||||||
|
language: css
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue