From 7cd80f8a59cdafa9cdd6a5d21f09e71e1e9f3f65 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Wed, 23 Jul 2014 17:45:05 +1000 Subject: [PATCH 1/2] Throw an error when the active theme is not found --- modules/cms/classes/Controller.php | 3 +++ modules/cms/lang/en/lang.php | 1 + 2 files changed, 4 insertions(+) diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 90828ae52..94017b350 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -93,6 +93,9 @@ class Controller extends BaseController public function __construct($theme = null) { $this->theme = $theme ? $theme : Theme::getActiveTheme(); + if (!$this->theme) + throw new CmsException(Lang::get('cms::lang.theme.active.not_found')); + $this->assetPath = Config::get('cms.themesDir').'/'.$this->theme->getDirName(); $this->router = new Router($this->theme); $this->initTwigEnvironment(); diff --git a/modules/cms/lang/en/lang.php b/modules/cms/lang/en/lang.php index 661443dc6..e83c70331 100644 --- a/modules/cms/lang/en/lang.php +++ b/modules/cms/lang/en/lang.php @@ -15,6 +15,7 @@ return [ 'theme' => [ 'active' => [ 'not_set' => "The active theme is not set.", + 'not_found' => "The active theme is not found.", ], 'edit' => [ 'not_set' => "The edit theme is not set.", From f7dcf8ebb0852884778c82b061ba5e56336cca2c Mon Sep 17 00:00:00 2001 From: alekseybobkov Date: Thu, 24 Jul 2014 15:24:39 +1100 Subject: [PATCH 2/2] Files added --- modules/backend/assets/css/october.css | 1 + .../less/css/october.theme-selector.css | 112 ++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 modules/cms/assets/less/css/october.theme-selector.css diff --git a/modules/backend/assets/css/october.css b/modules/backend/assets/css/october.css index 1d57bdfa2..d2e4438c2 100644 --- a/modules/backend/assets/css/october.css +++ b/modules/backend/assets/css/october.css @@ -7271,6 +7271,7 @@ body { /* The html and body elements cannot have any padding or margin. */ } body { + webkit-font-smoothing: antialiased; background: #fafafa; } #layout-canvas { diff --git a/modules/cms/assets/less/css/october.theme-selector.css b/modules/cms/assets/less/css/october.theme-selector.css new file mode 100644 index 000000000..92d8cca90 --- /dev/null +++ b/modules/cms/assets/less/css/october.theme-selector.css @@ -0,0 +1,112 @@ +.theme-selector-layout .layout-cell { + padding: 24px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.theme-selector-layout .theme-thumbnail { + width: 288px; + background: #ecf0f1; + border-bottom: 1px solid #e3e7e9; +} +.theme-selector-layout .theme-thumbnail img { + opacity: 0.6; + filter: alpha(opacity=60); + width: 240px; +} +.theme-selector-layout .theme-description { + border-bottom: 1px solid #f2f3f4; +} +.theme-selector-layout .theme-description h3, +.theme-selector-layout .theme-description p { + opacity: 0.6; + filter: alpha(opacity=60); +} +.theme-selector-layout .theme-description h3 { + margin: 0 0 25px 0; + font-size: 28px; + color: #2b3e50; + display: inline-block; +} +.theme-selector-layout .theme-description p.author { + font-size: 13px; + display: inline-block; + color: #808c8d; +} +.theme-selector-layout .theme-description p.description { + color: #2b3e50; + font-size: 14px; + line-height: 180%; + margin-bottom: 30px; +} +.theme-selector-layout .theme-description .controls button i.icon-star { + margin-right: 5px; + color: #f1a84e; + font-size: 16px; + vertical-align: middle; +} +.theme-selector-layout .layout-row.active .theme-thumbnail { + background: #bdc3c7; + border-bottom-color: #bdc3c7; +} +.theme-selector-layout .layout-row.active .thumbnail-container { + position: relative; +} +.theme-selector-layout .layout-row.active .thumbnail-container:after { + content: ''; + display: block; + width: 0; + height: 0; + border-top: 14px solid transparent; + border-bottom: 14px solid transparent; + border-left: 15px solid #bdc3c7; + position: absolute; + right: -35px; + top: 50%; + margin-top: -14px; +} +.theme-selector-layout .layout-row.active .theme-description h3, +.theme-selector-layout .layout-row:hover .theme-description h3, +.theme-selector-layout .layout-row.active .theme-description p, +.theme-selector-layout .layout-row:hover .theme-description p { + opacity: 1; + filter: alpha(opacity=100); +} +.theme-selector-layout .layout-row.active .theme-thumbnail img, +.theme-selector-layout .layout-row:hover .theme-thumbnail img { + opacity: 1; + filter: alpha(opacity=100); +} +.theme-selector-layout .layout-row.last .theme-description, +.theme-selector-layout .layout-row.last .theme-thumbnail { + border-bottom: none!important; +} +.theme-selector-layout .find-more-themes { + background: #ecf0f1; + color: #2b3e50; + text-decoration: none; + display: block; + padding: 20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.theme-selector-layout .find-more-themes:hover { + background: #1795f1; + color: white; +} +@media (max-width: 768px) { + .theme-selector-layout .layout-cell, + .theme-selector-layout .layout-row { + display: block!important; + width: auto!important; + height: auto!important; + } + .theme-selector-layout .theme-thumbnail img { + width: 100%; + } + .theme-selector-layout .layout-row.links .theme-thumbnail { + background: transparent; + padding: 0; + } +}