checks on dates, UI work mostly done

This commit is contained in:
naomiaro 2011-01-30 20:11:18 -05:00
parent dc6fcec0e3
commit 092b36c346
17 changed files with 293 additions and 197 deletions

View File

@ -85,7 +85,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/js/playlist/helperfunctions.js','text/javascript');
$this->view->headScript()->appendFile('/js/playlist/playlist.js','text/javascript');
$this->view->headLink()->appendStylesheet('/css/jquery-ui-timepicker.css.css');
$this->view->headLink()->appendStylesheet('/css/jquery-ui-timepicker.css');
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
$this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css');
$this->view->headLink()->appendStylesheet('/css/add-show.css');
@ -110,7 +110,20 @@ class ScheduleController extends Zend_Controller_Action
$what = $formWhat->isValid($data);
$when = $formWhen->isValid($data);
$repeats = $formRepeats->isValid($data);
if($when) {
$when = $formWhen->checkReliantFields($data);
}
if($data["add_show_repeats"]) {
$repeats = $formRepeats->isValid($data);
if($repeats) {
$when = $formRepeats->checkReliantFields($data);
}
}
else {
$repeats = 1; //make it valid, results don't matter anyways.
}
$who = $formWho->isValid($data);
$style = $formStyle->isValid($data);
@ -126,7 +139,7 @@ class ScheduleController extends Zend_Controller_Action
}
else {
$this->_redirect('Schedule');
}
}
}
}

View File

@ -23,10 +23,16 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
),
));
$checkboxes = $this->getElement('add_show_day_check');
$checkboxes->setDecorators(array(array('ViewScript', array(
'viewScript' => 'form/add-show-checkbox.phtml'
))));
// Add end date element
$this->addElement('text', 'add_show_end_date', array(
'label' => 'Date End:',
//'class' => 'input_text hasDatepicker',
'class' => 'input_text',
'required' => false,
'filters' => array('StringTrim'),
'validators' => array(
@ -42,6 +48,21 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
));
}
public function checkReliantFields($formData) {
$start_timestamp = $formData['add_show_start_date'];
$end_timestamp = $formData['add_show_end_date'];
$start_epoch = strtotime($start_timestamp);
$end_epoch = strtotime($end_timestamp);
if($end_epoch < $start_epoch) {
$this->getElement('add_show_end_date')->setErrors(array('End date must be after start date'));
return false;
}
return true;
}
}

View File

