%PDF- %PDF-
Direktori : /mnt/tnb2/git/loslex/resources/views/contests/ |
Current File : //mnt/tnb2/git/loslex/resources/views/contests/maintain.blade.php |
<x-app-layout> @push('styles') <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <style>span.select2.select2-container.select2-container--classic { width: 100% !important; }</style> @endpush @push('scripts') <script type="module" src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script> <script type="module">$(document).ready(function() {$('#user_id').select2( {theme: "classic" });});</script> @endpush @push('footerelements') <x-modal name="add-shooter" :show="$errors->isNotEmpty()" focusable> <form method="POST" action="{{ route('registration.store') }}" class="p-6"> @csrf <h3 class="text-xl font-semibold">{{ __('Add shooter') }}</h3> <div class="mt-3"> <input type="hidden" name="contest_id" value="{{$contest->id}}" /> <x-input-label for="user_id" value="{{ __('Shooter') }}" /> <x-select name="user_id" id="user_id"> <option value="" selected disabled>{{ __('Select person') }}</option> @foreach ($users as $user)<option @selected(old('user_id') == $user->id) value="{{ $user->id }}">{{ $user->username }} - {{ $user->displayname }}</option>@endforeach </x-select> <x-input-error :messages="$errors->addOrgMember->get('user_id')" class="mt-2" /> </div> <div> <x-input-label for="squad" value="{{__('Squad')}}" /> <x-select name="squad" id="squad"> @for ($i = 0; $i <= $contest->squads; $i++) <option @selected(old('squad') == $i) value="{{$i}}">{{ $i == 0 ? 'R' : $i }}</option> @endfor </x-select> </div> <div> <x-input-label for="contest_division_id" value="{{__('Division')}}" /> <x-select id="contest_division_id" name="contest_division_id"> <option value="" selected disabled>{{ __('Select division') }}</option> @foreach ($contest->contest_category->divisions as $division) <option @selected(old('contest_division_id') == $division->id) value="{{ $division->id }}">{{ $division->division }}</option> @endforeach </x-select> </div> <div> <input type="checkbox" name="notcomp" id="notcomp" {{ !empty(old('notcomp') ? 'checked' : '') }} /> <x-input-label class="inline ml-2" for="notcomp" value="{{__('Not competing')}}" /> </div> <div><x-input-error class="mt-2" :messages="$errors->all()" /></div> <div class="mt-6 flex justify-end"> <x-secondary-button x-on:click="$dispatch('close')">{{ __('Cancel') }}</x-secondary-button> <x-primary-button class="ml-3">{{ __('Save') }}</x-button> </div> </form> </x-modal> @endpush <x-slot name="header"> <h2 class="font-semibold text-xl text-gray-800 leading-tight">{{ $contest->contestname }}</h2> </x-slot> <div class="m-auto flex flex-row gap-2 justify-center mb-4"> <x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'add-shooter')">{{ __('Add shooter') }}</x-primary-button> <a href="{{ route('contest.export', [$contest->id, 'pscsv']) }}"><x-primary-button title="{{ __('Exports present shooters into Practiscore CSV file') }}">{{ __('Export PS CSV') }}</x-primary-button></a> <a href="{{ route('contest.export', [$contest->id, 'excel']) }}"><x-primary-button title="{{ __('Exports present shooters into Excel file') }}">{{ __('Export Excel') }}</x-primary-button></a> <x-primary-button>{{ __('Import results') }}</x-primary-button> </div> <table class="m-auto"> <thead> <tr> <th>{{__('Name')}}</th> <th>{{__('Alias')}}</th> <th>{{__('Division')}}</th> <th>{{__('Squad')}}</th> <th>{{__('Member of LEX')}}</th> <th>{{__('Note')}}</th> <th></th> <th></th> <th></th> <th></th> </tr> </thead> <tbody> @foreach ($contest->registrations as $reg) <tr> <td>{{$reg->user->displayname}} {{$reg->notcomp ? __('(NC)') : ''}}</td> <td>{{$reg->user->username}}</td> <td>{{$reg->division->division}}</td> <td>{{$reg->squad == 0 ? 'R' : $reg->squad}}</td> <td> {{ __('contest.' . \App\Enums\ContestOptionsEnum::from($reg->lexmember)->name) }} <div class="text-sm">{{$reg->user->lex_hash}}</div> </td> <td>{{$reg->note}}</td> <td class="text-lg"><a href="{{ route('registration.switch', [$reg->id, 'present']) }}"><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="text-lg"><a href="{{ route('registration.switch', [$reg->id, 'paid']) }}"><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="text-lg"><a href="{{ route('registration.edit', [$reg->id]) }}"><button title="{{ __('Change registration') }}" class="fa-solid fa-square-pen text-blue-500"></button></a></td> <td class="text-lg"> <form action="{{ route('registration.destroy', $reg->id) }}" method="post"> @csrf @method('delete') <input type="hidden" name="canceltoken" value="{{$reg->canceltoken}}" /> <input type="hidden" name="maintain" /> <button title="{{ __('Delete registration') }}" class="fa-solid fa-square-xmark text-red-500"></button> </form> </td> </tr> @endforeach </tbody> </table> <div class="mt-6 border-t"> @include('contests.regoverview') </div> </x-app-layout>