Style tweaks to publishing and podcast dialogs

This commit is contained in:
Duncan Sommerville 2015-11-04 15:16:29 -05:00
parent a7370de832
commit 866b88dbb2
5 changed files with 35 additions and 30 deletions

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. // 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... // 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) ->setOffset($offset)
->orderBy($sortColumn, $sortDir) ->orderBy($sortColumn, $sortDir)
->find(); ->find();

View File

@ -1,7 +1,7 @@
<div class="angular_wrapper" ng-controller="StationPodcast"> <div class="angular_wrapper" ng-controller="StationPodcast">
<div class="inner_editor_title"> <div class="inner_editor_title">
<h2> <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> </h2>
<a href="{{podcast.url}}" target="_blank"> <a href="{{podcast.url}}" target="_blank">
<button class="btn"><?php echo _("View Feed") ?></button> <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 { .edit-md-dialog .zend_form dd:last-child {
width: 160px; width: 100%;
} }
/* Smart Block Editor */ /* Smart Block Editor */

View File

@ -2444,7 +2444,7 @@ dd.radio-inline-list, .preferences dd.radio-inline-list, .stream-config dd.radio
} }
.md-publish { .md-publish {
width: 160px; width: 100%;
margin-top: 4px; margin-top: 4px;
} }
@ -4086,6 +4086,11 @@ li .ui-state-hover {
text-align: left !important; text-align: left !important;
} }
.publish-sources {
display: flex;
margin-bottom: 10px;
}
.publish-sources input[type="checkbox"] { .publish-sources input[type="checkbox"] {
float: left; float: left;
margin: 8px 20px 0 7px; margin: 8px 20px 0 7px;
@ -4095,6 +4100,7 @@ li .ui-state-hover {
color: #efefef; color: #efefef;
font-size: 14px; font-size: 14px;
line-height: 26px; line-height: 26px;
margin-bottom: 10px;
} }
.published-sources > .checked-icon { .published-sources > .checked-icon {

View File

@ -30,7 +30,6 @@ var AIRTIME = (function (AIRTIME) {
//a roundtrip by not fetching it again here. //a roundtrip by not fetching it again here.
$scope.podcast = podcast; $scope.podcast = podcast;
$scope.tab = tab; $scope.tab = tab;
tab.setName($scope.podcast.title);
$scope.csrf = jQuery("#csrf").val(); $scope.csrf = jQuery("#csrf").val();
tab.contents.find("table").attr("id", "podcast_episodes_" + podcast.id); tab.contents.find("table").attr("id", "podcast_episodes_" + podcast.id);
@ -50,36 +49,28 @@ var AIRTIME = (function (AIRTIME) {
}; };
/** /**
* Internal function. * Save and update the podcast object.
*
* Make a PUT request to the server to update the podcast object.
*
* @private
*/ */
self._updatePodcast = function () { $scope.savePodcast = function () {
$http.put(endpoint + $scope.podcast.id, {csrf_token: $scope.csrf, podcast: $scope.podcast}) $http.put(endpoint + $scope.podcast.id, {csrf_token: $scope.csrf, podcast: $scope.podcast})
.success(function () { .success(function () {
self.episodeTable.getDatatable().fnDraw();
AIRTIME.library.podcastDataTable.fnDraw(); AIRTIME.library.podcastDataTable.fnDraw();
tab.setName($scope.podcast.title); tab.setName($scope.podcast.title);
}); });
}; };
/** $scope.importEpisodes = function () {
* For imported podcasts.
*
* Save each of the selected episodes and update the podcast object.
*/
$scope.savePodcast = function () {
var episodes = self.episodeTable.getSelectedRows(); var episodes = self.episodeTable.getSelectedRows();
// TODO: Should we implement a batch endpoint for this instead? // TODO: Should we implement a batch endpoint for this instead?
jQuery.each(episodes, function () { jQuery.each(episodes, function () {
$http.post(endpoint + $scope.podcast.id + '/episodes', { $http.post(endpoint + $scope.podcast.id + '/episodes', {
csrf_token: $scope.csrf, csrf_token: $scope.csrf,
episode: this 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" } /* 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.episodeTable = AIRTIME.podcast.initPodcastEpisodeDatatable($scope.podcast, $scope.tab, params, buttons);
self.reloadEpisodeTable(); self.reloadEpisodeTable();
}; };
@ -142,6 +145,7 @@ var AIRTIME = (function (AIRTIME) {
PodcastController.prototype.initialize = function() { PodcastController.prototype.initialize = function() {
// TODO: this solves a race condition, but we should look for the root cause // TODO: this solves a race condition, but we should look for the root cause
AIRTIME.tabs.onResize(); AIRTIME.tabs.onResize();
this.$scope.tab.setName(this.$scope.podcast.title);
this._initTable(); this._initTable();
}; };
@ -172,16 +176,6 @@ var AIRTIME = (function (AIRTIME) {
$stationPodcastTab = undefined; $stationPodcastTab = undefined;
}; };
/**
* For the station podcast.
*
* Update the station podcast object.
*/
$scope.savePodcast = function () {
self._updatePodcast();
};
self.deleteSelectedEpisodes = function () { self.deleteSelectedEpisodes = function () {
var episodes = self.episodeTable.getSelectedRows(); var episodes = self.episodeTable.getSelectedRows();
jQuery.each(episodes, function () { jQuery.each(episodes, function () {
@ -254,6 +248,11 @@ var AIRTIME = (function (AIRTIME) {
this.episodeTable = AIRTIME.podcast.initPodcastEpisodeDatatable($scope.podcast, $scope.tab, params, buttons); 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. * Reload the Station podcast episode table.
* *