@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; } $('
') .attr('data-processing', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-processing', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Adding Date...

Please wait, this may take a while to process...
'); var data = { 'ap_id' : ap_id, 'record_id' : record_id, 'add_date' : add_date }; // Add the date to the schedule var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/teams/' . $information['activity_program']->id . '/add-pitch-count-date') }}', data : data, dataType : 'html' }) .done(function (data) { //$('[data-processing]').remove(); //location.reload(); window.location.href = '{{ url('/teams/' . $information['activity_program']->id) }}#tabs-pitch-counts'; location.reload(); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert("There was an error adding this date.\n\n" + errorData.error.message + "\n\nPlease try again."); $('[data-processing]').remove(); $('input', dialog_object).focus(); }); } }, { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); } } ], open : function () { var dialog_object = $(this); var exclude_dates = $.parseJSON('{{ $information['exclude_pitch_count_dates'] }}'); var html = '
'; html += ''; html += 'Click the text box below to show a date picker. Select a date to add to your team\'s baseball pitch count schedule.'; html += '

'; html += 'Select Date:'; html += '
'; html += '
DD/MM/YYYY'; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); $('input', dialog_object).datepicker({ minDate : "{{ date('m/d/Y', strtotime($information['min_pitch_count_date'])) }}", maxDate : "{{ date('m/d/Y', strtotime($information['max_pitch_count_date'])) }}", beforeShowDay : function(date) { var m = date.getMonth(); var d = date.getDate(); var y = date.getFullYear(); var test_date = (m + 1) + '/' + d + '/' + y; if ($.inArray(test_date, exclude_dates) !== -1) { return [false, "", "This date has already been added to the schedule"]; } else { return [true]; } } }).focus(); }, close : function () { var dialog_object = $(this); $(dialog_object).remove(); } }); }); /* Remove date link */ $('.remove_pitch_count_date').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')); var schedule_index = parseInt(link.attr('data-schedule-index')); var date = link.attr('data-date'); var formatted_date = link.attr('data-formatted-date'); // Ensure the ID are actual numbers if (ap_id == NaN || record_id == NaN || schedule_index == NaN) { alert('There was a scripting error: unable to determine the activity program ID, pitch count record ID, or the schedule index.'); return; } // Highlight the row $('tr[data-schedule-index="' + schedule_index + '"]').addClass('hightlight'); // Show a dialog box to get confirmation $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, title : 'Remove ' + formatted_date + '?', height : 250, width : 400, buttons: [ { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); } }, { text : "Delete", 'class' : "float_left", icons : { primary : 'ui-icon-trash'}, click : function() { var dialog_object = $(this); $('
') .attr('data-processing', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-processing', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Removing Date...

Please wait, this may take a while to process...
'); var data = { 'ap_id' : ap_id, 'record_id' : record_id, 'schedule_index' : schedule_index, 'remove_date' : date }; // Add the date to the schedule var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/teams/' . $information['activity_program']->id . '/remove-pitch-count-date') }}', data : data, dataType : 'html' }) .done(function (data) { //$('[data-processing]').remove(); //location.reload(); window.location.href = '{{ url('/teams/' . $information['activity_program']->id) }}#tabs-pitch-counts'; location.reload(); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert("There was an error removing this date.\n\n" + errorData.error.message + "\n\nPlease try again."); $('[data-processing]').remove(); $('tr[data-schedule-index="' + schedule_index + '"]').removeClass('hightlight'); // Close the dialog box $(dialog_object).dialog("close"); $(dialog_object).remove(); }); } } ], open : function () { var dialog_object = $(this); var html = '
'; html += ''; html += 'Are you sure you want to delete ' + formatted_date + ' from your pitch count schedule?'; html += '

