]> BookStack Code Mirror - bookstack/commitdiff
Notifications: Started entity watch UI
authorDan Brown <redacted>
Thu, 27 Jul 2023 13:27:45 +0000 (14:27 +0100)
committerDan Brown <redacted>
Thu, 27 Jul 2023 13:27:45 +0000 (14:27 +0100)
resources/icons/watch.svg [moved from resources/icons/view.svg with 100% similarity]
resources/sass/_lists.scss
resources/sass/_text.scss
resources/views/books/show.blade.php
resources/views/entities/meta.blade.php
resources/views/entities/watch-controls.blade.php [new file with mode: 0644]

index ad0803e712596d4a753da39fa9401416b4907400..64411014db7a0e4c36dd47a1585785ddf59c9389 100644 (file)
@@ -681,6 +681,9 @@ ul.pagination {
   &.wide {
     min-width: 220px;
   }
+  &.xl-limited {
+    width: 280px;
+  }
   .text-muted {
     color: #999;
     fill: #999;
index 7cade9607b92b2c2cdbaa1f02b24f110257fd2d1..a3e6f09ac53a7768e780d8f9c8a358930841fed5 100644 (file)
@@ -365,6 +365,7 @@ li.checkbox-item, li.task-list-item {
 }
 
 .break-text {
+  white-space: normal;
   word-wrap: break-word;
   overflow-wrap: break-word;
 }
index 8bb41c18b8f0a64b1e89000305fd79312ac01e29..f126c62194882671f1b4f578e8d7e448fe8a2623 100644 (file)
@@ -67,7 +67,7 @@
 @stop
 
 @section('right')
-    <div class="mb-xl">
+    <div class="mb-xl" style="z-index: 1000; opacity: 1;">
         <h5>{{ trans('common.details') }}</h5>
         <div class="blended-links">
             @include('entities.meta', ['entity' => $book])
index 7ad61f1b1e711f8eb95145cf4d37aff8a2f20e30..b657d82deaab79a42dd4cce4957a06811c0a04db 100644 (file)
             </div>
         </a>
     @endif
+
+    <div class="dropdown-container">
+        <div class="entity-meta-item">
+            @icon('watch')
+            <span>Watching with default preferences</span>
+        </div>
+        @include('entities.watch-controls', ['entity' => $entity])
+    </div>
 </div>
\ No newline at end of file
diff --git a/resources/views/entities/watch-controls.blade.php b/resources/views/entities/watch-controls.blade.php
new file mode 100644 (file)
index 0000000..ab4af0f
--- /dev/null
@@ -0,0 +1,71 @@
+<form action="{{ $entity->getUrl('/') }}" method="GET">
+{{--    {{ method_field('PUT') }}--}}
+
+    <ul class="dropdown-menu xl-limited anchor-left" style="display: block;">
+        <li>
+            <button name="level" value="default" class="icon-item">
+                <span class="text-pos pt-m">{!!  request()->query('level') === 'default' ? icon('check-circle') : '' !!}</span>
+                <div class="break-text">
+                    <div class="mb-xxs"><strong>Default Preferences</strong></div>
+                    <div class="text-muted text-small">
+                        Revert watching to just your default notification preferences.
+                    </div>
+                </div>
+            </button>
+        </li>
+        <li><hr class="my-none"></li>
+        <li>
+            <button name="level" value="ignore" class="icon-item">
+                <span class="text-pos pt-m">{!!  request()->query('level') === 'ignore' ? icon('check-circle') : '' !!}</span>
+                <div class="break-text">
+                    <div class="mb-xxs"><strong>Ignore</strong></div>
+                    <div class="text-muted text-small">
+                        Ignore all notifications, including those from user-level preferences.
+                    </div>
+                </div>
+            </button>
+        </li>
+        <li><hr class="my-none"></li>
+        <li>
+            <button name="level" value="new" class="icon-item">
+                <span class="text-pos pt-m">{!!  request()->query('level') === 'new' ? icon('check-circle') : '' !!}</span>
+                <div class="break-text">
+                    <div class="mb-xxs"><strong>New Pages</strong></div>
+                    <div class="text-muted text-small">
+                        Notify when any new page is created within this item.
+                    </div>
+                </div>
+            </button>
+        </li>
+        <li><hr class="my-none"></li>
+        <li>
+            <button name="level" value="updates" class="icon-item">
+                <span class="text-pos pt-m">{!!  request()->query('level') === 'updates' ? icon('check-circle') : '' !!}</span>
+                <div class="break-text">
+                    <div class="mb-xxs"><strong>All Page Updates</strong></div>
+                    <div class="text-muted text-small">
+                        Notify upon all new pages and page changes.
+                    </div>
+                </div>
+            </button>
+        </li>
+        <li><hr class="my-none"></li>
+        <li>
+            <button name="level" value="comments" class="icon-item">
+                <span class="text-pos pt-m">{!!  request()->query('level') === 'comments' ? icon('check-circle') : '' !!}</span>
+                <div class="break-text">
+                    <div class="mb-xxs"><strong>All Page Updates & Comments</strong></div>
+                    <div class="text-muted text-small">
+                        Notify upon all new pages, page changes and new comments.
+                    </div>
+                </div>
+            </button>
+        </li>
+        <li><hr class="my-none"></li>
+        <li>
+            <div class="text-small text-muted px-l pb-xxs pt-xs">
+                <a href="{{ url('/preferences/notifications') }}" target="_blank">Change default notification preferences</a>
+            </div>
+        </li>
+    </ul>
+</form>
\ No newline at end of file