SAAS-1234 - bind station feed url to angular data model

This commit is contained in:
Duncan Sommerville 2015-11-19 17:09:49 -05:00
parent c328515f4b
commit 641cfb9432
5 changed files with 11 additions and 28 deletions

View File

@ -17,16 +17,6 @@ class Application_Form_PodcastPreferences extends Zend_Form_SubForm {
));
$stationPodcastPrivacy->setValue($isPrivate);
$this->addElement($stationPodcastPrivacy);
$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')
->setRequired(false)
->setLabel(_("Feed URL"))
->setValue($url);
$this->addElement($feedUrl);
}
}

View File

@ -1,4 +0,0 @@
<fieldset class="padded">
<?php echo $this->element->getElement('stationPodcastPrivacy')->render() ?>
<?php echo $this->element->getElement('stationPodcastFeedUrl')->render() ?>
</fieldset>

View File

@ -26,9 +26,6 @@
<label><?php echo _("Creator") ?></label>
<input name="podcast_creator" ng-model="podcast.creator" type="text"/>
<label><?php echo _("URL") ?></label>
<input disabled name="podcast_url" ng-model="podcast.url" type="text"/>
<label><?php echo _("Description") ?></label>
<textarea name="podcast_description" ng-model="podcast.description"></textarea>
@ -81,8 +78,12 @@
<?php echo $this->form->getSubform('preferences_podcast')->getElement("stationPodcastPrivacy")->renderViewHelper() ?>
</div>
<div style="clear:both"></div>
<?php echo $this->form->getSubform('preferences_podcast')->getElement("stationPodcastFeedUrl") ?>
<dt>
<label for="stationPodcastFeedUrl" class="optional">Feed URL</label>
</dt>
<dd>
<input type="url" ng-model="podcast.url" disabled="disabled" class="input_text" />
</dd>
</dl>
</fieldset>
</div>
@ -122,5 +123,4 @@
$(this).toggleClass("closed");
return false;
});
</script>

View File

@ -9,6 +9,10 @@
overflow: hidden;
}
#station_podcast .inner_editor_title h2 {
width: 40%;
}
#station_podcast .inner_editor_title * {
margin: 0;
}

View File

@ -107,7 +107,7 @@ var AIRTIME = (function (AIRTIME) {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: { stationPodcastPrivacy: $("#podcast-settings").find("input:checked").val() }
}).success(function (data) {
$("#preferences_podcast-stationPodcastFeedUrl").val(data.url);
jQuery.extend($scope.podcast, data);
$(".success").text($.i18n._("Podcast settings saved")).slideDown("fast");
setTimeout(function () {
$(".success").slideUp("fast");
@ -138,13 +138,6 @@ var AIRTIME = (function (AIRTIME) {
});
};
/**
* Open metadata editor tabs for each of the selected episodes.
*/
StationPodcastController.prototype.openSelectedTabEditors = function () {
mod.editSelectedEpisodes(this.episodeTable.getSelectedRows());
};
/**
* Initialize the Station podcast episode table.
*