'; html += 'This cannot be undone. You will not be able to delete this date if you have a scheduled contest on this date.'; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { // Unhighlight the row $('tr[data-schedule-index="' + schedule_index + '"]').removeClass('hightlight'); var dialog_object = $(this); $(dialog_object).remove(); } }); }); /* Add a pitcher to a date link */ $('.add_pitcher_to_date').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')); var schedule_index = parseInt(link.attr('data-schedule-index')); var date = link.attr('data-date'); var formatted_date = link.attr('data-formatted-date'); // Ensure the ID are actual numbers if (ap_id == NaN || record_id == NaN || schedule_index == NaN) { alert('There was a scripting error: unable to determine the activity program ID, pitch count record ID, or the schedule index.'); return; } // Highlight the row $('tr[data-schedule-index="' + schedule_index + '"]').addClass('hightlight') // Show a dialog box to get the date to add $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, title : 'Record a New Pitch Count for ' + formatted_date, height : 300, width : 500, buttons: [ { text : "Add Pitch Count", '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 pitcher = $('input[name="pitcher"]', dialog_object).val(); var count = $('input[name="count"]', dialog_object).val(); // Ensure the pitcher name was provided if (pitcher == "") { alert('You must type in the name of the pitcher.'); $('input[name="pitcher"]', dialog_object).focus(); return; } // Ensure the count was provided if (count == "" || parseInt(count) == NaN || parseInt(count) == 0) { alert('You must type in the number of pitches for this pitcher.'); $('input[name="count"]', dialog_object).focus(); return; } // Was the exception check-box checked? if ($('input[name="is_batter_exception"]', dialog_object).is(':checked')) { var is_batter_exception = 1; } else { var is_batter_exception = 0; } $('
') .attr('data-processing', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-processing', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Adding Pitch Count...

Please wait, this may take a while to process...
'); var data = { 'ap_id' : ap_id, 'record_id' : record_id, 'schedule_index' : schedule_index, 'date' : date, 'pitcher' : pitcher, 'count' : count, 'is_batter_exception' : is_batter_exception }; // Add the date to the schedule var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/teams/' . $information['activity_program']->id . '/add-pitch-count') }}', data : data, dataType : 'html' }) .done(function (data) { //$('[data-processing]').remove(); //location.reload(); window.location.href = '{{ url('/teams/' . $information['activity_program']->id) }}#tabs-pitch-counts'; location.reload(); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert("There was an error adding this pitch count.\n\n" + errorData.error.message + "\n\nPlease try again."); $('[data-processing]').remove(); $('input[name="pitcher"]', dialog_object).focus(); }); } }, { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Unhighlight the row $('tr[data-schedule-index="' + schedule_index + '"]').removeClass('hightlight'); // Close the dialog box $(this).dialog("close"); $(this).remove(); } } ], open : function () { var dialog_object = $(this); var exclude_dates = $.parseJSON('{{ $information['exclude_pitch_count_dates'] }}'); var html = '
'; html += ''; html += 'Provide the name of the pitcher and the number of pitches below to add a new pitch count on ' + formatted_date + '.'; html += '

'; html += 'Pitcher:'; html += ''; html += '# of Pitches:'; html += ''; html += ''; html += '