@ -14,11 +14,11 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
'validators' => array('NotEmpty')
));
$nameLabel = $this->getElement('add_show_name');
$nameInput = $this->getElement('add_show_name');
$nameLabel->setDecorators(array(array('ViewScript', array(
'viewScript' => 'testform.phtml',
'class' => 'test template'
$nameInput->setDecorators(array(array('ViewScript', array(
'viewScript' => 'form/add-show-block.phtml',
'class' => 'block-display'
))));
@ -29,6 +29,13 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
'class' => 'input_text_area'
));
$descText = $this->getElement('add_show_description');
$descText->setDecorators(array(array('ViewScript', array(
'viewScript' => 'form/add-show-block.phtml',
'class' => 'block-display'
))));
}

View File

@ -8,7 +8,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
// Add start date element
$this->addElement('text', 'add_show_start_date', array(
'label' => 'Date Start:',
//'class' => 'input_text hasDatepicker',
'class' => 'input_text',
'required' => true,
'filters' => array('StringTrim'),
'validators' => array(
@ -49,8 +49,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
}
/*
public function postValidation(array $formData) {
public function checkReliantFields($formData) {
$now_timestamp = date("Y-m-d H:i:s");
$start_timestamp = $formData['add_show_start_date']."".$formData['add_show_start_time'];
@ -65,7 +64,6 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
return true;
}
*/
}

View File

@ -76,14 +76,17 @@ class Show {
$start = $data['add_show_start_date'];
}
$showDay = new CcShowDays();
$showDay->setDbFirstShow($start);
$showDay->setDbLastShow($endDate);
$showDay->setDbStartTime($data['add_show_start_time']);
$showDay->setDbEndTime($endTime);
$showDay->setDbDay($day);
$showDay->setDbShowId($showId);
$showDay->save();
if(strtotime($start) < strtotime($endDate)) {
$showDay = new CcShowDays();
$showDay->setDbFirstShow($start);
$showDay->setDbLastShow($endDate);
$showDay->setDbStartTime($data['add_show_start_time']);
$showDay->setDbEndTime($endTime);
$showDay->setDbDay($day);
$showDay->setDbShowId($showId);
$showDay->save();
}
}
foreach ($data['add_show_hosts'] as $host) {

View File

@ -1,11 +1,12 @@
<div class="<?php echo $this->class ?>">
<dt id="<?php echo $this->element->getName() ?>-label" class="<?php echo $this->class ?>">
<?php echo $this->formLabel($this->element->getName(),
$this->element->getLabel()) ?>
</dt>
<dd id="<?php echo $this->element->getName() ?>-element" class="<?php echo $this->class ?>">
<?php echo $this->{$this->element->helper}(
$this->element->getName(),
$this->element->getValue(),
$this->element->getAttribs()
) ?>
<?php echo $this->formErrors($this->element->getMessages()) ?>
<div class="hint"><?php echo $this->element->getDescription() ?></div>
</div>
</dd>

View File

@ -0,0 +1,14 @@
<dt id="<?php echo $this->element->getName() ?>-label" class="block-display">
<?php echo $this->formLabel($this->element->getName(),
$this->element->getLabel()) ?>
</dt>
<dd id="<?php echo $this->element->getName() ?>-element" class="block-display clearfix">
<?php $i=0 ?>
<?php foreach ($this->element->getMultiOptions() as $opt) : ?>
<label class="wrapp-label" for="<?php echo $this->element->getName() ?>-<?php echo $i ?>">
<input id="<?php echo $this->element->getName() ?>-<?php echo $i ?>" value="<?php echo $i ?>" type="checkbox" name="add_show_day_check[]"><?php echo $opt ?></input>
</label>
<?php $i=$i+1 ?>
<?php endforeach; ?>
<?php echo $this->formErrors($this->element->getMessages()) ?>
</dd>

View File

@ -1,12 +1,23 @@
<div id="schedule-add-show">
<div class="wrapper" id="content">
<form method="post" action="">
<div id="schedule-add-show-tabs">
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
<ul>
<li><a href="#schedule-show-what"><span>What</span></a></li>
<li><a href="#schedule-show-when"><span>When</span></a></li>
<li><a href="#schedule-show-who"><span>Who</span></a></li>
<li><a href="#schedule-show-style"><span>Style</span></a></li>
</ul>
<div class="button-bar">
<button id="add-show-submit" class="right-floated">Add this show</button></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">
<?php echo $this->what ?>
</div>
@ -22,13 +33,6 @@
</div>
</div>
</form>
<button id="add-show-submit">Add</button>
</div>
<div id="fullcalendar_show_display"></div>
<div id="schedule-add-show-overlap">
<?php if(isset($this->overlap)) : ?>
<div>Overlap</div>
<?php echo $this->partialLoop('schedule/show-overlap.phtml', $this->overlap); ?>
<?php endif;?>
<div id="fullcalendar_show_display" class="ui-widget-content block-shadow omega-block padded"></div>
</div>

View File

@ -18,12 +18,10 @@
width: 60%;
}
#schedule-add-show-overlap {
clear: left;
}
#schedule-add-show .ui-tabs-panel {
padding-top: 16px;
padding-top: 8px;
}
#schedule-add-show fieldset {
padding:8px;
@ -82,6 +80,9 @@ label.wrapp-label input[type="checkbox"] {
#schedule-add-show fieldset {
min-height:70px;
}
#schedule-add-show fieldset:last-child {
margin-bottom:0;
}
#schedule-add-show fieldset dd input[type="checkbox"] {
margin-top:2px;
}
@ -96,4 +97,13 @@ label.wrapp-label input[type="checkbox"] {
}
#add_show_name-element .input_text {
width:99%;
}
#schedule-add-show-overlap {
border: 1px solid #c83f3f;
background: #c6b4b4;
margin-top:8px;
padding:8px;
color:#902d2d;
display:none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -7,9 +7,9 @@
* version 0.0.4 : Removed width:100% on tables
*/
.ui-timepicker-inline { display: inline; }
.ui-timepicker-inline { display: inline }
#ui-timepicker-div { padding: 0.2em }
#ui-timepicker-div { padding: 0.2em; z-index: 5 !important }
.ui-timepicker-table { display: inline-table }
.ui-timepicker-table table { margin:0.15em 0 0 0; border-collapse: collapse; }
@ -25,4 +25,4 @@
text-align:right;
text-decoration:none;
}
}

