From 13d6df24fbd4e307678edd01752e86ba775716f4 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 13 Dec 2018 09:11:42 -0600 Subject: [PATCH] smartblock ui: add collapsed "advanced options" section --- .../scripts/form/smart-block-criteria.phtml | 165 +++++++++--------- .../views/scripts/playlist/smart-block.phtml | 21 ++- airtime_mvc/public/css/dashboard.css | 14 -- airtime_mvc/public/css/playlist_builder.css | 37 ++++ .../js/airtime/playlist/smart_blockbuilder.js | 5 + 5 files changed, 141 insertions(+), 101 deletions(-) diff --git a/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml b/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml index 7dccbb7d6..2d61c7d96 100644 --- a/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml +++ b/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml @@ -1,87 +1,8 @@
-
- -
-
- element->getElement('sp_type')->getValue(); - foreach ($this->element->getElement('sp_type')->getMultiOptions() as $radio) : ?> - - - - - -
- -
- -
-
- element->getElement('sp_repeat_tracks')?> - element->getElement("sp_repeat_tracks")->hasErrors()) : ?> - element->getElement("sp_repeat_tracks")->getMessages() as $error): ?> - - - - - - -
-
- -
-
- element->getElement('sp_overflow_tracks')?> - element->getElement("sp_overflow_tracks")->hasErrors()) : ?> - element->getElement("sp_overflow_tracks")->getMessages() as $error): ?> - - - - - - -
- - -
- -
-
- element->getElement('sp_sort_options') ?> - element->getElement("sp_sort_options")->hasErrors()) : ?> - element->getElement("sp_sort_options")->getMessages() as $error): ?> - - - - - -
- -
- -
-
- element->getElement('sp_limit_value')?> - element->getElement('sp_limit_options') ?> - element->getElement("sp_limit_value")->hasErrors()) : ?> - element->getElement("sp_limit_value")->getMessages() as $error): ?> - - - - - -
-
- - criteriasLength; $i++) { // modRowMap holds the number of modifier rows for each criteria element // i.e. if we have 'Album contains 1' and 'Album contains 2' the modRowMap @@ -138,7 +59,93 @@ + +
+
+
+
+ +
+
+ element->getElement('sp_limit_value')?> + element->getElement('sp_limit_options') ?> + element->getElement("sp_limit_value")->hasErrors()) : ?> + element->getElement("sp_limit_value")->getMessages() as $error): ?> + + + + +
+
Advanced options
+
+
+
+ +
+
+ element->getElement('sp_type')->getValue(); + foreach ($this->element->getElement('sp_type')->getMultiOptions() as $radio) : ?> + + + + + +
+
+
+
+ +
+
+ element->getElement('sp_repeat_tracks')?> + element->getElement("sp_repeat_tracks")->hasErrors()) : ?> + element->getElement("sp_repeat_tracks")->getMessages() as $error): ?> + + + + + + +
+
+
+
+ +
+
+ element->getElement('sp_overflow_tracks')?> + element->getElement("sp_overflow_tracks")->hasErrors()) : ?> + element->getElement("sp_overflow_tracks")->getMessages() as $error): ?> + + + + + + +
+
+
+
+ +
+
+ element->getElement('sp_sort_options') ?> + element->getElement("sp_sort_options")->hasErrors()) : ?> + element->getElement("sp_sort_options")->getMessages() as $error): ?> + + + + + +
+
+
diff --git a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml index eb80e402c..47ce144bc 100644 --- a/airtime_mvc/application/views/scripts/playlist/smart-block.phtml +++ b/airtime_mvc/application/views/scripts/playlist/smart-block.phtml @@ -10,7 +10,7 @@ if (isset($this->obj)) {

"unsavedName)) echo $this->unsavedName; else echo $this->escape($this->obj->getName());?>"

-
+
@@ -25,17 +25,22 @@ if (isset($this->obj)) { else echo $this->escape($this->obj->getName()); ?>"> -
-
- -
form; ?> +
+
+
+
+ +
+
+
+
diff --git a/airtime_mvc/public/css/dashboard.css b/airtime_mvc/public/css/dashboard.css index d94b0f941..8df5161b0 100644 --- a/airtime_mvc/public/css/dashboard.css +++ b/airtime_mvc/public/css/dashboard.css @@ -684,20 +684,6 @@ li.ui-state-default { height: 26px; } -.smart-block-form input[type='radio'] { - vertical-align: bottom; - margin: 0 5px -2px; -} - -.smart-block-form input[type='checkbox'] { - vertical-align: bottom; - margin: 0 4px; -} - -.smart-block-form ~ .btn-toolbar { - padding-top: 4px; -} - /* Schedule tab DataTable */ #show_builder_table_wrapper .fg-toolbar.ui-corner-tl.ui-corner-tr { diff --git a/airtime_mvc/public/css/playlist_builder.css b/airtime_mvc/public/css/playlist_builder.css index 73a855634..0e344047a 100644 --- a/airtime_mvc/public/css/playlist_builder.css +++ b/airtime_mvc/public/css/playlist_builder.css @@ -634,4 +634,41 @@ li.spl_empty { #criteria_add { margin-bottom: 5px; +} + +.smart-block-form dt, .smart-block-form dd { + float: none; +} +.smart-block-form dl:not(.search-criteria) { + display: flex; + width: 100%; +} +.smart-block-form dt { + flex: 1 0 20%; + margin: 0; +} +.smart-block-form dd { + flex: 0 0 80%; + margin: 0; +} +.collapsible-header .arrow-icon { + transition: 0.3s; +} +.collapsible-header.visible .arrow-icon { + transform: rotate(90deg); +} +.smart-block-advanced { + display: none; +} +.smart-block-form .smart-block-advanced dt { + flex: 0 0 40%; + margin: 0; +} +.smart-block-form .smart-block-advanced dd { + flex: 0 0 60%; + margin: 0; +} +.smart-block-form input[type='radio'], .smart-block-form input[type='checkbox'] { + vertical-align: middle; + margin: 0 5px; } \ No newline at end of file diff --git a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js index 6794e8855..e4e170978 100644 --- a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js +++ b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js @@ -566,6 +566,11 @@ function setupUI() { at: "right center" } }); + + activeTab.find('.smart-block-form .collapsible-header').click(function(){ + $(this).toggleClass('visible'); + $('.smart-block-advanced').toggle(); + }) } /* Utilizing jQuery this function finds the #datetime_select element on the given row