Rev 250 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.1 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>Select Slides - $action.getId()</title><script type="text/javascript" src="/content/jquery/jquery-1.4.2.js"></script><script type="text/javascript" src="/content/jquery/jqueryui/ui/jquery.ui.core.js"></script><script type="text/javascript" src="/content/jquery/jqueryui/ui/jquery.ui.widget.js"></script><script type="text/javascript" src="/content/jquery/jqueryui/ui/jquery.ui.position.js"></script><script type="text/javascript" src="/content/jquery/validation/jquery.validate.js"></script><style>* { font-family: Verdana; font-size: 96%; }label { width: 10em; float: left; }label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }p { clear: both; }.submit { margin-left: 12em; }em { font-weight: bold; padding-right: 1em; vertical-align: top; }a.selected {background-color:#1F75CC;color:white;z-index:100;}.pop {background-color:#FFFFFF;border:1px solid #999999;cursor:default;display:none;margin-top: 15px;position:absolute;text-align:left;width:394px;z-index:50;padding: 25px 25px 20px;}label {display: block;margin-bottom: 3px;padding-left: 15px;text-indent: -15px;}.pop p, .pop.div {border-bottom: 1px solid #EFEFEF;margin: 8px 0;padding-bottom: 8px;}</style>#set ($allslidesdata = $action.getAllSlidesData())#set ($mandatoryLabels = $action.getMandatorySlideLabels())<script>var required = [#foreach ($label in $mandatoryLabels)"$label"#if($velocityHasNext),#end#end];$(document).ready(function() {//alert("document ready");$('.cancelbutton').click(function(e) {//alert("Cancel clicked");window.location.href = '/content/entity';});$('#slidesform').submit(function(e) {allchecked = new Array();// Clear old error messages$('#error').html("");$(':checked').each(function(index) {//alert($(this).attr('title'));allchecked[index] = $(this).attr('title');});//alert('allchecked:' + allchecked);missingrequired = jQuery.grep(required, function(n, i) {//alert('n:' + n + ' index:' + jQuery.inArray(n, allchecked));return (jQuery.inArray(n, allchecked) == -1);});if(missingrequired && missingrequired.length > 0) {//alert('missingrequired:' + missingrequired);$('#error').append('<span style="color:red">Missing required slides: ' + missingrequired + '</span>');return false;}// FIXME - Is not the most efficient wayalldups = new Array();j = 0;for(i=0;i<allchecked.length;i++) {duplicates = jQuery.grep(allchecked, function(n, index) {return (n == allchecked[i]);});//alert("duplicates:" + duplicates);if(duplicates.length > 1 && (jQuery.inArray(duplicates[0], alldups) == -1)) {alldups[j] = duplicates[0];j++;}}if(alldups.length > 0) {//alert("alldups:" + alldups);$('#error').append('<span style="color:red">Duplicate slides: ' + alldups + '</span>');return false;}return true;});});</script></head><body><h1>Select Slides - $action.getId()</h1><form name="f" id="slidesform" action="/content/slides/$action.getId()" method="post">#showbuttons()<p id="error"/>#foreach ($slidesdata in $allslidesdata)#if($velocityCount == 1)#showslides ($slidesdata, 1)#else#showslides ($slidesdata, 0)#end#end<input type="hidden" name="_method" value="put"/>#showbuttons()</form></body></html>#macro (showslides $slidesdata $count)#set ($firstslidedata = $slidesdata.get(0))<p/><h3>$firstslidedata.get(1) ($firstslidedata.get(0))</h3>#foreach ($data in $slidesdata)<input type="checkbox" id="$data.get(2)" name="slides" #if($data.get(5) == "1") checked="checked" #end value="$data.get(2)" title="$data.get(3)"> $data.get(2) - $data.get(3) #if($count == 1)<span style="font-style:italic">($data.get(4))</span>#end<br/>#end#end#macro (showbuttons)<p/><input type="button" class="cancelbutton" name="cancel" value="Cancel"/><input type="submit" name="save" value="Save"/><input type="submit" name="next" value="Save & Next >>"/>#end