2021-08-22 14:15:58 +02:00
|
|
|
@extends('layouts.simple')
|
2015-08-31 21:11:44 +02:00
|
|
|
|
2019-02-03 14:45:45 +01:00
|
|
|
@section('body')
|
2020-06-27 14:29:00 +02:00
|
|
|
<div class="container mt-xl" id="search-system">
|
2015-08-31 21:11:44 +02:00
|
|
|
|
2019-03-30 15:27:00 +01:00
|
|
|
<div class="grid right-focus reverse-collapse gap-xl">
|
2019-02-03 14:45:45 +01:00
|
|
|
<div>
|
|
|
|
<div>
|
2020-06-27 14:29:00 +02:00
|
|
|
<h5>{{ trans('entities.search_advanced') }}</h5>
|
2019-02-03 14:45:45 +01:00
|
|
|
|
2020-06-27 14:29:00 +02:00
|
|
|
<form method="get" action="{{ url('/search') }}">
|
|
|
|
<h6>{{ trans('entities.search_terms') }}</h6>
|
|
|
|
<input type="text" name="search" value="{{ implode(' ', $options->searches) }}">
|
|
|
|
|
|
|
|
<h6>{{ trans('entities.search_content_type') }}</h6>
|
2019-02-03 14:45:45 +01:00
|
|
|
<div class="form-group">
|
2020-06-27 14:29:00 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
$types = explode('|', $options->filters['type'] ?? '');
|
|
|
|
$hasTypes = $types[0] !== '';
|
|
|
|
?>
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('search.parts.type-filter', ['checked' => !$hasTypes || in_array('page', $types), 'entity' => 'page', 'transKey' => 'page'])
|
|
|
|
@include('search.parts.type-filter', ['checked' => !$hasTypes || in_array('chapter', $types), 'entity' => 'chapter', 'transKey' => 'chapter'])
|
2019-02-03 14:45:45 +01:00
|
|
|
<br>
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('search.parts.type-filter', ['checked' => !$hasTypes || in_array('book', $types), 'entity' => 'book', 'transKey' => 'book'])
|
|
|
|
@include('search.parts.type-filter', ['checked' => !$hasTypes || in_array('bookshelf', $types), 'entity' => 'bookshelf', 'transKey' => 'shelf'])
|
2019-02-03 14:45:45 +01:00
|
|
|
</div>
|
|
|
|
|
2020-06-27 14:29:00 +02:00
|
|
|
<h6>{{ trans('entities.search_exact_matches') }}</h6>
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('search.parts.term-list', ['type' => 'exact', 'currentList' => $options->exacts])
|
2020-06-27 14:29:00 +02:00
|
|
|
|
|
|
|
<h6>{{ trans('entities.search_tags') }}</h6>
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('search.parts.term-list', ['type' => 'tags', 'currentList' => $options->tags])
|
2019-02-03 14:45:45 +01:00
|
|
|
|
|
|
|
@if(signedInUser())
|
2020-06-27 14:29:00 +02:00
|
|
|
<h6>{{ trans('entities.search_options') }}</h6>
|
|
|
|
|
2021-08-22 14:15:58 +02:00
|
|
|
@component('search.parts.boolean-filter', ['filters' => $options->filters, 'name' => 'viewed_by_me', 'value' => null])
|
2019-02-03 14:45:45 +01:00
|
|
|
{{ trans('entities.search_viewed_by_me') }}
|
2020-06-27 14:29:00 +02:00
|
|
|
@endcomponent
|
2021-08-22 14:15:58 +02:00
|
|
|
@component('search.parts.boolean-filter', ['filters' => $options->filters, 'name' => 'not_viewed_by_me', 'value' => null])
|
2019-02-03 14:45:45 +01:00
|
|
|
{{ trans('entities.search_not_viewed_by_me') }}
|
2020-06-27 14:29:00 +02:00
|
|
|
@endcomponent
|
2021-08-22 14:15:58 +02:00
|
|
|
@component('search.parts.boolean-filter', ['filters' => $options->filters, 'name' => 'is_restricted', 'value' => null])
|
2019-02-03 14:45:45 +01:00
|
|
|
{{ trans('entities.search_permissions_set') }}
|
2020-06-27 14:29:00 +02:00
|
|
|
@endcomponent
|
2021-08-22 14:15:58 +02:00
|
|
|
@component('search.parts.boolean-filter', ['filters' => $options->filters, 'name' => 'created_by', 'value' => 'me'])
|
2019-02-03 14:45:45 +01:00
|
|
|
{{ trans('entities.search_created_by_me') }}
|
2020-06-27 14:29:00 +02:00
|
|
|
@endcomponent
|
2021-08-22 14:15:58 +02:00
|
|
|
@component('search.parts.boolean-filter', ['filters' => $options->filters, 'name' => 'updated_by', 'value' => 'me'])
|
2019-02-03 14:45:45 +01:00
|
|
|
{{ trans('entities.search_updated_by_me') }}
|
2020-06-27 14:29:00 +02:00
|
|
|
@endcomponent
|
2021-08-22 14:15:58 +02:00
|
|
|
@component('search.parts.boolean-filter', ['filters' => $options->filters, 'name' => 'owned_by', 'value' => 'me'])
|
2021-02-14 11:40:38 +01:00
|
|
|
{{ trans('entities.search_owned_by_me') }}
|
|
|
|
@endcomponent
|
2019-02-03 14:45:45 +01:00
|
|
|
@endif
|
|
|
|
|
2020-06-27 14:29:00 +02:00
|
|
|
<h6>{{ trans('entities.search_date_options') }}</h6>
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('search.parts.date-filter', ['name' => 'updated_after', 'filters' => $options->filters])
|
|
|
|
@include('search.parts.date-filter', ['name' => 'updated_before', 'filters' => $options->filters])
|
|
|
|
@include('search.parts.date-filter', ['name' => 'created_after', 'filters' => $options->filters])
|
|
|
|
@include('search.parts.date-filter', ['name' => 'created_before', 'filters' => $options->filters])
|
2019-02-03 14:45:45 +01:00
|
|
|
|
2021-11-14 16:07:13 +01:00
|
|
|
@if(isset($options->filters['created_by']))
|
|
|
|
<input type="hidden" name="filters[created_by]" value="{{ $options->filters['created_by'] }}">
|
|
|
|
@endif
|
|
|
|
@if(isset($options->filters['updated_by']))
|
|
|
|
<input type="hidden" name="filters[updated_by]" value="{{ $options->filters['updated_by'] }}">
|
|
|
|
@endif
|
|
|
|
|
2019-08-25 13:40:04 +02:00
|
|
|
<button type="submit" class="button">{{ trans('entities.search_update') }}</button>
|
2019-02-03 14:45:45 +01:00
|
|
|
</form>
|
2017-04-09 21:59:57 +02:00
|
|
|
|
2019-02-03 14:45:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
2020-06-27 14:29:00 +02:00
|
|
|
<div class="card content-wrap">
|
2019-02-03 14:45:45 +01:00
|
|
|
<h1 class="list-heading">{{ trans('entities.search_results') }}</h1>
|
2020-06-27 14:29:00 +02:00
|
|
|
|
2019-08-04 15:26:39 +02:00
|
|
|
<form action="{{ url('/search') }}" method="GET" class="search-box flexible hide-over-l">
|
2019-05-19 16:06:52 +02:00
|
|
|
<input value="{{$searchTerm}}" type="text" name="term" placeholder="{{ trans('common.search') }}">
|
|
|
|
<button type="submit">@icon('search')</button>
|
|
|
|
</form>
|
2020-06-27 14:29:00 +02:00
|
|
|
|
2019-02-03 14:45:45 +01:00
|
|
|
<h6 class="text-muted">{{ trans_choice('entities.search_total_results_found', $totalResults, ['count' => $totalResults]) }}</h6>
|
|
|
|
<div class="book-contents">
|
2021-08-22 14:15:58 +02:00
|
|
|
@include('entities.list', ['entities' => $entities, 'showPath' => true, 'showTags' => true])
|
2019-02-03 14:45:45 +01:00
|
|
|
</div>
|
2020-06-27 14:29:00 +02:00
|
|
|
|
2019-02-03 14:45:45 +01:00
|
|
|
@if($hasNextPage)
|
|
|
|
<div class="text-right mt-m">
|
|
|
|
<a href="{{ $nextPageLink }}" class="button outline">{{ trans('entities.search_more') }}</a>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-26 18:17:04 +02:00
|
|
|
|
|
|
|
</div>
|
2018-02-03 15:45:36 +01:00
|
|
|
@stop
|