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

This commit is contained in:
mkonecny 2011-02-09 17:02:44 -05:00
commit eab3675c74
10 changed files with 105 additions and 64 deletions

View File

@ -69,6 +69,7 @@
<actionMethod actionName="showList"/> <actionMethod actionName="showList"/>
<actionMethod actionName="getShowData"/> <actionMethod actionName="getShowData"/>
<actionMethod actionName="showContentDialog"/> <actionMethod actionName="showContentDialog"/>
<actionMethod actionName="editShow"/>
</controllerFile> </controllerFile>
<controllerFile controllerName="Api"> <controllerFile controllerName="Api">
<actionMethod actionName="index"/> <actionMethod actionName="index"/>
@ -306,6 +307,9 @@
<viewControllerScriptsDirectory forControllerName="Playlist"> <viewControllerScriptsDirectory forControllerName="Playlist">
<viewScriptFile forActionName="setPlaylistFades"/> <viewScriptFile forActionName="setPlaylistFades"/>
</viewControllerScriptsDirectory> </viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Schedule">
<viewScriptFile forActionName="editShow"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory> </viewScriptsDirectory>
<viewHelpersDirectory/> <viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/> <viewFiltersDirectory enabled="false"/>

View File

@ -80,6 +80,9 @@ class LibraryController extends Zend_Controller_Action
'title' => 'Close'); 'title' => 'Close');
} }
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/metadata/format/json/id/#id#', 'callback' => 'window["createPlaylistMetaForm"]'),
'title' => 'Edit Metadata');
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'), $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/delete'.$params, 'callback' => 'window["deletePlaylist"]'),
'title' => 'Delete'); 'title' => 'Delete');

View File

@ -2,15 +2,11 @@
class ScheduleController extends Zend_Controller_Action class ScheduleController extends Zend_Controller_Action
{ {
protected $sched_sess = null; protected $sched_sess = null;
public function init() public function init()
{ {
if(!Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('login/index');
}
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('event-feed', 'json') $ajaxContext->addActionContext('event-feed', 'json')
->addActionContext('make-context-menu', 'json') ->addActionContext('make-context-menu', 'json')
@ -26,6 +22,7 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('get-current-playlist', 'json') ->addActionContext('get-current-playlist', 'json')
->addActionContext('find-playlists', 'json') ->addActionContext('find-playlists', 'json')
->addActionContext('remove-group', 'json') ->addActionContext('remove-group', 'json')
->addActionContext('edit-show', 'json')
->initContext(); ->initContext();
$this->sched_sess = new Zend_Session_Namespace("schedule"); $this->sched_sess = new Zend_Session_Namespace("schedule");
@ -111,17 +108,11 @@ class ScheduleController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id)); $show = new Show(new User($userInfo->id, $userInfo->type));
$overlap = $show->addShow($data); $show->addShow($data);
if(isset($overlap)) {
$this->view->overlap = $overlap;
}
else {
$this->_redirect('Schedule'); $this->_redirect('Schedule');
} }
} }
}
$this->view->what = $formWhat; $this->view->what = $formWhat;
$this->view->when = $formWhen; $this->view->when = $formWhen;
@ -245,10 +236,9 @@ class ScheduleController extends Zend_Controller_Action
$user = new User($userInfo->id); $user = new User($userInfo->id);
$show = new ShowInstance($showInstanceId); $show = new ShowInstance($showInstanceId);
if($user->isHost($show->getShowId())) { if($user->isHost($show->getShowId()))
$show->clearShow(); $show->clearShow();
} }
}
public function getCurrentPlaylistAction() public function getCurrentPlaylistAction()
{ {
@ -338,6 +328,32 @@ class ScheduleController extends Zend_Controller_Action
$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);
} }
public function editShowAction()
{
$formWhat = new Application_Form_AddShowWhat();
$formWhat->removeDecorator('DtDdWrapper');
$formWho = new Application_Form_AddShowWho();
$formWho->removeDecorator('DtDdWrapper');
$formWhen = new Application_Form_AddShowWhen();
$formWhen->removeDecorator('DtDdWrapper');
$formRepeats = new Application_Form_AddShowRepeats();
$formRepeats->removeDecorator('DtDdWrapper');
$formStyle = new Application_Form_AddShowStyle();
$formStyle->removeDecorator('DtDdWrapper');
$this->view->what = $formWhat;
//$this->view->when = $formWhen;
//$this->view->repeats = $formRepeats;
$this->view->who = $formWho;
$this->view->style = $formStyle;
$this->view->dialog = $this->view->render('schedule/edit-show.phtml');
} }
}

