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
|
||||
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"]);
|
||||
|
||||
|
||||
$logoUploadElement = $form->getSubForm('preferences_general')->getElement('stationLogo');
|
||||
$logoUploadElement->receive();
|
||||
$imagePath = $logoUploadElement->getFileName();
|
||||
|
|
|
@ -17,8 +17,8 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm {
|
|||
$stationPodcastPrivacy->setValue($isPrivate);
|
||||
$this->addElement($stationPodcastPrivacy);
|
||||
|
||||
$key = Application_Model_Preference::getStationPodcastDownloadKey();
|
||||
$url = Application_Common_HTTPHelper::getStationUrl()."feeds/station-rss".($isPrivate ? "?sharing_token=$key" : "");
|
||||
$stationPodcast = PodcastQuery::create()->findOneByDbId(Application_Model_Preference::getStationPodcastId());
|
||||
$url = $stationPodcast->getDbUrl();
|
||||
$feedUrl = new Zend_Form_Element_Text("stationPodcastFeedUrl:");
|
||||
$feedUrl->setAttrib('class', 'input_text')
|
||||
->setAttrib('disabled', 'disabled')
|
||||
|
|
|
@ -8,23 +8,19 @@
|
|||
<div class="inner_editor_wrapper">
|
||||
<form class="media-metadata">
|
||||
<input ng-value="media.id" class="obj_id" type="hidden"/>
|
||||
<label class="publish-md-field">
|
||||
<?php echo _("Title") ?>
|
||||
<label class="publish-md-field"><?php echo _("Title") ?></label>
|
||||
<input disabled ng-model="media.track_title" type="text"/>
|
||||
</label>
|
||||
<label class="publish-md-field">
|
||||
<?php echo _("Creator") ?>
|
||||
|
||||
<label class="publish-md-field"><?php echo _("Creator") ?></label>
|
||||
<input disabled ng-model="media.artist_name" type="text"/>
|
||||
</label>
|
||||
<label class="publish-md-field">
|
||||
<?php echo _("Description") ?>
|
||||
|
||||
<label class="publish-md-field"><?php echo _("Description") ?></label>
|
||||
<textarea disabled ng-model="media.description"></textarea>
|
||||
</label>
|
||||
<fieldset>
|
||||
<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}}">
|
||||
<label for="{{source}}">{{label}}</label><br/>
|
||||
<label class="source-name" for="{{source}}">{{label}}</label><br/>
|
||||
</div>
|
||||
<div ng-if="sources.toPublish.length == 0">
|
||||
<?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">
|
||||
<span class="sp-checked-icon checked-icon left-floated"></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 ng-if="sources.published.length == 0">
|
||||
<?php echo _("You haven't published this track to any sources!") . "<br/>"
|
||||
|
|
|
@ -408,7 +408,7 @@ textarea {
|
|||
|
||||
.edit-md-dialog .zend_form dt {
|
||||
float: left;
|
||||
width: 40%;
|
||||
width: 35%;
|
||||
|
||||
text-align: right;
|
||||
|
||||
|
@ -419,7 +419,7 @@ textarea {
|
|||
|
||||
.edit-md-dialog .zend_form dd {
|
||||
float: left;
|
||||
width: auto;
|
||||
width: 60%;
|
||||
|
||||
font-size: 14px;
|
||||
margin: 0 0 10px;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
}
|
||||
|
||||
.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
|
||||
|
@ -44,11 +44,13 @@
|
|||
|
||||
.playlist_editor input, .playlist_editor textarea {
|
||||
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 {
|
||||
height: 3.2em;
|
||||
/*height: 70px;*/
|
||||
}
|
||||
|
||||
.spl_sortable {
|
||||
|
|
|
@ -1180,8 +1180,11 @@ input[type="checkbox"] {
|
|||
width: 100%;
|
||||
}
|
||||
#pref_form textarea {
|
||||
width: 98.5%;
|
||||
width: 100%;
|
||||
padding-left: 5px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
#pref_form select {
|
||||
width: 100%;
|
||||
|
@ -1703,7 +1706,14 @@ h2#scheduled_playlist_name span {
|
|||
}
|
||||
|
||||
.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 {
|
||||
|
@ -1721,7 +1731,6 @@ h2#scheduled_playlist_name span {
|
|||
padding-right: 8px;
|
||||
}
|
||||
.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;
|
||||
padding: 0.1em 1em;
|
||||
}
|
||||
|
@ -3989,11 +3998,15 @@ li .ui-state-hover {
|
|||
.podcast-metadata p {
|
||||
text-align: center;
|
||||
padding: 0 5%;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.podcast-metadata label,
|
||||
.podcast-metadata input,
|
||||
.podcast-metadata textarea {
|
||||
.podcast-metadata textarea,
|
||||
.media-metadata label,
|
||||
.media-metadata input,
|
||||
.media-metadata textarea{
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
|
@ -4001,19 +4014,23 @@ li .ui-state-hover {
|
|||
margin: 8px 60% 0 0;
|
||||
}
|
||||
|
||||
.podcast-metadata label {
|
||||
.podcast-metadata label,
|
||||
.media-metadata label {
|
||||
display: block;
|
||||
width: 20%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.podcast-metadata input[type="text"],
|
||||
.podcast-metadata textarea {
|
||||
.podcast-metadata textarea,
|
||||
.media-metadata input[type="text"],
|
||||
.media-metadata textarea {
|
||||
width: 60%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* UI Revamp Video */
|
||||
|
||||
#whatsnew {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -4059,9 +4076,21 @@ li .ui-state-hover {
|
|||
}
|
||||
|
||||
/* jQuery dialog */
|
||||
.no-close .ui-dialog-titlebar-close {display: none }
|
||||
.no-close .ui-dialog-titlebar-close {
|
||||
display: none
|
||||
}
|
||||
|
||||
/* Publishing Dialog */
|
||||
|
||||
.source-name {
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.publish-sources input[type="checkbox"] {
|
||||
float: left;
|
||||
margin: 8px 20px 0 7px;
|
||||
}
|
||||
|
||||
.published-sources {
|
||||
color: #efefef;
|
||||
font-size: 14px;
|
||||
|
@ -4073,20 +4102,12 @@ li .ui-state-hover {
|
|||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.published-sources > .source-name {
|
||||
display: inline-block;
|
||||
width: 15%;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.publish-edit-md {
|
||||
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.
|
||||
*
|
||||
* @param {{}} $scope angular scope service object
|
||||
* @param {{}} $http angular http service object
|
||||
* @param {{}} podcast podcast metadata object
|
||||
* @param {Object} $scope angular scope service object
|
||||
* @param {Object} $http angular http service 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
|
||||
*
|
||||
* @constructor
|
||||
|
@ -57,7 +59,6 @@ var AIRTIME = (function (AIRTIME) {
|
|||
self._updatePodcast = function () {
|
||||
$http.put(endpoint + $scope.podcast.id, {csrf_token: $scope.csrf, podcast: $scope.podcast})
|
||||
.success(function () {
|
||||
// episodeTable.reload($scope.podcast.id);
|
||||
self.episodeTable.getDatatable().fnDraw();
|
||||
AIRTIME.library.podcastDataTable.fnDraw();
|
||||
tab.setName($scope.podcast.title);
|
||||
|
@ -181,7 +182,7 @@ var AIRTIME = (function (AIRTIME) {
|
|||
self._updatePodcast();
|
||||
};
|
||||
|
||||
$scope.deleteSelectedEpisodes = function () {
|
||||
self.deleteSelectedEpisodes = function () {
|
||||
var episodes = self.episodeTable.getSelectedRows();
|
||||
jQuery.each(episodes, function () {
|
||||
$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();
|
||||
$.each(episodes, function () {
|
||||
var uid = AIRTIME.library.MediaTypeStringEnum.FILE + "_" + this.file_id;
|
||||
|
@ -215,7 +216,7 @@ var AIRTIME = (function (AIRTIME) {
|
|||
* @private
|
||||
*/
|
||||
StationPodcastController.prototype._initTable = function() {
|
||||
var $scope = this.$scope,
|
||||
var self = this, $scope = this.$scope,
|
||||
buttons = {
|
||||
editBtn: {
|
||||
title : $.i18n._('Edit Metadata'),
|
||||
|
@ -223,8 +224,8 @@ var AIRTIME = (function (AIRTIME) {
|
|||
extraBtnClass : '',
|
||||
elementId : '',
|
||||
eventHandlers : {
|
||||
click: function(e) {
|
||||
$scope.openSelectedTabEditors();
|
||||
click: function () {
|
||||
self.openSelectedTabEditors();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -234,8 +235,8 @@ var AIRTIME = (function (AIRTIME) {
|
|||
extraBtnClass : 'btn-danger',
|
||||
elementId : '',
|
||||
eventHandlers : {
|
||||
click: function(e) {
|
||||
$scope.deleteSelectedEpisodes();
|
||||
click: function () {
|
||||
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.
|
||||
*
|
||||
* @param podcast the podcast data JSON object.
|
||||
* @param tab Tab object the podcast will be opened in
|
||||
* @param params JSON object containing datatables parameters to override
|
||||
* @param buttons JSON object containing datatables button parameters
|
||||
* @param {Object} podcast the podcast data JSON object.
|
||||
* @param {Tab} tab Tab object the podcast will be opened in
|
||||
* @param {Object} params JSON object containing datatables parameters to override
|
||||
* @param {Object} buttons JSON object containing datatables button parameters
|
||||
*
|
||||
* @returns {*} the created Table object
|
||||
*/
|
||||
|
|
|
@ -111,10 +111,6 @@ var AIRTIME = (function(AIRTIME){
|
|||
Tab.prototype._init = function() {
|
||||
var self = this;
|
||||
self.assignTabClickHandler(function(e) {
|
||||
if (e.which == 2) { // Middle mouse
|
||||
self.close();
|
||||
return;
|
||||
}
|
||||
if (!$(this).hasClass('active')) {
|
||||
self.switchTo();
|
||||
}
|
||||
|
@ -146,7 +142,17 @@ var AIRTIME = (function(AIRTIME){
|
|||
* @param {function} f the function to call when the tab is clicked
|
||||
*/
|
||||
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