]> BookStack Code Mirror - bookstack/commitdiff
Fixed : Comment notification settings are visible even if comments are disabled
authorTushar Nain <redacted>
Sat, 16 Sep 2023 08:30:08 +0000 (14:00 +0530)
committerGitHub <redacted>
Sat, 16 Sep 2023 08:30:08 +0000 (14:00 +0530)
Added a UX condition to display comment notification settings, only if the user has enabled the comment notifications.

resources/views/users/preferences/notifications.blade.php

index ae89c087e765dcce9a202cb9013d6cfc891f1a80..9817aac4d7b503c294ae5e88d910b581fda65d98 100644 (file)
                                 'label' => trans('preferences.notifications_opt_own_page_changes'),
                             ])
                         </div>
-                        <div>
-                            @include('form.toggle-switch', [
-                                'name' => 'preferences[own-page-comments]',
-                                'value' => $preferences->notifyOnOwnPageComments(),
-                                'label' => trans('preferences.notifications_opt_own_page_comments'),
-                            ])
-                        </div>
-                        <div>
-                            @include('form.toggle-switch', [
-                                'name' => 'preferences[comment-replies]',
-                                'value' => $preferences->notifyOnCommentReplies(),
-                                'label' => trans('preferences.notifications_opt_comment_replies'),
-                            ])
-                        </div>
+                        @if (!setting('app-disable-comments'))
+                            <div>
+                                @include('form.toggle-switch', [
+                                    'name' => 'preferences[own-page-comments]',
+                                    'value' => $preferences->notifyOnOwnPageComments(),
+                                    'label' => trans('preferences.notifications_opt_own_page_comments'),
+                                ])
+                            </div>
+                            <div>
+                                @include('form.toggle-switch', [
+                                    'name' => 'preferences[comment-replies]',
+                                    'value' => $preferences->notifyOnCommentReplies(),
+                                    'label' => trans('preferences.notifications_opt_comment_replies'),
+                                ])
+                            </div>
+                        @endif
                     </div>
 
                     <div class="mt-auto">