From aad2ee675caffbe095391e505d2c980953761d25 Mon Sep 17 00:00:00 2001 From: Bernhard Hayden Date: Fri, 15 Jan 2021 15:52:03 +0100 Subject: [PATCH] Show tags of all search results --- resources/sass/_blocks.scss | 2 +- resources/views/components/tag-list.blade.php | 9 +++++++-- .../views/partials/entity-list-item-basic.blade.php | 3 +++ resources/views/partials/entity-list-item.blade.php | 2 +- resources/views/partials/entity-list.blade.php | 2 +- resources/views/search/all.blade.php | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/resources/sass/_blocks.scss b/resources/sass/_blocks.scss index 75adf12aa..a17d74443 100644 --- a/resources/sass/_blocks.scss +++ b/resources/sass/_blocks.scss @@ -227,7 +227,7 @@ border: 1px solid #CCC; overflow: hidden; font-size: 0.85em; - a, a:hover, a:active { + a, span, a:hover, a:active { padding: 4px 8px; @include lightDark(color, #777, #999); transition: background-color ease-in-out 80ms; diff --git a/resources/views/components/tag-list.blade.php b/resources/views/components/tag-list.blade.php index f7a9c6c48..f12433ca3 100644 --- a/resources/views/components/tag-list.blade.php +++ b/resources/views/components/tag-list.blade.php @@ -1,6 +1,11 @@ @foreach($entity->tags as $tag)
- - @if($tag->value) @endif + @if($disableLinks ?? false) +
@icon('tag'){{ $tag->name }}
+ @if($tag->value)
{{$tag->value}}
@endif + @else + + @if($tag->value) @endif + @endif
@endforeach \ No newline at end of file diff --git a/resources/views/partials/entity-list-item-basic.blade.php b/resources/views/partials/entity-list-item-basic.blade.php index 2ec4bee5c..8bc14bfb8 100644 --- a/resources/views/partials/entity-list-item-basic.blade.php +++ b/resources/views/partials/entity-list-item-basic.blade.php @@ -2,6 +2,9 @@ @icon($type)
+ @if($entity->tags->count() > 0 and $showTags ?? false) + @include('components.tag-list', ['entity' => $entity, 'disableLinks' => True ]) + @endif

{{ $entity->name }}

{{ $slot ?? '' }}
diff --git a/resources/views/partials/entity-list-item.blade.php b/resources/views/partials/entity-list-item.blade.php index d42b1967f..7a84c2263 100644 --- a/resources/views/partials/entity-list-item.blade.php +++ b/resources/views/partials/entity-list-item.blade.php @@ -1,4 +1,4 @@ -@component('partials.entity-list-item-basic', ['entity' => $entity]) +@component('partials.entity-list-item-basic', ['entity' => $entity, 'showTags' => $showTags])
@if($showPath ?? false) diff --git a/resources/views/partials/entity-list.blade.php b/resources/views/partials/entity-list.blade.php index be826f1ac..393f4e8a7 100644 --- a/resources/views/partials/entity-list.blade.php +++ b/resources/views/partials/entity-list.blade.php @@ -1,7 +1,7 @@ @if(count($entities) > 0)
@foreach($entities as $index => $entity) - @include('partials.entity-list-item', ['entity' => $entity, 'showPath' => $showPath ?? false]) + @include('partials.entity-list-item', ['entity' => $entity, 'showPath' => $showPath ?? false, 'showTags' => $showTags ?? false]) @endforeach
@else diff --git a/resources/views/search/all.blade.php b/resources/views/search/all.blade.php index df137bd2a..ace721dca 100644 --- a/resources/views/search/all.blade.php +++ b/resources/views/search/all.blade.php @@ -74,7 +74,7 @@
{{ trans_choice('entities.search_total_results_found', $totalResults, ['count' => $totalResults]) }}
- @include('partials.entity-list', ['entities' => $entities, 'showPath' => true]) + @include('partials.entity-list', ['entities' => $entities, 'showPath' => true, 'showTags' => true])
@if($hasNextPage)