54 lines
2.9 KiB
PHP
54 lines
2.9 KiB
PHP
<div class="row">
|
|
<div class="col-12">
|
|
<form id="searchForm" action="{{ request()->url() }}">
|
|
<div class="input-group">
|
|
<label class="input-group-text" for="searchField">{{ $searchFields }}</label>
|
|
{{-- CONTACTS FILTER --}}
|
|
@if (request()->user)
|
|
<input class="d-none" name="user" type="text" value="{{ request()->user }}">
|
|
@endif
|
|
@if (request()->sort_col)
|
|
<input class="d-none" name="sort_col" type="text" value="{{ request()->sort_col }}">
|
|
@endif
|
|
@if (request()->sort_way)
|
|
<input class="d-none" name="sort_way" type="text" value="{{ request()->sort_way }}">
|
|
@endif
|
|
@if (request()->rangefilter)
|
|
<input class="d-none" name="rangefilter" type="text" value="{{ request()->rangefilter }}">
|
|
@endif
|
|
@if (request()->group)
|
|
<input class="d-none" name="group" type="text" value="{{ request()->group }}">
|
|
@endif
|
|
<input class="form-control" id="searchField" name="search" type="search" value="{{ request()->search }}"
|
|
placeholder="{{ __('Vos mots clés ici..') }}" />
|
|
@if (request()->routeIs('bo.documents.*'))
|
|
<select class="form-select" id="searchTag" name="tag">
|
|
<option value="0">{{ __('Rechercher par tags') }}</option>
|
|
@foreach ($tags as $key => $tag)
|
|
<option value="{{ $tag->id }}" @if (intval($searchTag) === $tag->id) selected @endif>{{ $tag->name }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
@endif
|
|
<button class="btn btn-primary" data-bs-toggle="tooltip" type="submit" title="{{ __('Rechercher') }}">
|
|
<i class="fas fa-search"></i>
|
|
</button>
|
|
<button class="btn btn-danger" id="searchDelete" data-bs-toggle="tooltip" type="button"
|
|
title="{{ __('Supprimer la recherche') }}">
|
|
<i class="fas fa-backspace"></i>
|
|
</button>
|
|
@push('scripts')
|
|
<script nonce="{{ $nonce }}">
|
|
document.getElementById('searchDelete').addEventListener('click', function(e) {
|
|
document.getElementById('searchField').value = '';
|
|
if (document.getElementById('searchTag')) {
|
|
document.getElementById('searchTag').selectedIndex = 0;
|
|
}
|
|
document.getElementById('searchForm').submit();
|
|
});
|
|
</script>
|
|
@endpush
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|