View File

@ -51,8 +51,9 @@
position:relative;
}
#side_playlist li div.list-item-container {
#side_playlist li div.list-item-container, #side_playlist li div.list-item-container.ui-state-active {
height:56px;
border: none;
}
#spl_name {
@ -70,7 +71,9 @@
.spl_playlength {
float:right;
font-size:14px;
padding:0 5px 0 0
padding:0 5px 0 0;
width:100px;
text-align:right;
}
.spl_artist {
@ -202,4 +205,32 @@
}
#spl_sortable dl.inline-list {
margin:10px 0 0 37px;
}
#spl_sortable li .spl_fade_start, #spl_sortable li .spl_fade_end {
background-color: transparent;
float:right;
font-size: 9px;
height: 15px;
right: 35px;
width: 33px;
margin-top:2px;
}
#spl_sortable li .spl_fade_start.ui-state-default {
background: transparent url(images/fade_in.png) no-repeat 0 0;
border:none;
}
#spl_sortable li .spl_fade_start.ui-state-active {
background: transparent url(images/fade_in.png) no-repeat 0 -30px;
border:none;
}
#spl_sortable li .spl_fade_end.ui-state-default {
background: transparent url(images/fade_out.png) no-repeat 0 0;
border:none;
}
#spl_sortable li .spl_fade_end.ui-state-active {
background: transparent url(images/fade_out.png) no-repeat 0 -30px;
border:none;
}

View File

@ -1509,3 +1509,8 @@ padding: 0;
margin: -1px;
height:100%;
}
.ui-datepicker {
display:none;
}

View File

@ -1,127 +1,127 @@
#content {
width: 75%;
}
div.ui-datepicker {
font-size: 75%;
}
#schedule_playlist_dialog > div {
float: left;
width: 510px;
padding: 5px;
}
#schedule_playlist_dialog ul {
list-style-type: none;
overflow: auto;
margin: 0;
padding: 10px 5px;
height: 275px;
}
#schedule_playlist_chosen li {
float: left;
clear: left;
margin: 0;
width: 95%;
}
#schedule_playlist_chosen li > h3 {
float: left;
padding: 0;
margin: 0;
width: 475px;
}
#schedule_playlist_chosen li > h3 > div {
float: left;
margin: 0 5px 2px 0;
}
#schedule_playlist_chosen li > h3 > div > span.ui-icon {
margin-top: 4px;
}
#schedule_playlist_chosen li div{
float: left;
}
#schedule_playlist_chosen li > div{
width: 475px;
}
#schedule_playlist_chosen li > div > div > span{
float: left;
}
#schedule_playlist_chosen li > div > div{
clear: left;
padding-top: 5px;
padding-left: 5px;
}
.sched_description {
clear: left;
font-size: 85%;
margin-left: 2em;
}
.sh_pl_name {
width: 150px;
}
.sh_pl_creator {
width: 125px;
}
.sh_pl_time {
width: 125px;
}
.sh_file_name {
display: inline-block;
width: 325px;
}
.sh_file_artist {
font-size: 90%;
padding-bottom: 5px;
}
#show_time_info > div, #show_time_info > span{
float: left;
}
#show_progressbar {
width: 150px;
height: 5px;
margin-top: 12px;
}
.time {
width: 150px;
margin: 5px;
text-align: center;
}
/* Add show Dialog----------------------------------------------------------------------------------------------------
*
*
*
*/
#add_show_name {
}
#add_show_description {
width: 400px;
height: 200px;
}
#fullcalendar_show_display {
width: 400px;
}
#content {
width: 75%;
}
div.ui-datepicker {
font-size: 75%;
}
#schedule_playlist_dialog > div {
float: left;
width: 510px;
padding: 5px;
}
#schedule_playlist_dialog ul {
list-style-type: none;
overflow: auto;
margin: 0;
padding: 10px 5px;
height: 275px;
}
#schedule_playlist_chosen li {
float: left;
clear: left;
margin: 0;
width: 95%;
}
#schedule_playlist_chosen li > h3 {
float: left;
padding: 0;
margin: 0;
width: 475px;
}
#schedule_playlist_chosen li > h3 > div {
float: left;
margin: 0 5px 2px 0;
}
#schedule_playlist_chosen li > h3 > div > span.ui-icon {
margin-top: 4px;
}
#schedule_playlist_chosen li div{
float: left;
}
#schedule_playlist_chosen li > div{
width: 475px;
}
#schedule_playlist_chosen li > div > div > span{
float: left;
}
#schedule_playlist_chosen li > div > div{
clear: left;
padding-top: 5px;
padding-left: 5px;
}
.sched_description {
clear: left;
font-size: 85%;
margin-left: 2em;
}
.sh_pl_name {
width: 150px;
}
.sh_pl_creator {
width: 125px;
}
.sh_pl_time {
width: 125px;
}
.sh_file_name {
display: inline-block;
width: 325px;
}
.sh_file_artist {
font-size: 90%;
padding-bottom: 5px;
}
#show_time_info > div, #show_time_info > span{
float: left;
}
#show_progressbar {
width: 150px;
height: 5px;
margin-top: 12px;
}
.time {
width: 150px;
margin: 5px;
text-align: center;
}
/* Add show Dialog----------------------------------------------------------------------------------------------------
*
*
*
*/
#add_show_name {
}
#add_show_description {
width: 400px;
height: 200px;
}
#fullcalendar_show_display {
width: 400px;
}

