Merge branch 'saas-dev-publishing' into saas-dev-publishing-episode-view

Conflicts:
	airtime_mvc/public/js/airtime/library/podcast.js
This commit is contained in:
Duncan Sommerville 2015-11-04 15:18:50 -05:00
commit 6cb28e0911
6 changed files with 37 additions and 30 deletions

View File

@ -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();
}

View File

@ -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();

View File

@ -1,7 +1,7 @@
<div class="angular_wrapper" ng-controller="StationPodcast">
<div class="inner_editor_title">
<h2>
<?php echo _("Editing ") ?>"<span ng-bind="podcast.title" class="title_obj_name"></span>"
<span class="title_obj_name"><?php echo _("My Station Podcast") ?></span>
</h2>
<a href="{{podcast.url}}" target="_blank">
<button class="btn"><?php echo _("View Feed") ?></button>

View File

@ -603,7 +603,7 @@ li.ui-state-default {
}
.edit-md-dialog .zend_form dd:last-child {
width: 160px;
width: 100%;
}
/* Smart Block Editor */

View File

@ -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 {

View File

@ -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,20 @@ var AIRTIME = (function (AIRTIME) {
/* Publication Date */ { "sTitle" : $.i18n._("Publication Date") , "mDataProp" : "pub_date" , "sClass" : "podcast_episodes_pub_date" , "sWidth" : "170px" }
]
},
buttons = { slideToggle: {} };
buttons = {
slideToggle: {},
importBtn: {
title : $.i18n._('Import Selected'),
iconClass : '',
extraBtnClass : 'btn-new',
elementId : '',
eventHandlers : {
click: function () {
$scope.importEpisodes();
}
}
}
};
self.episodeTable = AIRTIME.podcast.initPodcastEpisodeDatatable(
$scope.tab.contents.find('.podcast_episodes'),
params,
@ -146,6 +150,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();
};
@ -176,15 +181,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 () {
@ -261,6 +257,11 @@ var AIRTIME = (function (AIRTIME) {
);
};
StationPodcastController.prototype.initialize = function() {
PodcastController.prototype.initialize.call(this);
this.$scope.tab.setName(jQuery.i18n._("Station Podcast"));
};
/**
* Reload the Station podcast episode table.
*