Merge branch 'saas-dev-publishing' of https://github.com/sourcefabric/Airtime into saas-dev-publishing
This commit is contained in:
commit
8a03892ff8
8 changed files with 99 additions and 65 deletions
|
@ -55,8 +55,16 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
// Refresh the download key when enabling privacy
|
// Refresh the download key when enabling privacy
|
||||||
Application_Model_Preference::setStationPodcastDownloadKey();
|
Application_Model_Preference::setStationPodcastDownloadKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Append sharing token (download key) to Station podcast URL
|
||||||
|
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
|
||||||
|
$key = Application_Model_Preference::getStationPodcastDownloadKey();
|
||||||
|
$url = Application_Common_HTTPHelper::getStationUrl() .
|
||||||
|
(((int) $values["stationPodcastPrivacy"]) ? "feeds/station-rss?sharing_token=$key" : "feeds/station-rss");
|
||||||
|
$stationPodcast->setDbUrl($url)->save();
|
||||||
Application_Model_Preference::setStationPodcastPrivacy($values["stationPodcastPrivacy"]);
|
Application_Model_Preference::setStationPodcastPrivacy($values["stationPodcastPrivacy"]);
|
||||||
|
|
||||||
|
|
||||||
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
|
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
|
||||||
$logoUploadElement->receive();
|
$logoUploadElement->receive();
|
||||||
$imagePath = $logoUploadElement->getFileName();
|
$imagePath = $logoUploadElement->getFileName();
|
||||||
|
|
|
@ -17,8 +17,8 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm {
|
||||||
$stationPodcastPrivacy->setValue($isPrivate);
|
$stationPodcastPrivacy->setValue($isPrivate);
|
||||||
$this->addElement($stationPodcastPrivacy);
|
$this->addElement($stationPodcastPrivacy);
|
||||||
|
|
||||||
$key = Application_Model_Preference::getStationPodcastDownloadKey();
|
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
|
||||||
$url = Application_Common_HTTPHelper::getStationUrl()."feeds/station-rss".($isPrivate ? "?sharing_token=$key" : "");
|
$url = $stationPodcast->getDbUrl();
|
||||||
$feedUrl = new Zend_Form_Element_Text("stationPodcastFeedUrl:");
|
$feedUrl = new Zend_Form_Element_Text("stationPodcastFeedUrl:");
|
||||||
$feedUrl->setAttrib('class', 'input_text')
|
$feedUrl->setAttrib('class', 'input_text')
|
||||||
->setAttrib('disabled', 'disabled')
|
->setAttrib('disabled', 'disabled')
|
||||||
|
|
|
@ -8,23 +8,19 @@
|
||||||
<div class="inner_editor_wrapper">
|
<div class="inner_editor_wrapper">
|
||||||
<form class="media-metadata">
|
<form class="media-metadata">
|
||||||
<input ng-value="media.id" class="obj_id" type="hidden"/>
|
<input ng-value="media.id" class="obj_id" type="hidden"/>
|
||||||
<label class="publish-md-field">
|
<label class="publish-md-field"><?php echo _("Title") ?></label>
|
||||||
<?php echo _("Title") ?>
|
|
||||||
<input disabled ng-model="media.track_title" type="text"/>
|
<input disabled ng-model="media.track_title" type="text"/>
|
||||||
</label>
|
|
||||||
<label class="publish-md-field">
|
<label class="publish-md-field"><?php echo _("Creator") ?></label>
|
||||||
<?php echo _("Creator") ?>
|
|
||||||
<input disabled ng-model="media.artist_name" type="text"/>
|
<input disabled ng-model="media.artist_name" type="text"/>
|
||||||
</label>
|
|
||||||
<label class="publish-md-field">
|
<label class="publish-md-field"><?php echo _("Description") ?></label>
|
||||||
<?php echo _("Description") ?>
|
|
||||||
<textarea disabled ng-model="media.description"></textarea>
|
<textarea disabled ng-model="media.description"></textarea>
|
||||||
</label>
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><?php echo _("Publish to:"); ?></legend>
|
<legend><?php echo _("Publish to:"); ?></legend>
|
||||||
<div ng-repeat="(source, label) in sources.toPublish">
|
<div class="publish-sources" ng-repeat="(source, label) in sources.toPublish">
|
||||||
<input ng-model="publishData[source]" type="checkbox" name="publish_sources" id="{{source}}">
|
<input ng-model="publishData[source]" type="checkbox" name="publish_sources" id="{{source}}">
|
||||||
<label for="{{source}}">{{label}}</label><br/>
|
<label class="source-name" for="{{source}}">{{label}}</label><br/>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="sources.toPublish.length == 0">
|
<div ng-if="sources.toPublish.length == 0">
|
||||||
<?php echo _("You have already published this track to all available sources!") . "<br/>"
|
<?php echo _("You have already published this track to all available sources!") . "<br/>"
|
||||||
|
@ -36,7 +32,7 @@
|
||||||
<div class="published-sources" ng-repeat="(source, label) in sources.published">
|
<div class="published-sources" ng-repeat="(source, label) in sources.published">
|
||||||
<span class="sp-checked-icon checked-icon left-floated"></span>
|
<span class="sp-checked-icon checked-icon left-floated"></span>
|
||||||
<span class="source-name">{{label}}</span>
|
<span class="source-name">{{label}}</span>
|
||||||
<button class="btn btn-small" ng-click="remove(source)"><?php echo _("Unpublish") ?></button>
|
<button class="btn btn-small btn-danger" ng-click="remove(source)"><?php echo _("Unpublish") ?></button>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="sources.published.length == 0">
|
<div ng-if="sources.published.length == 0">
|
||||||
<?php echo _("You haven't published this track to any sources!") . "<br/>"
|
<?php echo _("You haven't published this track to any sources!") . "<br/>"
|
||||||
|
|
|
@ -408,7 +408,7 @@ textarea {
|
||||||
|
|
||||||
.edit-md-dialog .zend_form dt {
|
.edit-md-dialog .zend_form dt {
|
||||||
float: left;
|
float: left;
|
||||||
width: 40%;
|
width: 35%;
|
||||||
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ textarea {
|
||||||
|
|
||||||
.edit-md-dialog .zend_form dd {
|
.edit-md-dialog .zend_form dd {
|
||||||
float: left;
|
float: left;
|
||||||
width: auto;
|
width: 60%;
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0 0 10px;
|
margin: 0 0 10px;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-md-dialog dd input.input_text {
|
.edit-md-dialog dd input.input_text {
|
||||||
width: auto;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spl_sortable,.spl_sortable>li,.side_playlist>div,#spl_editor,.spl_artist,.spl_cue_in,.spl_fade_in,.spl_cue_out,.spl_fade_out
|
.spl_sortable,.spl_sortable>li,.side_playlist>div,#spl_editor,.spl_artist,.spl_cue_in,.spl_fade_in,.spl_cue_out,.spl_fade_out
|
||||||
|
@ -44,11 +44,13 @@
|
||||||
|
|
||||||
.playlist_editor input, .playlist_editor textarea {
|
.playlist_editor input, .playlist_editor textarea {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
box-sizing: border-box;
|
height: 70px;
|
||||||
}
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;}
|
||||||
|
|
||||||
.side_playlist textarea {
|
.side_playlist textarea {
|
||||||
height: 3.2em;
|
/*height: 70px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.spl_sortable {
|
.spl_sortable {
|
||||||
|
|
|
@ -1180,8 +1180,11 @@ input[type="checkbox"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
#pref_form textarea {
|
#pref_form textarea {
|
||||||
width: 98.5%;
|
width: 100%;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
#pref_form select {
|
#pref_form select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1703,7 +1706,14 @@ h2#scheduled_playlist_name span {
|
||||||
}
|
}
|
||||||
|
|
||||||
.simple-formblock dd .input_text {
|
.simple-formblock dd .input_text {
|
||||||
width: 97.8%;
|
width: 100%;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.simple-formblock dd textarea {
|
||||||
|
height: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.simple-formblock h2 {
|
.simple-formblock h2 {
|
||||||
|
@ -1721,7 +1731,6 @@ h2#scheduled_playlist_name span {
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
.ui-button-icon-only.crossfade-main-button .ui-button-text, .ui-button-icons-only.crossfade-main-button .ui-button-text {
|
.ui-button-icon-only.crossfade-main-button .ui-button-text, .ui-button-icons-only.crossfade-main-button .ui-button-text {
|
||||||
padding: 0;
|
|
||||||
text-indent: -1e+7px;
|
text-indent: -1e+7px;
|
||||||
padding: 0.1em 1em;
|
padding: 0.1em 1em;
|
||||||
}
|
}
|
||||||
|
@ -3989,11 +3998,15 @@ li .ui-state-hover {
|
||||||
.podcast-metadata p {
|
.podcast-metadata p {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0 5%;
|
padding: 0 5%;
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.podcast-metadata label,
|
.podcast-metadata label,
|
||||||
.podcast-metadata input,
|
.podcast-metadata input,
|
||||||
.podcast-metadata textarea {
|
.podcast-metadata textarea,
|
||||||
|
.media-metadata label,
|
||||||
|
.media-metadata input,
|
||||||
|
.media-metadata textarea{
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4001,19 +4014,23 @@ li .ui-state-hover {
|
||||||
margin: 8px 60% 0 0;
|
margin: 8px 60% 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.podcast-metadata label {
|
.podcast-metadata label,
|
||||||
|
.media-metadata label {
|
||||||
display: block;
|
display: block;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.podcast-metadata input[type="text"],
|
.podcast-metadata input[type="text"],
|
||||||
.podcast-metadata textarea {
|
.podcast-metadata textarea,
|
||||||
|
.media-metadata input[type="text"],
|
||||||
|
.media-metadata textarea {
|
||||||
width: 60%;
|
width: 60%;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* UI Revamp Video */
|
/* UI Revamp Video */
|
||||||
|
|
||||||
#whatsnew {
|
#whatsnew {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -4059,9 +4076,21 @@ li .ui-state-hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* jQuery dialog */
|
/* jQuery dialog */
|
||||||
.no-close .ui-dialog-titlebar-close {display: none }
|
.no-close .ui-dialog-titlebar-close {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
/* Publishing Dialog */
|
/* Publishing Dialog */
|
||||||
|
|
||||||
|
.source-name {
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-sources input[type="checkbox"] {
|
||||||
|
float: left;
|
||||||
|
margin: 8px 20px 0 7px;
|
||||||
|
}
|
||||||
|
|
||||||
.published-sources {
|
.published-sources {
|
||||||
color: #efefef;
|
color: #efefef;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
@ -4073,20 +4102,12 @@ li .ui-state-hover {
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.published-sources > .source-name {
|
||||||
|
display: inline-block;
|
||||||
|
width: 15%;
|
||||||
|
padding: 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.publish-edit-md {
|
.publish-edit-md {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.publish-md-field {
|
|
||||||
text-align: left !important;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.publish-md-field > textarea, .publish-md-field > input {
|
|
||||||
display: block;
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.media-metadata fieldset {
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
|
@ -12,9 +12,11 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
/**
|
/**
|
||||||
* PodcastController constructor.
|
* PodcastController constructor.
|
||||||
*
|
*
|
||||||
* @param {{}} $scope angular scope service object
|
* @param {Object} $scope angular scope service object
|
||||||
* @param {{}} $http angular http service object
|
* @param {Object} $http angular http service object
|
||||||
* @param {{}} podcast podcast metadata object
|
* @param {Object} podcast podcast metadata object
|
||||||
|
* @param {int} podcast.id podcast unique identifier
|
||||||
|
* @param {string} podcast.title podcast metadata title
|
||||||
* @param {Tab} tab Tab object the controller is being bootstrapped in
|
* @param {Tab} tab Tab object the controller is being bootstrapped in
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
|
@ -57,7 +59,6 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
self._updatePodcast = function () {
|
self._updatePodcast = 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 () {
|
||||||
// episodeTable.reload($scope.podcast.id);
|
|
||||||
self.episodeTable.getDatatable().fnDraw();
|
self.episodeTable.getDatatable().fnDraw();
|
||||||
AIRTIME.library.podcastDataTable.fnDraw();
|
AIRTIME.library.podcastDataTable.fnDraw();
|
||||||
tab.setName($scope.podcast.title);
|
tab.setName($scope.podcast.title);
|
||||||
|
@ -181,7 +182,7 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
self._updatePodcast();
|
self._updatePodcast();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.deleteSelectedEpisodes = function () {
|
self.deleteSelectedEpisodes = function () {
|
||||||
var episodes = self.episodeTable.getSelectedRows();
|
var episodes = self.episodeTable.getSelectedRows();
|
||||||
jQuery.each(episodes, function () {
|
jQuery.each(episodes, function () {
|
||||||
$http.delete(endpoint + $scope.podcast.id + '/episodes/' + this.id + '?csrf_token=' + $scope.csrf)
|
$http.delete(endpoint + $scope.podcast.id + '/episodes/' + this.id + '?csrf_token=' + $scope.csrf)
|
||||||
|
@ -191,7 +192,7 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.openSelectedTabEditors = function () {
|
self.openSelectedTabEditors = function () {
|
||||||
var episodes = self.episodeTable.getSelectedRows();
|
var episodes = self.episodeTable.getSelectedRows();
|
||||||
$.each(episodes, function () {
|
$.each(episodes, function () {
|
||||||
var uid = AIRTIME.library.MediaTypeStringEnum.FILE + "_" + this.file_id;
|
var uid = AIRTIME.library.MediaTypeStringEnum.FILE + "_" + this.file_id;
|
||||||
|
@ -215,7 +216,7 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
StationPodcastController.prototype._initTable = function() {
|
StationPodcastController.prototype._initTable = function() {
|
||||||
var $scope = this.$scope,
|
var self = this, $scope = this.$scope,
|
||||||
buttons = {
|
buttons = {
|
||||||
editBtn: {
|
editBtn: {
|
||||||
title : $.i18n._('Edit Metadata'),
|
title : $.i18n._('Edit Metadata'),
|
||||||
|
@ -223,8 +224,8 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
extraBtnClass : '',
|
extraBtnClass : '',
|
||||||
elementId : '',
|
elementId : '',
|
||||||
eventHandlers : {
|
eventHandlers : {
|
||||||
click: function(e) {
|
click: function () {
|
||||||
$scope.openSelectedTabEditors();
|
self.openSelectedTabEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -234,8 +235,8 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
extraBtnClass : 'btn-danger',
|
extraBtnClass : 'btn-danger',
|
||||||
elementId : '',
|
elementId : '',
|
||||||
eventHandlers : {
|
eventHandlers : {
|
||||||
click: function(e) {
|
click: function () {
|
||||||
$scope.deleteSelectedEpisodes();
|
self.deleteSelectedEpisodes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,10 +441,10 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
*
|
*
|
||||||
* Selection for the internal table represents episodes marked for ingest and is disabled for ingested episodes.
|
* Selection for the internal table represents episodes marked for ingest and is disabled for ingested episodes.
|
||||||
*
|
*
|
||||||
* @param podcast the podcast data JSON object.
|
* @param {Object} podcast the podcast data JSON object.
|
||||||
* @param tab Tab object the podcast will be opened in
|
* @param {Tab} tab Tab object the podcast will be opened in
|
||||||
* @param params JSON object containing datatables parameters to override
|
* @param {Object} params JSON object containing datatables parameters to override
|
||||||
* @param buttons JSON object containing datatables button parameters
|
* @param {Object} buttons JSON object containing datatables button parameters
|
||||||
*
|
*
|
||||||
* @returns {*} the created Table object
|
* @returns {*} the created Table object
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -111,10 +111,6 @@ var AIRTIME = (function(AIRTIME){
|
||||||
Tab.prototype._init = function() {
|
Tab.prototype._init = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.assignTabClickHandler(function(e) {
|
self.assignTabClickHandler(function(e) {
|
||||||
if (e.which == 2) { // Middle mouse
|
|
||||||
self.close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!$(this).hasClass('active')) {
|
if (!$(this).hasClass('active')) {
|
||||||
self.switchTo();
|
self.switchTo();
|
||||||
}
|
}
|
||||||
|
@ -146,7 +142,17 @@ var AIRTIME = (function(AIRTIME){
|
||||||
* @param {function} f the function to call when the tab is clicked
|
* @param {function} f the function to call when the tab is clicked
|
||||||
*/
|
*/
|
||||||
Tab.prototype.assignTabClickHandler = function(f) {
|
Tab.prototype.assignTabClickHandler = function(f) {
|
||||||
this.tab.unbind("click").on("click", f);
|
var self = this;
|
||||||
|
self.tab.unbind("click").on("click", function (e) {
|
||||||
|
// Always close on middle mouse press
|
||||||
|
if (e.which == 2) {
|
||||||
|
// Simulate a click on the close tab button so any
|
||||||
|
// additional on-close behaviour is executed
|
||||||
|
self.tab.find(".lib_pl_close").click();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
f();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue