From a75a9676f2bb5625191904053c6fd6cc1da059b2 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 29 Sep 2015 11:28:20 -0400 Subject: [PATCH 1/3] More robust solution for not showing what's new popup to new users --- airtime_mvc/application/models/Preference.php | 15 ++++++++++++++- airtime_mvc/build/sql/defaultdata.sql | 9 +++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index e4cdd73fb..e8bf5adf5 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -138,7 +138,13 @@ class Application_Model_Preference $st->execute(); } - private static function getValue($key, $isUserValue = false) + /** + * @param string $key the preference key string + * @param bool|false $isUserValue select the preference for the current user + * @param bool|false $forceDefault only look for default (no user ID) values + * @return mixed the preference value + */ + private static function getValue($key, $isUserValue = false, $forceDefault = false) { $cache = new Cache(); @@ -164,6 +170,8 @@ class Application_Model_Preference if ($isUserValue) { $sql .= " AND subjid = :id"; $paramMap[':id'] = $userId; + } else if ($forceDefault) { + $sql .= " AND subjid IS NULL"; } $result = Application_Common_Database::prepareAndExecute($sql, $paramMap, Application_Common_Database::COLUMN); @@ -1482,6 +1490,11 @@ class Application_Model_Preference public static function getWhatsNewDialogViewed() { $val = self::getValue("whats_new_dialog_viewed", true); + if (empty($val)) { + // Check the default (no user ID) value if the user value is empty + // This is so that new stations won't see the popup + $val = self::getValue("whats_new_dialog_viewed", false, true); + } return empty($val) ? false : $val; } diff --git a/airtime_mvc/build/sql/defaultdata.sql b/airtime_mvc/build/sql/defaultdata.sql index 1f0db0e05..a9af73ff3 100644 --- a/airtime_mvc/build/sql/defaultdata.sql +++ b/airtime_mvc/build/sql/defaultdata.sql @@ -19,8 +19,6 @@ INSERT INTO cc_pref("keystr", "valstr") VALUES('stream_bitrate', '24, 32, 48, 64 INSERT INTO cc_pref("keystr", "valstr") VALUES('num_of_streams', '3'); INSERT INTO cc_pref("keystr", "valstr") VALUES('max_bitrate', '320'); INSERT INTO cc_pref("keystr", "valstr") VALUES('plan_level', 'disabled'); --- For now, just needs to be truthy - to be updated later; we should find a better way to implement this... -INSERT INTO cc_pref("keystr", "valstr") VALUES('whats_new_dialog_viewed', 1); INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device', 'false', 'boolean'); INSERT INTO cc_stream_setting ("keyname", "value", "type") VALUES ('output_sound_device_type', 'ALSA', 'string'); @@ -386,8 +384,7 @@ ALTER TABLE cc_pref ALTER COLUMN subjid SET DEFAULT NULL; CREATE UNIQUE INDEX cc_pref_key_idx ON cc_pref (keystr) WHERE subjid IS NULL; ANALYZE cc_pref; -- this validates the new partial index ---end added in 2.5.14 +-- end added in 2.5.14 -INSERT INTO cc_pref (keystr, valstr, subjid) VALUES ('whats_new_dialog_viewed', 'true', '0'); -INSERT INTO cc_pref (keystr, valstr, subjid) VALUES ('whats_new_dialog_viewed', 'true', '1'); -INSERT INTO cc_pref (keystr, valstr, subjid) VALUES ('whats_new_dialog_viewed', 'true', '2'); \ No newline at end of file +-- For now, just needs to be truthy - to be updated later; we should find a better way to implement this... +INSERT INTO cc_pref("keystr", "valstr") VALUES('whats_new_dialog_viewed', 1); \ No newline at end of file From 7a44a05cb2f1829fac0fdef2b8d6b3f1051b1874 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 29 Sep 2015 11:28:30 -0400 Subject: [PATCH 2/3] Style tweaks --- airtime_mvc/public/css/dashboard.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/airtime_mvc/public/css/dashboard.css b/airtime_mvc/public/css/dashboard.css index 4cb70ee68..258bf5501 100644 --- a/airtime_mvc/public/css/dashboard.css +++ b/airtime_mvc/public/css/dashboard.css @@ -329,6 +329,9 @@ thead th.ui-state-default:focus { .sb-options-form label { color: #efefef; line-height: 26px; + display: inline-block; + padding: 0 0 0 4px; + vertical-align: middle; } #sb_show_filter { @@ -336,6 +339,11 @@ thead th.ui-state-default:focus { position: absolute; } +#sb_my_shows { + top: 1px; + left: 2px; +} + .nav-tabs { border-bottom: 1px solid #5b5b5b; font-family: Arial, Helvetica, sans-serif; From f5afc0957fd60cf33164830f9b06edd499bbbabf Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Tue, 29 Sep 2015 11:36:00 -0400 Subject: [PATCH 3/3] SAAS-1087 - fix DJ list overflow + styling --- airtime_mvc/public/css/add-show.css | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/css/add-show.css b/airtime_mvc/public/css/add-show.css index 9a9507ebc..3e128e8f9 100644 --- a/airtime_mvc/public/css/add-show.css +++ b/airtime_mvc/public/css/add-show.css @@ -113,14 +113,17 @@ label.wrapp-label input[type="checkbox"] { display: none; } +#add_show_hosts-label { + width: 100%; + padding-bottom: 10px; +} + #add_show_hosts-element { max-height: 80px; min-width: 150px; } #add_show_hosts-element > label { - margin: 0 0 6px 5px; - vertical-align: middle; display: flex; align-items: flex-end; } @@ -129,6 +132,10 @@ label.wrapp-label input[type="checkbox"] { margin-right: 6px; } +#schedule-show-who { + overflow-x: hidden; +} + #add_show_logo { margin-top: 6px; }