fixes to template, javascript to handle error arrays.

This commit is contained in:
Naomi 2011-04-15 10:51:06 -04:00
parent 0982405d4c
commit eb312ae454
3 changed files with 28 additions and 28 deletions

View file

@ -18,21 +18,21 @@
<span class="ui-button-text">Remove</span> <span class="ui-button-text">Remove</span>
</a> </a>
<?php endif; ?> <?php endif; ?>
</li> <?php if(($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->hasErrors())
<?php if(($this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->hasErrors())
|| ($this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->hasErrors())) : ?> || ($this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->hasErrors())) : ?>
<ul class='errors'> <ul class='errors'>
<?php $errors = array_merge( <?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getMessages(), $this->element->getElement('add_show_rebroadcast_date_absolute_'.$i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->getMessages() $this->element->getElement('add_show_rebroadcast_time_absolute_'.$i)->getMessages()
); );
?> ?>
<?php foreach($errors as $error): ?> <?php foreach($errors as $error): ?>
<li><?php echo $error; ?></li> <li><?php echo $error; ?></li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</li>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
<a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day"> <a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day">

View file

@ -18,22 +18,22 @@
<span class="ui-button-text">Remove</span> <span class="ui-button-text">Remove</span>
</a> </a>
<?php endif; ?> <?php endif; ?>
<?php if(($this->element->getElement('add_show_rebroadcast_date_'.$i)->hasErrors())
|| ($this->element->getElement('add_show_rebroadcast_time_'.$i)->hasErrors())) : ?>
<ul class='errors'>
<?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_date_'.$i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_time_'.$i)->getMessages()
);
?>
<?php foreach($errors as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</li> </li>
<?php if(($this->element->getElement('add_show_rebroadcast_date_'.$i)->hasErrors())
|| ($this->element->getElement('add_show_rebroadcast_time_'.$i)->hasErrors())) : ?>
<ul class='errors'>
<?php $errors = array_merge(
$this->element->getElement('add_show_rebroadcast_date_'.$i)->getMessages(),
$this->element->getElement('add_show_rebroadcast_time_'.$i)->getMessages()
);
?>
<?php foreach($errors as $error): ?>
<li><?php echo $error; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endfor; ?> <?php endfor; ?>
</ul> </ul>
<a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day"> <a class="ui-button ui-button-icon-only ui-widget ui-state-default add_absolute_rebroadcast_day">

View file

@ -160,7 +160,7 @@ function setAddShowEvents() {
}); });
form.find(".add_absolute_rebroadcast_day").click(function(){ form.find(".add_absolute_rebroadcast_day").click(function(){
var li = $(this).prev().find("li:visible:last").next(); var li = $(this).parent().find("ul.formrow-repeat > li:visible:last").next();
li.show(); li.show();
li = li.next(); li = li.next();