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