View File

@ -1,4 +1 @@
<?php <?php echo $this->form; ?>
$this->form->setAction($this->url());
echo $this->form;

View File

@ -11,13 +11,6 @@
<button id="add-show-submit" class="right-floated">Add this show</button></div> <button id="add-show-submit" class="right-floated">Add this show</button></div>
<div class="clear"></div> <div class="clear"></div>
<?php if(isset($this->overlap)) : ?>
<div id="schedule-add-show-overlap" style="display:block;">
<div>Overlap</div>
<?php echo $this->partialLoop('schedule/show-overlap.phtml', $this->overlap); ?>
</div>
<?php endif;?>
<div id="schedule-show-what"> <div id="schedule-show-what">
<?php echo $this->what ?> <?php echo $this->what ?>
</div> </div>

View File

@ -0,0 +1,15 @@
<div>
<div id="schedule-show-what">
<?php echo $this->what ?>
</div>
<div id="schedule-show-when">
<?php echo $this->when ?>
<?php echo $this->repeats ?>
</div>
<div id="schedule-show-who">
<?php echo $this->who ?>
</div>
<div id="schedule-show-style">
<?php echo $this->style ?>
</div>
</div>

View File

@ -1,4 +0,0 @@
<div>
<span><?php echo $this->name ?></span>
<span><?php echo $this->start_time ?></span>-<span><?php echo $this->end_time ?></span>
</div>

View File

@ -1,6 +1,6 @@
#Note: project.home is automatically generated by the propel-install script. #Note: project.home is automatically generated by the propel-install script.
#Any manual changes to this value will be overwritten. #Any manual changes to this value will be overwritten.
project.home = /home/martin/workspace/airtime project.home = /home/naomi/dev-campcaster/campcaster
project.build = ${project.home}/build project.build = ${project.home}/build
#Database driver #Database driver

View File

@ -328,15 +328,10 @@ function closeSPL() {
$.post(url, noOpenPL); $.post(url, noOpenPL);
} }
function newSPL() { function createPlaylistMetaForm(json) {
var url; var submit, form;
url = '/Playlist/new/format/json'; submit = $('<button id="new_playlist_submit">Submit</button>')
$.post(url, function(json){
var submit;
submit = $('<button>Submit</button>')
.button() .button()
.click(function(){ .click(function(){
var url, data; var url, data;
@ -353,11 +348,29 @@ function newSPL() {
}) })
}); });
form = $(json.form);
form.find("input, textarea")
.keydown(function(event){
//enter was pressed
if(event.keyCode === 13) {
event.preventDefault();
$("#new_playlist_submit").click();
}
})
$("#side_playlist") $("#side_playlist")
.empty() .empty()
.append(json.form) .append(form)
.append(submit); .append(submit);
}); }
function newSPL() {
var url;
url = '/Playlist/new/format/json';
$.post(url, createPlaylistMetaForm);
} }
function deleteSPL() { function deleteSPL() {

View File

@ -191,6 +191,10 @@ function buildScheduleDialog(json){
dialog.dialog('open'); dialog.dialog('open');
} }
function buildEditDialog(json){
}
function scheduleRefetchEvents() { function scheduleRefetchEvents() {
$("#schedule_calendar").fullCalendar( 'refetchEvents' ); $("#schedule_calendar").fullCalendar( 'refetchEvents' );
} }