]> BookStack Code Mirror - bookstack/commitdiff
Show tags of all search results 2487/head
authorBernhard Hayden <redacted>
Fri, 15 Jan 2021 14:52:03 +0000 (15:52 +0100)
committerBernhard Hayden <redacted>
Fri, 15 Jan 2021 14:52:03 +0000 (15:52 +0100)
resources/sass/_blocks.scss
resources/views/components/tag-list.blade.php
resources/views/partials/entity-list-item-basic.blade.php
resources/views/partials/entity-list-item.blade.php
resources/views/partials/entity-list.blade.php
resources/views/search/all.blade.php

index 75adf12aacde34a99b795c7278320f6ebdfee62b..a17d74443cabf1cf6771b34931c2cafc9ce009c8 100644 (file)
   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;
index f7a9c6c48623c36d92f9e0434532a1388f5753c7..f12433ca34cd27f5878d26f31535278a56a7e646 100644 (file)
@@ -1,6 +1,11 @@
 @foreach($entity->tags as $tag)
     <div class="tag-item primary-background-light">
-        <div class="tag-name"><a href="{{ url('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">@icon('tag'){{ $tag->name }}</a></div>
-        @if($tag->value) <div class="tag-value"><a href="{{ url('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></div> @endif
+        @if($disableLinks ?? false)
+            <div class="tag-name"><span>@icon('tag'){{ $tag->name }}</span></div>
+            @if($tag->value) <div class="tag-value"><span>{{$tag->value}}</span></div> @endif
+        @else
+            <div class="tag-name"><a href="{{ url('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">@icon('tag'){{ $tag->name }}</a></div>
+            @if($tag->value) <div class="tag-value"><a href="{{ url('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></div> @endif
+        @endif
     </div>
 @endforeach
\ No newline at end of file
index 2ec4bee5cc07dbf13db6b0978effd5990551cdc4..8bc14bfb826a7389c98618b403349b07a36843a2 100644 (file)
@@ -2,6 +2,9 @@
 <a href="{{ $entity->getUrl() }}" class="{{$type}} {{$type === 'page' && $entity->draft ? 'draft' : ''}} {{$classes ?? ''}} entity-list-item" data-entity-type="{{$type}}" data-entity-id="{{$entity->id}}">
     <span role="presentation" class="icon text-{{$type}}">@icon($type)</span>
     <div class="content">
+            @if($entity->tags->count() > 0 and $showTags ?? false)
+                    @include('components.tag-list', ['entity' => $entity, 'disableLinks' => True ])
+            @endif
             <h4 class="entity-list-item-name break-text">{{ $entity->name }}</h4>
             {{ $slot ?? '' }}
     </div>
index d42b1967fcd230a83537cbe76ef6caae369ff184..7a84c2263b43c0f6494efc29196ddbad1dcf662b 100644 (file)
@@ -1,4 +1,4 @@
-@component('partials.entity-list-item-basic', ['entity' => $entity])
+@component('partials.entity-list-item-basic', ['entity' => $entity, 'showTags' => $showTags])
 <div class="entity-item-snippet">
 
     @if($showPath ?? false)
index be826f1ac4f495ba2f61d2eff9cdfd779c44d4fa..393f4e8a792c5af7f92afc92020bb4c599bcb598 100644 (file)
@@ -1,7 +1,7 @@
 @if(count($entities) > 0)
     <div class="entity-list {{ $style ?? '' }}">
         @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
     </div>
 @else
index df137bd2a3bcbef73662ff1355b921df8d76f14c..ace721dca3acb0bfa992d289ed8fa8e6008920ad 100644 (file)
@@ -74,7 +74,7 @@
 
                     <h6 class="text-muted">{{ trans_choice('entities.search_total_results_found', $totalResults, ['count' => $totalResults]) }}</h6>
                     <div class="book-contents">
-                        @include('partials.entity-list', ['entities' => $entities, 'showPath' => true])
+                        @include('partials.entity-list', ['entities' => $entities, 'showPath' => true, 'showTags' => true])
                     </div>
 
                     @if($hasNextPage)