'; html += '
'; html += '
'; html += 'A patcher is allowed to finish pitching to a batter if he reaches the daily maximum ({{ $information['pitch_count_limits']['daily_maximum'] }} pitches) during an at-bat. Check this box if the pitcher was over the daily limit because of this exception.'; html += '
'; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); /* Create a auto-fill text box for the name of the pitchers */ var pitchers = $.parseJSON('{{ str_replace('\'', '\\\'', $information['pitchers']) }}'); $('input[name="pitcher"]').autocomplete({ autoFocus : true, source : pitchers, select : function(event, ui) { $('input[name="count"]', dialog_object).focus(); } }).focus(); /* Limit input to numbers only */ $('input[name="count"]', dialog_object).bind('input', function() { // Remove non-numbers $(this).val($(this).val().replace(/[^0-9]/gi, '')); var value = $(this).val(); if (value <= {{ $information['pitch_count_limits']['daily_maximum'] }}) { $('[name="exception"]').fadeOut(); $('#under_limit', dialog_object).val(1); } else { $('[name="exception"]').fadeIn(); $('#under_limit', dialog_object).val(0); } }); }, close : function () { // Unhighlight the row $('tr[data-schedule-index="' + schedule_index + '"]').removeClass('hightlight'); var dialog_object = $(this); $(dialog_object).remove(); } }); }); /* Remove pitch count */ $('.remove_pitch_count').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')); var schedule_index = parseInt(link.attr('data-schedule-index')); var sub_index = parseInt(link.attr('data-sub-index')); var date = link.attr('data-date'); var formatted_date = link.attr('data-formatted-date'); var pitcher = link.attr('data-pitcher'); // Ensure the ID are actual numbers if (ap_id == NaN || record_id == NaN || schedule_index == NaN || sub_index == NaN) { alert('There was a scripting error: unable to determine the activity program ID, pitch count record ID, the schedule index, or the sub-index.'); return; } // Highlight the row $('tr[data-schedule-sub-index="' + sub_index + '"]', 'tr[data-schedule-index="' + schedule_index + '"]').addClass('hightlight'); // Show a dialog box to get confirmation $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, title : 'Remove ' + pitcher + '?', height : 250, width : 400, buttons: [ { text : "Cancel", 'class' : "float_right", icons : { primary : 'ui-icon-cancel'}, click : function() { // Close the dialog box $(this).dialog("close"); } }, { text : "Delete", 'class' : "float_left", icons : { primary : 'ui-icon-trash'}, click : function() { var dialog_object = $(this); $('
') .attr('data-processing', 1) .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .attr('data-processing', 1) .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front') .html('
Removing Pitch Count...

Please wait, this may take a while to process...
'); var data = { 'ap_id' : ap_id, 'record_id' : record_id, 'schedule_index' : schedule_index, 'sub_index' : sub_index, 'date' : date, 'pitcher' : pitcher }; // Remove the date from the schedule var jqxhr = $.ajax( { type : 'POST', url : '{{ url('/teams/' . $information['activity_program']->id . '/remove-pitch-count') }}', data : data, dataType : 'html' }) .done(function (data) { //$('[data-processing]').remove(); window.location.href = '{{ url('/teams/' . $information['activity_program']->id) }}#tabs-pitch-counts'; location.reload(); }) .fail(function (jqXHR, status, error) { var response = jqXHR.responseText; var errorData = $.parseJSON(response); //console.log(errorData); alert("There was an error removing this pitch count.\n\n" + errorData.error.message + "\n\nPlease try again."); $('[data-processing]').remove(); // Close the dialog box $(dialog_object).dialog("close"); }); } } ], open : function () { var dialog_object = $(this); var html = '
'; html += ''; html += 'Are you sure you want to delete the pitch count for ' + pitcher + ' on ' + formatted_date + '?'; html += '

'; html += 'This cannot be undone.'; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { // Unhighlight the row $('tr[data-schedule-sub-index="' + sub_index + '"]', 'tr[data-schedule-index="' + schedule_index + '"]').removeClass('hightlight'); var dialog_object = $(this); $(dialog_object).remove(); } }); }); @endif @if (!is_null($information['pitch_count'])) /* Pitch count info */ $('.pitch_count_info') .css({'text-decoration':'none'}) .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')); var schedule_index = parseInt(link.attr('data-schedule-index')); var sub_index = parseInt(link.attr('data-sub-index')); var date = link.attr('data-date'); var formatted_date = link.attr('data-formatted-date'); var formatted_date_2 = link.attr('data-formatted-date-2'); var pitcher = link.attr('data-pitcher'); var rest = link.attr('data-rest'); var return_date = link.attr('data-return-date'); var info = $.parseJSON(link.attr('data-info')) // Highlight the row $('tr[data-schedule-sub-index="' + sub_index + '"]', 'tr[data-schedule-index="' + schedule_index + '"]').addClass('hightlight'); // Show a dialog box $('
') .appendTo('body') .dialog( { modal : true, draggable : true, resizable : false, title : pitcher + ' on ' + formatted_date, height : 325, width : 400, buttons: [ { text : "Close", 'class' : "float_right", icons : { primary : 'ui-icon-close'}, click : function() { $(this).dialog("close"); } } ], open : function () { var dialog_object = $(this); var html = '
'; html += ''; html += 'Information for This Entry:

'; html += '
Pitcher Name:
' + info.pitcher + '
'; html += '
Game Date:
' + formatted_date_2 + '
'; html += '
# of Pitches:
' + info.count + '
'; html += '
Required Rest:
' + rest + '
'; html += '
Full Return On:
' + return_date + '

