From 8d19e11343d6708f611c2109bb36a193d7981f76 Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 4 Nov 2015 15:08:47 -0500 Subject: [PATCH 1/2] SAAS-1173: Station RSS link does not work Set charset to UTF-8 --- airtime_mvc/application/controllers/FeedsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/FeedsController.php b/airtime_mvc/application/controllers/FeedsController.php index 5e33eb8c6..939703274 100644 --- a/airtime_mvc/application/controllers/FeedsController.php +++ b/airtime_mvc/application/controllers/FeedsController.php @@ -15,7 +15,7 @@ class FeedsController extends Zend_Controller_Action return; } - header('Content-Type: text/xml'); + header('Content-Type: text/xml; charset=UTF-8'); echo Application_Service_PodcastService::createStationRssFeed(); } From 866b88dbb27ceb1970f2693ac441cbff1eb386cb Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Wed, 4 Nov 2015 15:16:29 -0500 Subject: [PATCH 2/2] Style tweaks to publishing and podcast dialogs --- .../services/PodcastEpisodeService.php | 2 +- .../scripts/podcast/station_podcast.phtml | 2 +- airtime_mvc/public/css/dashboard.css | 2 +- airtime_mvc/public/css/styles.css | 8 ++- .../public/js/airtime/library/podcast.js | 51 +++++++++---------- 5 files changed, 35 insertions(+), 30 deletions(-) diff --git a/airtime_mvc/application/services/PodcastEpisodeService.php b/airtime_mvc/application/services/PodcastEpisodeService.php index 75bc4d81a..8733bf24c 100644 --- a/airtime_mvc/application/services/PodcastEpisodeService.php +++ b/airtime_mvc/application/services/PodcastEpisodeService.php @@ -245,7 +245,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir } // XXX: We should maybe try to alias this so we don't pass CcFiles as an array key to the frontend. // It would require us to iterate over all the episodes and change the key for the response though... - $episodes = $episodes->joinWith('PodcastEpisodes.CcFiles') + $episodes = $episodes->joinWith('PodcastEpisodes.CcFiles', Criteria::LEFT_JOIN) ->setOffset($offset) ->orderBy($sortColumn, $sortDir) ->find(); diff --git a/airtime_mvc/application/views/scripts/podcast/station_podcast.phtml b/airtime_mvc/application/views/scripts/podcast/station_podcast.phtml index 120622e7e..fb183d38b 100644 --- a/airtime_mvc/application/views/scripts/podcast/station_podcast.phtml +++ b/airtime_mvc/application/views/scripts/podcast/station_podcast.phtml @@ -1,7 +1,7 @@

- "" +

diff --git a/airtime_mvc/public/css/dashboard.css b/airtime_mvc/public/css/dashboard.css index 17e771d2a..0902d7d9e 100644 --- a/airtime_mvc/public/css/dashboard.css +++ b/airtime_mvc/public/css/dashboard.css @@ -603,7 +603,7 @@ li.ui-state-default { } .edit-md-dialog .zend_form dd:last-child { - width: 160px; + width: 100%; } /* Smart Block Editor */ diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 5f05da839..b19966e3d 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -2444,7 +2444,7 @@ dd.radio-inline-list, .preferences dd.radio-inline-list, .stream-config dd.radio } .md-publish { - width: 160px; + width: 100%; margin-top: 4px; } @@ -4086,6 +4086,11 @@ li .ui-state-hover { text-align: left !important; } +.publish-sources { + display: flex; + margin-bottom: 10px; +} + .publish-sources input[type="checkbox"] { float: left; margin: 8px 20px 0 7px; @@ -4095,6 +4100,7 @@ li .ui-state-hover { color: #efefef; font-size: 14px; line-height: 26px; + margin-bottom: 10px; } .published-sources > .checked-icon { diff --git a/airtime_mvc/public/js/airtime/library/podcast.js b/airtime_mvc/public/js/airtime/library/podcast.js index 3da968a7b..b0d78904d 100644 --- a/airtime_mvc/public/js/airtime/library/podcast.js +++ b/airtime_mvc/public/js/airtime/library/podcast.js @@ -30,7 +30,6 @@ var AIRTIME = (function (AIRTIME) { //a roundtrip by not fetching it again here. $scope.podcast = podcast; $scope.tab = tab; - tab.setName($scope.podcast.title); $scope.csrf = jQuery("#csrf").val(); tab.contents.find("table").attr("id", "podcast_episodes_" + podcast.id); @@ -50,36 +49,28 @@ var AIRTIME = (function (AIRTIME) { }; /** - * Internal function. - * - * Make a PUT request to the server to update the podcast object. - * - * @private + * Save and update the podcast object. */ - self._updatePodcast = function () { + $scope.savePodcast = function () { $http.put(endpoint + $scope.podcast.id, {csrf_token: $scope.csrf, podcast: $scope.podcast}) .success(function () { - self.episodeTable.getDatatable().fnDraw(); AIRTIME.library.podcastDataTable.fnDraw(); tab.setName($scope.podcast.title); }); }; - /** - * For imported podcasts. - * - * Save each of the selected episodes and update the podcast object. - */ - $scope.savePodcast = function () { + $scope.importEpisodes = function () { var episodes = self.episodeTable.getSelectedRows(); // TODO: Should we implement a batch endpoint for this instead? jQuery.each(episodes, function () { $http.post(endpoint + $scope.podcast.id + '/episodes', { csrf_token: $scope.csrf, episode: this + }).success(function () { + self.reloadEpisodeTable(); + self.episodeTable.getDatatable().fnDraw(); }); }); - self._updatePodcast(); }; /** @@ -122,7 +113,19 @@ var AIRTIME = (function (AIRTIME) { /* Publication Date */ { "sTitle" : $.i18n._("Publication Date") , "mDataProp" : "pub_date" , "sClass" : "podcast_episodes_pub_date" , "sWidth" : "170px" } ] }, - buttons = {}; + buttons = { + importBtn: { + title : $.i18n._('Import Selected'), + iconClass : '', + extraBtnClass : 'btn-new', + elementId : '', + eventHandlers : { + click: function () { + $scope.importEpisodes(); + } + } + } + }; self.episodeTable = AIRTIME.podcast.initPodcastEpisodeDatatable($scope.podcast, $scope.tab, params, buttons); self.reloadEpisodeTable(); }; @@ -142,6 +145,7 @@ var AIRTIME = (function (AIRTIME) { PodcastController.prototype.initialize = function() { // TODO: this solves a race condition, but we should look for the root cause AIRTIME.tabs.onResize(); + this.$scope.tab.setName(this.$scope.podcast.title); this._initTable(); }; @@ -172,16 +176,6 @@ var AIRTIME = (function (AIRTIME) { $stationPodcastTab = undefined; }; - - /** - * For the station podcast. - * - * Update the station podcast object. - */ - $scope.savePodcast = function () { - self._updatePodcast(); - }; - self.deleteSelectedEpisodes = function () { var episodes = self.episodeTable.getSelectedRows(); jQuery.each(episodes, function () { @@ -254,6 +248,11 @@ var AIRTIME = (function (AIRTIME) { this.episodeTable = AIRTIME.podcast.initPodcastEpisodeDatatable($scope.podcast, $scope.tab, params, buttons); }; + StationPodcastController.prototype.initialize = function() { + PodcastController.prototype.initialize.call(this); + this.$scope.tab.setName(jQuery.i18n._("Station Podcast")); + }; + /** * Reload the Station podcast episode table. *