Remove station podcast from podcast datatable; editor now opens from button in podcasts view
This commit is contained in:
parent
8c49477b9c
commit
4b11979eff
|
@ -120,6 +120,7 @@ class LocaleController extends Zend_Controller_Action
|
||||||
"Input must be a number" => _("Input must be a number"),
|
"Input must be a number" => _("Input must be a number"),
|
||||||
"Input must be in the format: yyyy-mm-dd" => _("Input must be in the format: yyyy-mm-dd"),
|
"Input must be in the format: yyyy-mm-dd" => _("Input must be in the format: yyyy-mm-dd"),
|
||||||
"Input must be in the format: hh:mm:ss.t" => _("Input must be in the format: hh:mm:ss.t"),
|
"Input must be in the format: hh:mm:ss.t" => _("Input must be in the format: hh:mm:ss.t"),
|
||||||
|
"My Station Podcast" => _("My Station Podcast"),
|
||||||
//library/plupload.js
|
//library/plupload.js
|
||||||
"You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"
|
"You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"
|
||||||
=> _("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"),
|
=> _("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"),
|
||||||
|
|
|
@ -23,6 +23,16 @@ class Rest_Bootstrap extends Zend_Application_Module_Bootstrap
|
||||||
);
|
);
|
||||||
$router->addRoute('podcast-bulk', $podcastBulkRoute);
|
$router->addRoute('podcast-bulk', $podcastBulkRoute);
|
||||||
|
|
||||||
|
$stationPodcastRoute = new Zend_Controller_Router_Route(
|
||||||
|
'rest/podcast/station',
|
||||||
|
array(
|
||||||
|
'controller' => 'podcast',
|
||||||
|
'action' => 'station',
|
||||||
|
'module' => 'rest'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$router->addRoute('station-podcast', $stationPodcastRoute);
|
||||||
|
|
||||||
$route = new Rest_RouteController($front,
|
$route = new Rest_RouteController($front,
|
||||||
'rest/podcast/:id/episodes',
|
'rest/podcast/:id/episodes',
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -27,7 +27,9 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
||||||
$sortColumn = $this->_getParam('sort', PodcastPeer::ID);
|
$sortColumn = $this->_getParam('sort', PodcastPeer::ID);
|
||||||
$sortDir = $this->_getParam('sort_dir', Criteria::ASC);
|
$sortDir = $this->_getParam('sort_dir', Criteria::ASC);
|
||||||
|
|
||||||
|
// Don't return the Station podcast - we fetch it separately
|
||||||
$query = PodcastQuery::create()
|
$query = PodcastQuery::create()
|
||||||
|
->filterByDbId(Application_Model_Preference::getStationPodcastId(), Criteria::NOT_EQUAL)
|
||||||
->setLimit($limit)
|
->setLimit($limit)
|
||||||
->setOffset($offset)
|
->setOffset($offset)
|
||||||
->orderBy($sortColumn, $sortDir);
|
->orderBy($sortColumn, $sortDir);
|
||||||
|
@ -173,17 +175,13 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
||||||
foreach($ids as $id) {
|
foreach($ids as $id) {
|
||||||
Application_Service_PodcastService::deletePodcastById($id);
|
Application_Service_PodcastService::deletePodcastById($id);
|
||||||
}
|
}
|
||||||
// XXX: do we need this to be more descriptive?
|
|
||||||
// Should we even bother passing back a response message here?
|
|
||||||
$responseBody = "Successfully deleted podcasts";
|
|
||||||
break;
|
break;
|
||||||
case HttpRequestType::GET:
|
case HttpRequestType::GET:
|
||||||
foreach($ids as $id) {
|
foreach($ids as $id) {
|
||||||
// TODO: This should use the same code path as the GET action.
|
$responseBody[] = array(
|
||||||
// It essentially does, except for the rendering of the tab layout.
|
"podcast" => Application_Service_PodcastService::getPodcastById($id),
|
||||||
// That said, not every GET is going to need the page rendered...
|
"html" => $this->view->render('podcast/podcast.phtml')
|
||||||
// Where should the rendering code for the podcast tabs go? -- Duncan
|
);
|
||||||
$responseBody[] = Application_Service_PodcastService::buildPodcastEditorResponse($id, $this->view);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -191,6 +189,17 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
||||||
$this->_helper->json->sendJson($responseBody);
|
$this->_helper->json->sendJson($responseBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function stationAction() {
|
||||||
|
$stationPodcastId = Application_Model_Preference::getStationPodcastId();
|
||||||
|
$podcast = Application_Service_PodcastService::getPodcastById($stationPodcastId);
|
||||||
|
$path = 'podcast/station_podcast.phtml';
|
||||||
|
$this->view->podcast = $podcast;
|
||||||
|
$this->_helper->json->sendJson(array(
|
||||||
|
"podcast" => json_encode($podcast),
|
||||||
|
"html" => $this->view->render($path),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
private function getId()
|
private function getId()
|
||||||
{
|
{
|
||||||
if (!$id = $this->_getParam('id', false)) {
|
if (!$id = $this->_getParam('id', false)) {
|
||||||
|
|
|
@ -1277,14 +1277,18 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
|
|
||||||
var podcastToolbarButtons = AIRTIME.widgets.Table.getStandardToolbarButtons();
|
var podcastToolbarButtons = AIRTIME.widgets.Table.getStandardToolbarButtons();
|
||||||
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.NEW].title = $.i18n._('Add'); //"New" Podcast is misleading
|
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.NEW].title = $.i18n._('Add'); //"New" Podcast is misleading
|
||||||
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.NEW].eventHandlers.click = function(e) {
|
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.NEW].eventHandlers.click = AIRTIME.podcast.createUrlDialog;
|
||||||
AIRTIME.podcast.createUrlDialog();
|
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.EDIT].eventHandlers.click = AIRTIME.podcast.editSelectedPodcasts;
|
||||||
};
|
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.DELETE].eventHandlers.click = AIRTIME.podcast.deleteSelectedPodcasts;
|
||||||
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.EDIT].eventHandlers.click = function(e) {
|
// Add a button to view the station podcast
|
||||||
AIRTIME.podcast.editSelectedPodcasts();
|
podcastToolbarButtons["StationPodcast"] = {
|
||||||
};
|
'title' : $.i18n._("My Station Podcast"),
|
||||||
podcastToolbarButtons[AIRTIME.widgets.Table.TOOLBAR_BUTTON_ROLES.DELETE].eventHandlers.click = function(e) {
|
'iconClass' : "icon-music",
|
||||||
AIRTIME.podcast.deleteSelectedPodcasts();
|
extraBtnClass : "",
|
||||||
|
elementId : "",
|
||||||
|
eventHandlers : {
|
||||||
|
click: AIRTIME.podcast.openStationPodcast
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Set up the div with id "podcast_table" as a datatable.
|
//Set up the div with id "podcast_table" as a datatable.
|
||||||
|
|
|
@ -216,6 +216,15 @@ var AIRTIME = (function (AIRTIME) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a tab to view and edit the station podcast
|
||||||
|
*/
|
||||||
|
mod.openStationPodcast = function() {
|
||||||
|
$.get(endpoint + 'station', function(json) {
|
||||||
|
_initAppFromResponse(json);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a bulk request to edit all currently selected podcasts.
|
* Create a bulk request to edit all currently selected podcasts.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue