diff --git a/resources/svg/search-drivers/loupe.svg b/resources/svg/search-drivers/loupe.svg new file mode 100644 index 0000000000..41307fba47 --- /dev/null +++ b/resources/svg/search-drivers/loupe.svg @@ -0,0 +1 @@ + diff --git a/resources/views/utilities/search.blade.php b/resources/views/utilities/search.blade.php index 03e8886adf..059f28154f 100644 --- a/resources/views/utilities/search.blade.php +++ b/resources/views/utilities/search.blade.php @@ -40,21 +40,25 @@ @foreach (\Statamic\Facades\Search::indexes() as $index) - - - @cp_svg('search-drivers/' . $index->config()['driver'], 'w-6 h-6 rtl:ml-2 ltr:mr-2') -
{{ $index->title() }}
+ + +
+ @cp_svg('search-drivers/' . $index->config()['driver'], 'flex w-6 h-6 rtl:ml-2 ltr:mr-2 -mt-0.5 shrink-0', 'search-drivers/local') + {{ $index->title() }} +
{{ ucwords($index->config()['driver']) }} @if (is_string($index->config()['searchables'])) - {{ $index->config()['searchables'] }} - @else
+ {{ $index->config()['searchables'] }} +
+ @else +
@foreach($index->config()['searchables'] as $searchable) -
+
{{ $searchable }}
@endforeach @@ -62,9 +66,9 @@ @endif -
+
@foreach($index->config()['fields'] as $field) -
+
{{ $field }}
@endforeach @@ -74,7 +78,7 @@
@csrf - +
diff --git a/src/Statamic.php b/src/Statamic.php index 272b0bf94e..1af2278c34 100644 --- a/src/Statamic.php +++ b/src/Statamic.php @@ -242,15 +242,18 @@ public static function provideToScript(array $variables) return new static; } - public static function svg($name, $attrs = null) + public static function svg($name, $attrs = null, $fallback = null) { if ($attrs) { $attrs = " class=\"{$attrs}\""; } - $svg = StaticStringy::collapseWhitespace( - File::get(statamic_path("resources/svg/{$name}.svg")) - ); + $path = statamic_path("resources/svg/{$name}.svg"); + if ($fallback && ! File::exists($path)) { + $path = statamic_path("resources/svg/{$fallback}.svg"); + } + + $svg = StaticStringy::collapseWhitespace(File::get($path)); return str_replace('