Files
grocy/views/components/locationpicker.blade.php

40 lines
1.2 KiB
PHP
Raw Normal View History

@php require_frontend_packages(['bootstrap-combobox']); @endphp
@once
@push('componentScripts')
2020-08-31 20:32:50 +02:00
<script src="{{ $U('/viewjs/components/locationpicker.js', true) }}?v={{ $version }}"></script>
@endpush
@endonce
@php if(empty($prefillByName)) { $prefillByName = ''; } @endphp
@php if(empty($prefillById)) { $prefillById = ''; } @endphp
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
@php if(empty($hint)) { $hint = ''; } @endphp
@php if(empty($nextInputSelector)) { $nextInputSelector = ''; } @endphp
2020-08-31 20:32:50 +02:00
<div class="form-group"
data-next-input-selector="{{ $nextInputSelector }}"
2020-08-31 20:32:50 +02:00
data-prefill-by-name="{{ $prefillByName }}"
data-prefill-by-id="{{ $prefillById }}">
2020-11-09 21:30:22 +01:00
<label for="location_id">{{ $__t('Location') }}
@if(!empty($hint))
2022-04-04 20:10:29 +02:00
<i class="fa-solid fa-question-circle text-muted"
2020-11-09 21:30:22 +01:00
data-toggle="tooltip"
data-trigger="hover click"
2020-11-09 21:30:22 +01:00
title="{{ $hint }}"></i>
@endif
</label>
2020-08-31 20:32:50 +02:00
<select class="form-control location-combobox"
id="location_id"
name="location_id"
@if($isRequired)
required
@endif>
<option value=""></option>
@foreach($locations as $location)
2020-08-31 20:32:50 +02:00
<option value="{{ $location->id }}">{{ $location->name }}</option>
@endforeach
</select>
<div class="invalid-feedback">{{ $__t('You have to select a location') }}</div>
</div>