@section('page_title') OSAA - Teams @stop @section('page_sub_title') {{ $information['activity_program']->display_name }} @stop @section('scripts') @parent @stop @section('jquery_init') if(!window.console) { window.console = { log: $.noop, group: $.noop, groupEnd: $.noop }; } // 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); }) }); $('.tooltip').tooltip(); $('.page_functions').css({'width':'auto'}); $('.tabs').tabs(); $('.button').button(); $('.button.print').button({ icons : { primary : 'ui-icon-print'}}); // Download drop-down menu $('#grabber_list') .menu() .css({'display' : 'none', 'z-index' : '200', 'position' : 'absolute', 'right' : '0', 'top' : '23px', 'margin' : '0', 'padding' : '0'}); $('#grabber_list li ul') .css({'margin' : '0', 'padding' : '0', 'width' : '160px'}); $('#grabber_list img') .css({'position' : 'relative', 'top' : '2px', 'margin-right' : '6px'}); $('.grabber_button') .button({ icons : { secondary : 'ui-icon-triangle-1-s'}}) .css({'float':'right', 'font-size':'8pt'}) .click(function (event) { if ($('#grabber_list').is(':visible')) { $('#grabber_list').slideUp(400); $(this).button({icons : { secondary : 'ui-icon-triangle-1-s'}}); } else { $('#grabber_list').slideDown(400); $(this).button({icons : { secondary : 'ui-icon-triangle-1-n'}}); } }); /* * Click officials association link */ $('a[data-officials-association]').click(function(event) { event.preventDefault(); var link = $(this); var id = link.attr('data-officials-association'); $('
') .appendTo('body') .dialog( { draggable : true, resizable : false, height : 300, width : 600, modal : false, title : '{{ str_replace('\'', '\\\'', $information['activity_program']->name) }} Contest Officials', open : function () { var dialog_object = $(this); dialog_object.html(""); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('officials/associations') }}/' + id + '/ajax-view', 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 the information.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { }); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); @if (!is_null($information['rankings_info'])) // Contest progress bar $('#contest_progress_bar').progressbar({value : {{ $information['rankings_info']->contest_completed }}, max : {{ $information['rankings_info']->contest_count }}}); @endif $('.edit_team_button').button ({ icons : { primary : 'ui-icon-pencil'}}); $('.edit_social_media_button').button ({ icons : { primary : 'ui-icon-image'}}); $('.return_button').button({ icons : { primary : 'ui-icon-arrowthick-1-w'}}); // New schedule formatting function colorRows () { $('table').each(function () { if ($(this).is('[data-color-rows="false"]')) { return; } var i = 0; $('tbody tr', $(this)).each(function () { if (i % 2 == 1) { $(this).addClass('odd'); } else { $(this).removeClass('odd'); } i = i + 1; }); }); } colorRows(); $('[data-status="CXL"]').css({'background-color' : '#cacaca', 'color' : '#ffffff !important;'}); $('[data-status="CXL"] a').css({'background-color' : '#cacaca', 'color' : '#ffffff !important;'}); $('[data-status="CXL"] .gray').css({'background-color' : '#cacaca', 'color' : '#ffffff !important;'}); $('[data-status="PPD"]').css({'background-color' : '#b5a5fb', 'color' : '#ffffff !important;'}); $('[data-status="PPD"] a').css({'background-color' : '#b5a5fb', 'color' : '#ffffff !important;'}); $('[data-status="PPD"] .gray').css({'background-color' : '#b5a5fb', 'color' : '#ffffff !important;'}); $('[data-status="LIVE"]').css({'background-color' : '#effff1', 'color' : '#222222 !important;'}); $('[data-status="LIVE"] a').css({'background-color' : '#effff1', 'color' : '#222222 !important;'}); $('[data-status="LIVE"] .gray').css({'background-color' : '#effff1', 'color' : '#222222 !important;'}); $('[data-status="PND"]').css({'background-color' : '#fff7da', 'color' : '#222222 !important;'}); $('[data-status="PND"] a').css({'background-color' : '#fff7da', 'color' : '#222222 !important;'}); $('[data-status="PND"] .gray').css({'background-color' : '#fff7da', 'color' : '#222222 !important;'}); $('[data-status="DEL"]').css({'background-color' : '#ad2c2c', 'color' : '#ffffff !important;'}); $('[data-status="DEL"] a').css({'background-color' : '#ad2c2c', 'color' : '#ffffff !important;'}); $('[data-status="DEL"] .gray').css({'background-color' : '#ad2c2c', 'color' : '#ffffff !important;'}); $('.contest_viewer').dialog({ autoOpen : false, buttons : [ { text : 'Done', 'class' : 'float_right', click : function () { $(this).dialog('close'); }} @if (Auth::check()) , { text : 'Edit Contest', 'class' : 'float_left', 'style' : 'margin-left:5px;', icons : { primary : 'ui-icon-pencil' }, click : function () { window.location = ('/contests/' + $(this).attr('data-contest') + '/edit?ap={{ $information['activity_program']->id }}'); }}, { text : 'Submit Scores', 'class' : 'float_left', 'style' : 'margin-left:10px;', icons : { primary : 'ui-icon-circle-arrow-e' }, click : function () { window.location = ('/contests/' + $(this).attr('data-contest') + '/submit-scores'); }} @endif ], draggable : false, height: 'auto', modal : true, open : function () { var contest = $(this).attr('data-contest'); $('.contest_viewer').html(""); var jqxhr = $.ajax({ type : 'GET', url : '/contests/' + contest + '?mode=ajax', dataType : 'html' }) .done(function (data) { $('.contest_viewer').html(data); $('.button').button(); }) .fail(function () { $('.contest_viewer').html('There was an error.'); }); $('.ui-dialog-buttonpane').css('padding', '0').css('font-size', '8pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, resizable : false, show : { effect : 'highlight', delay : 0, duration : 400, easing : 'easeInOutSine' }, title : 'OSAA {{ Helpers::getActivityName($information['activity_program']->activity) }}', width : 900 }); $('.contest_details').click(function () { $('.contest_viewer').attr('data-contest', $(this).attr('data-contest')).dialog('open'); }) .hover(function() { $(this).css({'cursor':'pointer'}); }, function() { $(this).css({'cursor':'auto'}); }); @if (Auth::check() and Auth::user()->isOsaaUser() and Helpers::isGibby()) $('a[data-cts-id]').click(function(event) { event.preventDefault(); var link = $(this); var cts_id = link.attr('data-cts-id'); $('') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, title : 'Edit Contest Team Score (CTS) Record', height : 600, width : 800, buttons: [ { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); $(this).remove(); } }, { text : "Save", 'class' : "float_left", icons : { primary : 'ui-icon-disk'}, click : function() { var dialog_object = $(this); var form = $('form', dialog_object); $(form).submit(); } } ], open : function () { var dialog_object = $(this); dialog_object.html(""); var jqxhr = $.ajax( { type : 'GET', url : '{{ url('/contest-teams-scores') }}/' + cts_id, 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 loading the required data.\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { }); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); @endif {{-- Pitch Count Editing Logic --}} @if ($information['can_edit_pitch_count']) /* Color pitch count table rows specially */ $('table.pitch_count_table > tbody > tr.pitch_count_table_schedule_row:not(:last) > td').css({'border-bottom' : '1px solid #cccccc'}); $('table.counts').each(function() { var table = $(this); $('tr:odd td', table).css({'background-color' : '#f2f2f2'}); }); /* Add a date link */ $('.add_pitch_count_schedule').click(function(event) { event.preventDefault(); var link = $(this); var ap_id = parseInt(link.attr('data-ap-id')); var record_id = parseInt(link.attr('data-record-id')); // Ensure the ID are actual numbers if (ap_id == NaN || record_id == NaN) { alert('There was a scripting error: unable to determine the activity program ID or pitch count record ID.'); return; } // Show a dialog box to get the date to add $('') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, title : 'Add a Date to the Pitch Count Schedule', height : 250, width : 400, buttons: [ { text : "Add Date", 'class' : "float_left", icons : { primary : 'ui-icon-plusthick'}, click : function() { // Get the date to add from the input in this dialog var dialog_object = $(this); var add_date = $('input', dialog_object).val(); // Ensure the date was provided if (add_date == "") { alert('You must select a date in order to add it to your pitch count schedule.'); $('input', dialog_object).focus(); return; } $('| Opponent | Result | Counted | Weight | OAWP | OAR | Colley | @if (Auth::check() and Auth::user()->isOsaaUser())CTS | @endif
|---|