]> BookStack Code Mirror - bookstack/blobdiff - resources/views/entities/meta.blade.php
Notifications: Linked watch functionality to UI
[bookstack] / resources / views / entities / meta.blade.php
index 0bda1293828e909608b60184d0aca1414f27cd65..6783902a1552cd49bafabf52a79892f42c7bc823 100644 (file)
         </a>
     @endif
 
-    <div component="dropdown"
-         class="dropdown-container my-xxs">
-        <a refs="dropdown@toggle" href="#" class="entity-meta-item my-none">
-            @icon('watch')
-            <span>Watching with default preferences</span>
-        </a>
-        @include('entities.watch-controls', ['entity' => $entity])
-    </div>
+    @if($watchOptions?->canWatch() && $watchOptions->isWatching($entity))
+        @php
+            $watchLevel = $watchOptions->getEntityWatchLevel($entity);
+        @endphp
+        <div component="dropdown"
+             class="dropdown-container block my-xxs">
+            <a refs="dropdown@toggle" href="#" class="entity-meta-item my-none">
+                @icon(($watchLevel === 'ignore' ? 'watch-ignore' : 'watch'))
+                <span>{{ trans('entities.watch_detail_' . $watchLevel) }}</span>
+            </a>
+            @include('entities.watch-controls', ['entity' => $entity, 'watchLevel' => $watchLevel])
+        </div>
+    @endif
 </div>
\ No newline at end of file