Cache BrandSettings compiled CSS
This commit is contained in:
parent
fbaab26bfb
commit
1203043a45
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
?>
|
||||
<?php if (BrandSettings::isConfigured()): ?>
|
||||
<style>
|
||||
<?= BrandSettings::renderCss() ?>
|
||||
<?= BrandSettings::get('rendered_css') ?>
|
||||
</style>
|
||||
<?php endif ?>
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -54,5 +54,6 @@ tabs:
|
|||
type: codeeditor
|
||||
tab: Styles
|
||||
size: giant
|
||||
language: css
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue