From bd559904ec11f6cd5eb35ed0feddacd14a34a3d9 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Fri, 4 Jan 2019 14:18:40 +0100 Subject: [PATCH] switch for publish and draft --- bl-kernel/admin/themes/booty/css/bludit.css | 59 +++++++++++++++++++++ bl-kernel/admin/views/content.php | 8 ++- bl-kernel/admin/views/edit-content.php | 49 ++++++++++------- bl-kernel/admin/views/new-content.php | 51 ++++++++++-------- 4 files changed, 126 insertions(+), 41 deletions(-) diff --git a/bl-kernel/admin/themes/booty/css/bludit.css b/bl-kernel/admin/themes/booty/css/bludit.css index 2b5f6ddb..f40a7f10 100644 --- a/bl-kernel/admin/themes/booty/css/bludit.css +++ b/bl-kernel/admin/themes/booty/css/bludit.css @@ -340,3 +340,62 @@ img.profilePicture { border: 1px solid #ccc; } +/* Switch button */ +.switch { + position: relative; + height: 26px; + width: 120px; + background: #f3f3f3; + border: 1px solid #ced4d9; + border-radius: 2px; +} + +.switch-label { + position: relative; + z-index: 2; + float: left; + width: 58px; + line-height: 25px; + font-size: 11px; + text-align: center; + cursor: pointer; + margin: 0 !important; +} +.switch-label:active { + font-weight: bold; +} + +.switch-label-off { + padding-left: 2px; +} + +.switch-label-on { + padding-right: 2px; +} + +.switch-input { + display: none; +} + +.switch-input:checked + .switch-label { + font-weight: bold; + color: #fff; + transition: 0.15s ease-out; + transition-property: color, text-shadow; +} +.switch-input:checked + .switch-label-on ~ .switch-selection { + left: 50%; +} + +.switch-selection { + position: absolute; + z-index: 1; + top: 2px; + left: 2px; + display: block; + width: 58px; + height: 21px; + border-radius: 2px; + background-color: #6c757d; + transition: left 0.15s ease-out; +} diff --git a/bl-kernel/admin/views/content.php b/bl-kernel/admin/views/content.php index 3f36ab2b..fcf2f3f9 100644 --- a/bl-kernel/admin/views/content.php +++ b/bl-kernel/admin/views/content.php @@ -87,7 +87,9 @@ function table($type) { echo ''.PHP_EOL; echo ' '.$L->g('Edit').''.PHP_EOL; - echo ''.PHP_EOL; + if (count($page->children())==0) { + echo ''.PHP_EOL; + } echo ''; echo ''; @@ -143,7 +145,9 @@ function table($type) { echo ''.PHP_EOL; echo ' '.$L->g('Edit').''.PHP_EOL; - echo ''.PHP_EOL; + if (count($page->children())==0) { + echo ''.PHP_EOL; + } echo ''; echo ''; diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index e4f1867e..518f3ce9 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -60,29 +60,37 @@ echo Bootstrap::formOpen(array(
- + - draft()): ?> - - - - children())==0): ?> + - p('Cancel') ?> + +
+ draft()?'checked':'') ?>> + + draft()?'checked':'') ?>> + + +
+
- draft()): ?> -
p('the-content-is-saved-as-a-draft-to-publish-it') ?>
- - scheduled()): ?>
p('scheduled') ?>: date(SCHEDULED_DATE_FORMAT) ?>