@section('page_title') OSAA - Coop Application @stop @section('page_sub_title') Create a New Coop Application Form @stop @section('scripts') @parent @stop @section('jquery_init') // Success bar $('.success_bar').animate({ 'top' : 32, 'background-color' : 'rgba(176, 255, 190, 1.0)'}, 1600, 'easeOutQuad', function () { $(this).delay(6000).fadeOut(4000); $(this).hover(function () { $(this).stop(true).css('opacity', '1.0'); }, function () { $(this).fadeOut(4000); }) }); // Shake action items function shakeActionImages (object) { $(object).effect("shake", {distance : 5, times : 1}, 600, function () { $(this).delay(Math.floor(Math.random() * 4000) + 2000); shakeActionImages($(this)); }); } // Info text $('.info_text') .each(function () { var item = $(this); item.prepend(''); // Info icons $('.info_icon') .addClass('ui-icon ui-icon-info') .css({'position' : 'absolute'}); }) .css({'font-size' : '9pt', 'line-height' : '1.25em', 'text-indent' : '20px'}); /* * Cancel button */ $('.cancel_button') .button({'icons':{'primary':' ui-icon-circle-close'}}) .css({'font-size':'9pt'}) .click(function(event) { return confirm('Are you sure you want to cancel the creation of a new coop application form?'); }); /* * Submit button */ $('.submit_button') .button(); /* * Help button */ $('.help_button') .button({'icons':{'primary':'ui-icon-help'}}) .css({'font-size':'9pt', 'margin-right':'10px'}) .click(function(event) { var object = $(this); event.preventDefault(); var topic = object.attr('data-topic'); $('
') .appendTo('body') .dialog( { draggable : true, resizable : true, height : 725, minHeight : 400, width : 650, minWidth : 450, modal : true, title : 'Help', open : function () { var dialog_object = $(this); dialog_object.html("
"); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('forms/coop-application/0/help') }}?topic=' + topic, dataType : 'html' }) .done(function (returned_data) { dialog_object.html(returned_data); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert ("There was an error looking up help information.\n\nThis page will be reloaded."); //location.reload(); }) .complete(function () { }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); /* * Form behavior */ // Select activity $('#activity').on('change', function() { var select = $(this); var option = $('[data-default]', select); option.remove(); var action_item = getActionImage(select); action_item.remove(); checkReadiness(); }); // Select starting school year $('#starting_school_year').on('change', function() { var select = $(this); var option = $('[data-default]', select); option.remove(); var action_item = getActionImage(select); action_item.remove(); var task = select.parents('div[data-task]'); var add_info = $('[name="additional_information"]', task); add_info.html(' '); var selected = $('option:selected', select); var starting_year = parseInt(selected.text()); if (starting_year == {{ $info['current_school_year'] }}) { add_info.html('The coop will be for this current school year.'); } if (starting_year == {{ $info['current_school_year'] }} + 1) { add_info.html('The coop will begin in the next school year.'); } checkReadiness(); }); // Select coop duration $('input[type="radio"][name="coop_duration"]').on('change', function() { var input = $(this); var action_item = getActionImage(input); action_item.remove(); checkReadiness(); }); // Select host school $('#host_school').on('change', function() { var select = $(this); var option = $('[data-default]', select); option.remove(); var action_item = getActionImage(select); action_item.remove(); var task = select.parents('div[data-task]'); var add_info = $('[name="additional_information"]', task); var host_school_name = $('option:selected', select).html(); add_info.html(' '); add_info.html(host_school_name + ' will the first school listed.'); // What if the host school is not my school? if (parseInt($('option:selected', select).val()) != {{ $info['school']->id }}) { $('option[value="{{ $info['school']->id }}"]', $('#school_2')).attr('selected', 'selected').click(); checkSchool2($('#school_2')); $('#school_2').attr('disabled', 'disabled'); } else { $('#school_2').removeAttr('disabled'); } checkReadiness(); }); // Select school 2 $('#school_2').on('change', function() { checkSchool2($(this)); }); function checkSchool2 (element) { var select = element; var task = select.parents('div[data-task]'); var add_info = $('[name="additional_information"]', task); if (!$('option:selected', select).is('[data-default]')) { var option = $('[data-default]', select); option.remove(); var action_item = getActionImage(select); action_item.remove(); var school_2_name = $('option:selected', select).html(); add_info.html(' '); add_info.html(school_2_name + ' will the second school listed.'); } else { add_info.html('Select a second school.'); var img = $(''); select.before(img); shakeActionImages(img); } checkReadiness(); } /* * Add Third School Button */ $('a[data-action="add_third_school"]') .button() .css({'margin-left' : '0px', 'font-size' : '8pt'}) .on('click', function(event) { event.preventDefault(); var button = $(this); var task = $('[data-task="select-third-school"]'); var show_task = (task.is(':visible')); if (show_task) { // Remove 3rd school task button.button({'label' : 'Add a Third School'}); task.fadeOut(400); } else { // Show 3rd school task button.button({'label' : 'Remove the Third School'}); task.fadeIn(400); } checkReadiness(); }); // Select school 3 $('#school_3').on('change', function() { var select = $(this); var option = $('[data-default]', select); option.remove(); var action_item = getActionImage(select); action_item.remove(); checkReadiness(); }); // Get task's action image function getActionImage(element) { var task = element.parents('div[data-task]'); var image = $('img[class="action_item"]', task); return image; } // Shake action items $('img[class="action_item"]').each(function(index) { shakeActionImages($(this)); }); // Remove third school option $('[data-task="select-third-school"]').hide(); // Check if ready to move onwards function checkReadiness() { var action_items = $('img[class="action_item"]:visible'); if (action_items.size() == 0) { $('#ready_action_image').show(); shakeActionImages($('#ready_action_image')); $('#ready .submit_button').button('enable'); $('#ready_text').html(' Ready for step 2.'); } else { // Hide the ready/next button $('#ready_action_image').hide(); $('#ready .submit_button').button('disable'); $('#ready_text').html(' You need to fill in more information to continue.'); } // Check starting school year and duration options var selected_starting_year_option = $('option:selected', $('#starting_school_year')); var task_group = $('div[data-task="select-coop-duration"]'); if (selected_starting_year_option.is('[data-default]')) { $('input[type="radio"]', task_group).attr('disabled', 'disabled'); $('label', task_group).addClass('gray'); } else { $('input[type="radio"]', task_group).removeAttr('disabled'); $('label', task_group).removeClass('gray'); // Limit durations to within the selected school year block var starting_year = parseInt(selected_starting_year_option.val()); var year_block = selected_starting_year_option.parents('optgroup'); var max_year = parseInt(year_block.attr('data-max-year')); var max_duration = max_year - starting_year; $('input[type="radio"]', task_group).each(function(index) { var item = $(this); var duration = item.attr('data-length'); if (duration > max_duration) { if (item.is(':checked')) { $('input[type="radio"][data-length="' + max_duration + '"]', task_group).click(); } item.attr('disabled', 'disabled'); $('label[for="' + item.attr('id') + '"]', task_group).addClass('gray'); } }); } // Check host school and other school options var selected_host_school_option = $('option:selected', $('#host_school')); var task_group = $('div[data-task="select-host-school"]'); if (selected_host_school_option.is('[data-default]')) { // No host school is selected, must be done first $('#school_2').attr('disabled', 'disabled'); $('a[data-action="add_third_school"]').button("disable"); } else { // Host school is selected, enable school 2 $('a[data-action="add_third_school"]').button("enable"); var host_school_id = selected_host_school_option.val(); // Remove that option from the list of other schools $('option', $('#school_2')).removeAttr('disabled'); if ($('option[value="' + host_school_id + '"]', $('#school_2')).is(':selected')) { $('option[value="' + host_school_id + '"]', $('#school_2')).removeAttr('selected'); $('#school_2').prepend($('')); checkSchool2($('#school_2')); } $('option[value="' + host_school_id + '"]', $('#school_2')).attr('disabled', 'disabled'); $('#school_2').removeAttr('disabled'); } } checkReadiness(); @stop @section('page_functions') Help Cancel @stop @section('main_content') {{-- Success Bar --}} @if (Session::has('success'))
{{ Session::get('success') }}
@endif {{-- Errors --}} @if (Session::has('errors'))
@foreach ($errors->all() as $error) {{ $error }} @endforeach
@endif

Step 1: Preliminary Information

{{-- Future Eligibility Notice --}} @if ($info['limit_future'])
Coop Application Unavailable
The online Coop Application form is currently not available. Coop applications are not being accepted until the next school year block is setup with classification and league alignments.
@endif
{{-- Activity --}}

Which activity will be covered by the cooperative sponsorship?

Activity