View File

@ -8,17 +8,13 @@ body {
margin: 0;
padding: 0;
}
html, body {
height: 100%;
body#login-page {
background: #1f1f1f url(images/login_page_bg.png) no-repeat center 0;
margin: 60px 0 0 0;
padding: 0;
}
#login-page {
background: #1f1f1f url(images/login_page_bg.png) no-repeat center 0;
margin: 0;
padding: 0;
height:100%;
text-align:center;
}
h2 {
color: #000000;
@ -372,7 +368,6 @@ dl.inline-list dd {
border-color: #5b5b5b;
border-style: solid;
border-width: 1px 1px 1px 1px;
width:100%;
}
.datatable tr td, .datatable tr th {
border-color: #b1b1b1;
@ -492,13 +487,12 @@ input[type="checkbox"] {
/*---//////////////////// LOGIN ////////////////////---*/
.login_box {
margin: 0 auto 0 auto;
margin:0 auto 0 auto;
text-align:center;
width:420px;
border:1px solid #181818;
border-width: 0 0 1px 0;
padding:0;
padding-top:60px;
}
.login_box h2 {
@ -637,17 +631,4 @@ dt.block-display, dd.block-display {
.button-bar {
height: 28px;
margin-top:12px;
}
/*.sticky {
padding:0;
width:100%;
z-index:2000;
position:fixed;
top:0;
left:0;
margin-bottom:140px;
}*/
.sticky {
padding:0;
width:100%;
}

View File

@ -60,7 +60,15 @@ function findHosts(request, callback) {
function setAddShowEvents() {
var start, end;
$("#schedule-add-show-tabs").tabs();
$(".tabs").tabs();
if(!$("#add_show_repeats").attr('checked')) {
$("#schedule-show-when > fieldset:last").hide();
}
$("#add_show_repeats").click(function(){
$("#schedule-show-when > fieldset:last").toggle();
});
start = $("#add_show_start_date");
end = $("#add_show_end_date");
@ -99,8 +107,8 @@ $(document).ready(function() {
$("#fullcalendar_show_display").fullCalendar({
header: {
left: 'prev, next, today',
center: '',
right: ''
center: 'title',
right: 'agendaDay, agendaWeek, month'
},
defaultView: 'agendaDay',
editable: false,