%PDF- %PDF-
Direktori : /www/loslex/production/resources/views/contests/ |
Current File : /www/loslex/production/resources/views/contests/maintain.blade.php |
<x-app-layout> @push('footerelements') <x-modal name="add-shooter" :show="$errors->isNotEmpty()" focusable> @include('contests.partials.add-shooter') </x-modal> <x-modal name="export-modal" :show="request()->has('export')" focusable> @include('contests.partials.export-import') </x-modal> {{-- @livewire('wire-elements-modal') --}} @endpush <x-slot:contentwidth>max-w-8xl</x-slot> <x-slot name="pagetitle">{{ __('Contest maintenance') . " - " . $contest->contestname }}</x-slot> <x-slot name="header"><h2 class="text-gray-800 dark:text-gray-200 leading-tight">{{ $contest->contestname }}</h2></x-slot> <div class="m-auto flex flex-row gap-2 justify-center mb-4"> <a href="{{ route('contest.show', [$contest->id]) }}"><x-primary-button>{{ __('Back') }}</x-primary-button></a> <x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'add-shooter')">{{ __('Add shooter') }}</x-primary-button> <x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'export-modal')">{{ __('Export / Import') }}</x-primary-button> </div> @if ($contest->rangemaster_id == 0) <div class="mx-auto w-fit mb-2 p-2 italic font-semibold text-red-500 border border-red-500 rounded-md">{{ __('No rangemaster has been appointed for this contest yet!') }}</div> @endif <form action="{{ route('contest.changesquad', $contest->id) }}" method="post"> @csrf <table class="m-auto border-separate border border-gray-200 dark:border-gray-600" id="shooters"> <thead> <tr class="text-sm"> <th></th> <th class="bg-white dark:bg-gray-800 sticky left-0">{{__('Name')}}</th> <th>{{__('Alias')}}</th> {{-- <th></th> --}} <th>{{__('Division')}}</th> <th>{{__('Sq.')}}</th> <th>{{__('Licence number')}}</th> <th>{{__('Member of LEX')}}</th> <th>{{__('Note')}}</th> <th>{{__('Registration time')}}</th> <th title="{{__('Beginner')}}">{{__('Bgnr.')}}</th> <th title="{{__('DQs within last 12 months')}}">{{ __('DQs')}}</th> <th title="{{__('Builder')}}">{{__('Bldr.')}}</th> <th></th> <th></th> <th></th> <th></th> </tr> </thead> <tbody> @foreach ($contest->registrations->sortBy(['squad', 'user.lastname']) as $reg) <tr class="odd:bg-gray-100 dark:odd:bg-gray-700 even:bg-white dark:even:bg-gray-800 text-sm"> <td class="px-2"><x-text-input type="checkbox" name="selection[]" value="{{ $reg->id }}"/></td> <td class="px-2 sticky left-0 bg-inherit whitespace-nowrap" ;-search="{{ iconv("utf-8", "ascii//TRANSLIT", $reg->user->listedname) }}|{{$reg->user->listedname}}">{{$reg->user->listedname}} {{$reg->notcomp ? __('(NC)') : ''}}</td> <td class="px-2 text-center text-xs">{{$reg->user->username}}</td> {{-- <td class="px-2 text-center text-xs"><span x-data="" class="fa-solid fa-address-card cursor-pointer" x-on:click="console.log('user {{$reg->user->id}}'); $dispatch('openModal', { component: 'user-modal', arguments: { user: {{ $reg->user->id }}, mode: 'show' }})"></span></td> --}} <td class="px-2 text-xs text-center">{{$reg->division?->division}}</td> <td class="px-2 text-xs text-center" data-search="*{{$reg->squad == 0 ? 'R' : $reg->squad}}*">{{$reg->squad == 0 ? 'R' : $reg->squad}}</td> <td class="px-2 text-xs text-center">{{$reg->licence_number}}</td> <td class="px-2 text-center whitespace-nowrap" data-search="{{ $reg->lexmember ? "LEX" : "" }}" data-order="{{ $reg->lexmember }}"> @php $validMemberStatus = $reg->user->is_valid_member($contest->date); @endphp @if ($reg->lexmember && $validMemberStatus) {{ __('contest.' . \App\Enums\ContestOptionsEnum::YES->name) }} @else {{ __('contest.' . \App\Enums\ContestOptionsEnum::NO->name) }} @endif @if ($reg->lexmember) @if (!is_null($reg->user->lex_hash))<a class="inline" target="lexmembership" href="https://k.gunlex.cz/{{$reg->user->lex_hash}}">@endif <div class="@switch($validMemberStatus) @case(-2) fa-solid fa-circle-question text-blue-500 @break @case(-1) fa-solid fa-triangle-exclamation text-amber-500 @break @case(0) fa-solid fa-circle-xmark text-red-500 @break @case(1) fa-solid fa-circle-check text-green-500 @break @endswitch" title="{{$reg->user->lex_hash ?? __('Membership control code not provided')}}"></div> @if (!is_null($reg->user->lex_hash))</a>@endif @endif </td> <td class="px-2">{{$reg->note}}</td> <td class="px-2 text-xs break-normal min-w-min text-center whitespace-nowrap" data-order="{{ $reg->created_at->unix() }}"> <div class="whitespace-pre">{{$reg->created_at->toDateString()}}</div> <div class="whitespace-pre">{{$reg->created_at->toTimeString()}}</div> </td> <td class="px-2 text-center text-lg" data-order="{{ $reg->rookie }}">@if ($reg->rookie) <div title="{{__('Beginner')}}" class="fa-solid fa-person-circle-question text-yellow-500"></div>@endif</td> <td class="px-2 text-center @switch($reg->user->dqs($contest->date)) @case(0) text-xs text-grey-900 dark:text-gray-100 @break @case(1) font-bold text-amber-500 @break @default font-bold text-red-500 @break @endswitch)">{{ $reg->user->dqs($contest->date) }}</td> <td class="px-2 text-center text-lg" data-order="{{ $reg->builder }}">@if ($reg->builder) <div title="{{__('Builder')}}" class="fa-solid fa-screwdriver-wrench"></div>@endif</td> <td class="px-2 text-lg" data-order="{{ $reg->present }}"><a href="{{ route('registration.switch', [$reg->id, 'present']) }}"><button type="button" title="{{ $reg->present ? __('Present') : __('Not present') }}" class="fa-solid {{ $reg->present ? 'fa-person-circle-check text-green-500' : 'fa-person-circle-xmark text-red-500'}}"></button></a></td> <td class="px-2 text-lg" data-order="{{ $reg->paid }}"><a href="{{ route('registration.switch', [$reg->id, 'paid']) }}"><button type="button" title="{{ $reg->paid ? __('Paid') : __('Not paid') }}" class="fa-solid fa-money-bill-wave {{ $reg->paid ? 'text-green-500' : 'text-yellow-500'}}"></button></a></td> <td class="px-2 text-lg"><a href="{{ route('registration.edit', [$reg->id]) }}?maintain"><button type="button" title="{{ __('Change registration') }}" class="fa-solid fa-square-pen text-blue-500"></button></a></td> <td class="px-2 text-lg"><a href="{{ route('registration.destroy', [$reg->id, $reg->canceltoken]) }}?maintain"><button type="button" title="{{ __('Delete registration') }}" class="fa-solid fa-square-xmark text-red-500"></button></a></td> </tr> @endforeach </tbody> </table> <div class="mt-4 text-sm text-center"> {{ __('Move selected contestants to squad') }} <x-select class="!w-fit inline-block" name="squad" id="squadno"> <option value="0">R</option> @for ($i = 1; $i <= $contest->squads; $i++) <option value="{{ $i }}">{{ $i }}</option> @endfor </x-select> <x-primary-button>{{ __('Move') }}</x-primary-button> </div> </form> <div class="mt-6 border-t"> @include('contests.regoverview') </div> </x-app-layout>