'; html += '
Entry Created:
' + info.updated_at + '
'; html += '
Entered By:
' + info.updated_by + '
'; html += '
'; dialog_object.html(html); $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt'); $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%'); }, close : function () { // Unhighlight the row $('tr[data-schedule-sub-index="' + sub_index + '"]', 'tr[data-schedule-index="' + schedule_index + '"]').removeClass('hightlight'); var dialog_object = $(this); $(dialog_object).remove(); } }); }); @endif {{-- Edit Social Media Handles --}} @if ($information['show_edit']) /* * Edit social media button */ $('a.edit_social_media_button').on('click', function(event) { event.preventDefault(); var activity_program_id = {{ $information['activity_program']->id }}; $('
') .appendTo('body') .dialog( { modal : true, draggable : false, resizable : false, height : 500, width : 650, title : 'Edit Social Media Links', 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() { $('
') .addClass('ui-widget-overlay ui-front') .appendTo('body'); $('
').appendTo('body') .css('width', '225px') .css('height', '170px') .css('text-align', 'center') .css('padding', '0.5em') .position({my : "center center", at : "center center", of : window}) .addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-di buttons') .html('
Saving...

Please wait, this may take a while to process...
'); 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('teams') }}/' + activity_program_id + '/edit/social-media', 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.\n\n" + errorData.error.message + "\n\nThis page will be reloaded."); location.reload(); }) .complete(function () { $('[data-autofocus="true"]').focus(); }); $('.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 @stop @section('page_functions') {{ $information['return_school_name'] }} @stop @section('main_content') {{-- Success Bar --}} @if (Session::has('success'))
{{ Session::get('success') }}
@endif {{-- Team Information --}} @include ('teams.team_information')
{{-- Teams by Level Tabs --}}
@foreach ($information['teams'] as $team)
@if ($information['show_edit']) Edit Team Social Media @endif @if (count($information['social_media']) > 0) @endif {{-- Team Info by Section Tabs --}}
@if (Auth::check() and Auth::user()->isOsaaUser()) @if(Input::has('show-delete')) Hide Deleted @else Show Deleted @endif @endif
    @if (Helpers::strEqual ($information['activity_program']->activity_type, array('TS', 'IS')))
  • Schedule
  • @endif @if ($team->level == 'V' and Helpers::strEqual ($information['activity_program']->activity_type, 'TS'))
  • Ranking
  • @endif
  • Roster
  • Team Photo
@if (Helpers::strEqual ($information['activity_program']->activity_type, array('TS', 'IS')))
@if (Helpers::strEqual ($information['activity_program']->activity_type, 'ts')) @include ('teams.contest_schedule') @elseif (Helpers::strEqual ($information['activity_program']->activity_type, 'IS')) @include ('teams.meet_schedule') @endif
@endif @if ($team->level == 'V' and Helpers::strEqual ($information['activity_program']->activity_type, 'TS'))
@if (!is_null($team->ranking))
OSAA {{ $information['activity_program']->division }} Rank
#{{ $team->ranking->rank }}
Overall Record
{{ Helpers::displayRecord($team->record['OAR']) }}
League Record
{{ Helpers::displayRecord($team->record['LR']) }}
{{--
Playoff Record
{{ Helpers::displayRecord($team->record['POR']) }}
--}}
{{ $team->ranking->calc_label }}
{{ $team->ranking->calc_date }}
RPI Rank
#{{ $team->ranking->rpi_rank }}
RPI Record
{{ Helpers::displayRecord($team->record['RCR']) }}
RPI Rating
{{ number_format($team->ranking->rpi * 1000, 3, '.', '') }}
WWP
{{ number_format($team->ranking->wwp, 3, '.', '') }}
OWP
{{ number_format($team->ranking->owp, 3, '.', '') }}
Colley Rank
#{{ $team->ranking->colley_rank }}
Colley Record
{{ Helpers::displayRecord($team->record['CRR']) }}
Colley Rating
{{ number_format($team->ranking->colley * 1000, 3, '.', '') }}
Rankable Completed Contests
@if (Auth::check() and Auth::user()->isOsaaUser()) @endif @if (count($team->ctss) > 0) @foreach ($team->ctss as $contest_id => $cts)
Fatal error: Cannot break/continue 1 level in /home/osaa/web_app/dev/app/views/teams/view.blade.php on line 1561
Opponent Result Counted Weight OAWP OAR ColleyCTS