Merge branch 'master' of dev.sourcefabric.org:campcaster

This commit is contained in:
Naomi 2011-03-31 17:22:04 -04:00
commit 3615bfbf59
6 changed files with 59 additions and 33 deletions

View File

@ -28,7 +28,7 @@ class PlaylistController extends Zend_Controller_Action
private function getPlaylist() private function getPlaylist()
{ {
$pl_sess = $this->pl_sess; $pl_sess = $this->pl_sess;
if(isset($pl_sess->id)) { if(isset($pl_sess->id)) {
$pl = Playlist::Recall($pl_sess->id); $pl = Playlist::Recall($pl_sess->id);
@ -43,7 +43,7 @@ class PlaylistController extends Zend_Controller_Action
private function changePlaylist($pl_id) private function changePlaylist($pl_id)
{ {
$pl_sess = $this->pl_sess; $pl_sess = $this->pl_sess;
if(isset($pl_sess->id)) { if(isset($pl_sess->id)) {
$pl = Playlist::Recall($pl_sess->id); $pl = Playlist::Recall($pl_sess->id);
@ -51,13 +51,13 @@ class PlaylistController extends Zend_Controller_Action
$this->closePlaylist($pl); $this->closePlaylist($pl);
} }
} }
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$pl = Playlist::Recall($pl_id); $pl = Playlist::Recall($pl_id);
if($pl === FALSE) { if($pl === FALSE) {
return FALSE; return FALSE;
} }
$pl->lock($userInfo->id); $pl->lock($userInfo->id);
$pl_sess->id = $pl_id; $pl_sess->id = $pl_id;
} }
@ -78,7 +78,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/playlist_builder.css'); $this->view->headLink()->appendStylesheet('/css/playlist_builder.css');
$this->_helper->viewRenderer->setResponseSegment('spl'); $this->_helper->viewRenderer->setResponseSegment('spl');
$this->view->pl = $this->getPlaylist(); $this->view->pl = $this->getPlaylist();
} }
@ -88,10 +88,10 @@ class PlaylistController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$pl = new Playlist(); $pl = new Playlist();
$pl_id = $pl->create("Untitled Playlist"); $pl->create("Untitled Playlist");
$pl->setPLMetaData('dc:creator', $userInfo->login); $pl->setPLMetaData('dc:creator', $userInfo->login);
$this->changePlaylist($pl_id); $this->changePlaylist($pl->getId());
$form = new Application_Form_PlaylistMetadata(); $form = new Application_Form_PlaylistMetadata();
$this->view->fieldset = $form; $this->view->fieldset = $form;
$this->view->form = $this->view->render('playlist/new.phtml'); $this->view->form = $this->view->render('playlist/new.phtml');
@ -105,25 +105,25 @@ class PlaylistController extends Zend_Controller_Action
$pl_id = $this->_getParam('id', null); $pl_id = $this->_getParam('id', null);
//not a new playlist //not a new playlist
if(!is_null($pl_id)) { if(!is_null($pl_id)) {
$this->changePlaylist($pl_id); $this->changePlaylist($pl_id);
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
$title = $pl->getPLMetaData(UI_MDATA_KEY_TITLE); $title = $pl->getPLMetaData(UI_MDATA_KEY_TITLE);
$desc = $pl->getPLMetaData(UI_MDATA_KEY_DESCRIPTION); $desc = $pl->getPLMetaData(UI_MDATA_KEY_DESCRIPTION);
$data = array( 'title' => $title, 'description' => $desc); $data = array( 'title' => $title, 'description' => $desc);
$form->populate($data); $form->populate($data);
} }
if ($request->isPost()) { if ($request->isPost()) {
$title = $this->_getParam('title', null); $title = $this->_getParam('title', null);
$description = $this->_getParam('description', null); $description = $this->_getParam('description', null);
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
if($title) if($title)
$pl->setName($title); $pl->setName($title);
if(isset($description)) { if(isset($description)) {
$pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $description); $pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $description);
} }
@ -132,7 +132,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->html = $this->view->render('playlist/index.phtml'); $this->view->html = $this->view->render('playlist/index.phtml');
unset($this->view->pl); unset($this->view->pl);
} }
$this->view->fieldset = $form; $this->view->fieldset = $form;
$this->view->form = $this->view->render('playlist/new.phtml'); $this->view->form = $this->view->render('playlist/new.phtml');
} }
@ -140,13 +140,13 @@ class PlaylistController extends Zend_Controller_Action
public function editAction() public function editAction()
{ {
$pl_id = $this->_getParam('id', null); $pl_id = $this->_getParam('id', null);
if(!is_null($pl_id)) { if(!is_null($pl_id)) {
$this->changePlaylist($pl_id); $this->changePlaylist($pl_id);
} }
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
$this->view->pl = $pl; $this->view->pl = $pl;
$this->view->html = $this->view->render('playlist/index.phtml'); $this->view->html = $this->view->render('playlist/index.phtml');
unset($this->view->pl); unset($this->view->pl);
@ -158,7 +158,7 @@ class PlaylistController extends Zend_Controller_Action
$pos = $this->_getParam('pos', null); $pos = $this->_getParam('pos', null);
if (!is_null($id)) { if (!is_null($id)) {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
$res = $pl->addAudioClip($id, $pos); $res = $pl->addAudioClip($id, $pos);
@ -181,7 +181,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
$oldPos = $this->_getParam('oldPos'); $oldPos = $this->_getParam('oldPos');
$newPos = $this->_getParam('newPos'); $newPos = $this->_getParam('newPos');
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
$pl->moveAudioClip($oldPos, $newPos); $pl->moveAudioClip($oldPos, $newPos);
@ -197,7 +197,7 @@ class PlaylistController extends Zend_Controller_Action
public function deleteItemAction() public function deleteItemAction()
{ {
$positions = $this->_getParam('pos', array()); $positions = $this->_getParam('pos', array());
if (!is_array($positions)) if (!is_array($positions))
$positions = array($positions); $positions = array($positions);
@ -208,7 +208,7 @@ class PlaylistController extends Zend_Controller_Action
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
foreach ($positions as $pos) { foreach ($positions as $pos) {
$pl->delAudioClip($pos); $pl->delAudioClip($pos);
} }
$this->view->pl = $pl; $this->view->pl = $pl;
@ -274,7 +274,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
$id = $this->_getParam('id', null); $id = $this->_getParam('id', null);
$pl = Playlist::Recall($id); $pl = Playlist::Recall($id);
if ($pl !== FALSE) { if ($pl !== FALSE) {
Playlist::Delete($id); Playlist::Delete($id);
@ -291,7 +291,7 @@ class PlaylistController extends Zend_Controller_Action
public function deleteActiveAction() public function deleteActiveAction()
{ {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
Playlist::Delete($pl->getId()); Playlist::Delete($pl->getId());
$pl_sess = $this->pl_sess; $pl_sess = $this->pl_sess;
@ -304,7 +304,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
$this->closePlaylist($pl); $this->closePlaylist($pl);
$this->view->html = $this->view->render('playlist/index.phtml'); $this->view->html = $this->view->render('playlist/index.phtml');
} }

View File

@ -176,11 +176,11 @@ class ScheduleController extends Zend_Controller_Action
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) && if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
strtotime($today_timestamp) < strtotime($show->getShowEnd())) { strtotime($today_timestamp) < strtotime($show->getShowEnd()) &&
$user->isAdmin()) {
$menu[] = array('action' => array('type' => 'fn', $menu[] = array('action' => array('type' => 'fn',
//'url' => '/Schedule/cancel-current-show'.$params, 'callback' => "window['confirmCancelShow']($id)"),
'callback' => "window['confirmCancelShow']($id)"), 'title' => 'Cancel Current Show');
'title' => 'Cancel Current Show');
} }
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) { if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
@ -319,6 +319,17 @@ class ScheduleController extends Zend_Controller_Action
$showInstanceId = $this->_getParam('id'); $showInstanceId = $this->_getParam('id');
$show = new ShowInstance($showInstanceId); $show = new ShowInstance($showInstanceId);
$originalShowId = $show->isRebroadcast();
if (!is_null($originalShowId)){
$originalShow = new ShowInstance($originalShowId);
$originalShowName = $originalShow->getName();
$originalShowStart = $originalShow->getShowStart();
$timestamp = strtotime($originalShowStart);
$this->view->additionalShowInfo =
"Rebroadcast of show \"$originalShowName\" from "
.date("l, F jS", $timestamp)." at ".date("G:i", $timestamp);
}
$this->view->showContent = $show->getShowListContent(); $this->view->showContent = $show->getShowListContent();
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
unset($this->view->showContent); unset($this->view->showContent);

View File

@ -1,7 +1,7 @@
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded"> <div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
<div class="button-bar"> <div class="button-bar">
<a href="#" id="add-show-close" class="icon-link"><span class="ui-icon ui-icon-circle-close"></span>Close</a> <a href="#" id="add-show-close" class="icon-link"><span class="ui-icon ui-icon-circle-close"></span>Close</a>
<button aria-disabled="false" role="button" id="add-show-submit" class="right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary"> <button aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
<span class="ui-icon ui-icon-plusthick"></span> <span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text">Add this show</span> <span class="ui-button-text">Add this show</span>
</button> </button>
@ -30,5 +30,11 @@
<div id="schedule-show-style" class="collapsible-content"> <div id="schedule-show-style" class="collapsible-content">
<?php echo $this->style; ?> <?php echo $this->style; ?>
</div> </div>
<div class="button-bar">
<button aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
<span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text">Add this show</span>
</button>
</div>
</div> </div>

View File

@ -1,4 +1,5 @@
<div id="show_content_dialog"> <div id="show_content_dialog">
<div><?php echo $this->additionalShowInfo; ?></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable">
<tr> <tr>
<th>Start</th> <th>Start</th>

View File

@ -1085,7 +1085,7 @@ button.ui-button-icons-only {
padding-right: 2.1em; padding-right: 2.1em;
} }
/* no icon support for input elements, provide padding by default */ /* no icon support for input elements, provide padding by default */
input.ui-button, button.ui-button { input.ui-button {
padding: .4em 1em; padding: .4em 1em;
} }
/*button icon element(s) */ /*button icon element(s) */

View File

@ -181,8 +181,15 @@ function setAddShowEvents() {
makeAddShowButton(); makeAddShowButton();
}); });
form.find("#add-show-submit") form.find(".add-show-submit")
.click(function(event){ .click(function(event){
var addShowButton = $(this);
if (!addShowButton.hasClass("disabled")){
addShowButton.addClass("disabled");
} else {
return;
}
event.preventDefault(); event.preventDefault();
var data = $("form").serializeArray(); var data = $("form").serializeArray();
@ -203,6 +210,7 @@ function setAddShowEvents() {
var end_date = $("#add_show_end_date").val(); var end_date = $("#add_show_end_date").val();
$.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){ $.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){
addShowButton.removeClass("disabled");
if(json.form) { if(json.form) {
$("#add-show-form") $("#add-show-form")
.empty() .empty()