Skip to content

Commit

Permalink
Merge pull request #618 from chrissawyerfan4/search-nonoresults
Browse files Browse the repository at this point in the history
Don't show "no results" when no search was performed
  • Loading branch information
Kovah authored Mar 16, 2023
2 parents 8ce2390 + 6da9c0a commit 0249392
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/App/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function getSearch(): View
'only_lists' => '',
'only_tags' => '',
'order_by' => $this->orderByOptions[0],
'performed_search' => false,
]);
}

Expand Down Expand Up @@ -60,6 +61,7 @@ public function doSearch(SearchRequest $request): View
'empty_tags' => $this->emptyTags,
'empty_lists' => $this->emptyLists,
'order_by' => $this->searchOrderBy,
'performed_search' => true,
]);
}
}
8 changes: 5 additions & 3 deletions resources/views/app/search/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ class="form-check-input"
<div class="card-table mt-4">

@if($results->isEmpty())
<div class="alert alert-info m-3">
@lang('search.no_results')
</div>
@if($query_settings['performed_search'])
<div class="alert alert-info m-3">
@lang('search.no_results')
</div>
@endif
@else
@include('app.search.partials.table', ['results' => $results])
@endif
Expand Down

0 comments on commit 0249392

Please sign in to comment.