From 6e1460f816c114a11fa2853edfcfb2f32d34e6e8 Mon Sep 17 00:00:00 2001 From: itinerare Date: Thu, 27 Jun 2024 14:20:27 -0400 Subject: [PATCH 1/3] fix(comments): disable WYSIWYG properly --- resources/views/comments/_actions.blade.php | 8 ++++---- resources/views/comments/_form.blade.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/views/comments/_actions.blade.php b/resources/views/comments/_actions.blade.php index 17456eb71f..213827b2b8 100644 --- a/resources/views/comments/_actions.blade.php +++ b/resources/views/comments/_actions.blade.php @@ -23,8 +23,8 @@ class="ml-2 d-none d-sm-inline-block">Delete {{-- Likes Section --}} {!! Form::open(['url' => 'comments/' . $comment->id . '/like/1', 'class' => 'd-inline-block']) !!} @@ -70,7 +70,7 @@ class="ml-2 d-none d-sm-inline-block">Delete @@ -98,7 +98,7 @@ class="ml-2 d-none d-sm-inline-block">Delete diff --git a/resources/views/comments/_form.blade.php b/resources/views/comments/_form.blade.php index 8b8a5ccd26..11944ae32e 100644 --- a/resources/views/comments/_form.blade.php +++ b/resources/views/comments/_form.blade.php @@ -4,7 +4,7 @@
{!! Form::label('message', 'Enter your message here:') !!} - {!! Form::textarea('message', null, ['class' => 'form-control ' . (config('lorekeeper.settings.wysiwyg_comments') ? 'comment-wysiwyg' : ''), 'rows' => 5, config('lorekeeper.settings.wysiwyg_comments') ? '' : 'required']) !!} + {!! Form::textarea('message', null, ['class' => 'form-control ' . (config('lorekeeper.settings.wysiwyg_comments') ? 'comment-wysiwyg' : ''), 'rows' => 5, (config('lorekeeper.settings.wysiwyg_comments') ? '' : 'required')]) !!} Markdown cheatsheet.
From 5264da1771c72d1c797798587c81a6e46670125f Mon Sep 17 00:00:00 2001 From: itinerare Date: Tue, 11 Jun 2024 19:11:38 -0400 Subject: [PATCH 2/3] fix(comments): check if comment type is set --- resources/views/comments/comments.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/comments/comments.blade.php b/resources/views/comments/comments.blade.php index 463e0533c8..b989e946e0 100644 --- a/resources/views/comments/comments.blade.php +++ b/resources/views/comments/comments.blade.php @@ -68,7 +68,9 @@ @endisset @auth - @include('comments._form') + @include('comments._form', [ + 'compact' => (isset($type) && $type == 'Staff-Staff') && config('lorekeeper.settings.wysiwyg_comments') ? true : false, + ]) @else
From 39c33fd7aab6b0532cca8099213e2e293137c1ce Mon Sep 17 00:00:00 2001 From: itinerare Date: Tue, 11 Jun 2024 16:00:11 -0400 Subject: [PATCH 3/3] fix(comments): hide markdown cheatsheat link, markdown mention info if WYSIWYG comments are enabled --- .../views/character/_image_info.blade.php | 20 +++++++++++-------- resources/views/comments/_actions.blade.php | 8 ++++---- resources/views/comments/_form.blade.php | 6 ++++-- resources/views/comments/comments.blade.php | 2 +- .../views/galleries/submission.blade.php | 20 ++++++++++--------- .../views/user/_profile_content.blade.php | 20 +++++++++++-------- 6 files changed, 44 insertions(+), 32 deletions(-) diff --git a/resources/views/character/_image_info.blade.php b/resources/views/character/_image_info.blade.php index d39859c78c..b04b3e627a 100644 --- a/resources/views/character/_image_info.blade.php +++ b/resources/views/character/_image_info.blade.php @@ -177,10 +177,12 @@
[character={{ $character->slug }}]
- In a comment: -
- [{{ $character->fullName }}]({{ $character->url }}) -
+ @if (!config('lorekeeper.settings.wysiwyg_comments')) + In a comment: +
+ [{{ $character->fullName }}]({{ $character->url }}) +
+ @endif
For Thumbnails: @@ -189,10 +191,12 @@
[charthumb={{ $character->slug }}]
- In a comment: -
- [![Thumbnail of {{ $character->fullName }}]({{ $character->image->thumbnailUrl }})]({{ $character->url }}) -
+ @if (!config('lorekeeper.settings.wysiwyg_comments')) + In a comment: +
+ [![Thumbnail of {{ $character->fullName }}]({{ $character->image->thumbnailUrl }})]({{ $character->url }}) +
+ @endif
@endif diff --git a/resources/views/comments/_actions.blade.php b/resources/views/comments/_actions.blade.php index 213827b2b8..a95efe0c48 100644 --- a/resources/views/comments/_actions.blade.php +++ b/resources/views/comments/_actions.blade.php @@ -23,8 +23,8 @@ class="ml-2 d-none d-sm-inline-block">Delete {{-- Likes Section --}} {!! Form::open(['url' => 'comments/' . $comment->id . '/like/1', 'class' => 'd-inline-block']) !!} @@ -70,7 +70,7 @@ class="ml-2 d-none d-sm-inline-block">Delete @@ -98,7 +98,7 @@ class="ml-2 d-none d-sm-inline-block">Delete diff --git a/resources/views/comments/_form.blade.php b/resources/views/comments/_form.blade.php index 11944ae32e..7b9d8d2a25 100644 --- a/resources/views/comments/_form.blade.php +++ b/resources/views/comments/_form.blade.php @@ -4,8 +4,10 @@
{!! Form::label('message', 'Enter your message here:') !!} - {!! Form::textarea('message', null, ['class' => 'form-control ' . (config('lorekeeper.settings.wysiwyg_comments') ? 'comment-wysiwyg' : ''), 'rows' => 5, (config('lorekeeper.settings.wysiwyg_comments') ? '' : 'required')]) !!} - Markdown cheatsheet. + {!! Form::textarea('message', null, ['class' => 'form-control ' . (config('lorekeeper.settings.wysiwyg_comments') ? 'comment-wysiwyg' : ''), 'rows' => 5, config('lorekeeper.settings.wysiwyg_comments') ? '' : 'required']) !!} + @if (!config('lorekeeper.settings.wysiwyg_comments')) + Markdown cheatsheet. + @endif
{!! Form::submit('Submit', ['class' => 'btn btn-sm btn-outline-success text-uppercase']) !!} diff --git a/resources/views/comments/comments.blade.php b/resources/views/comments/comments.blade.php index b989e946e0..093323b96e 100644 --- a/resources/views/comments/comments.blade.php +++ b/resources/views/comments/comments.blade.php @@ -69,7 +69,7 @@ @auth @include('comments._form', [ - 'compact' => (isset($type) && $type == 'Staff-Staff') && config('lorekeeper.settings.wysiwyg_comments') ? true : false, + 'compact' => isset($type) && $type == 'Staff-Staff' && config('lorekeeper.settings.wysiwyg_comments') ? true : false, ]) @else
diff --git a/resources/views/galleries/submission.blade.php b/resources/views/galleries/submission.blade.php index fd0b51b416..6168709716 100644 --- a/resources/views/galleries/submission.blade.php +++ b/resources/views/galleries/submission.blade.php @@ -217,15 +217,17 @@
[thumb={{ $submission->id }}]
- In a comment: -
- @if (isset($submission->hash) && !isset($submission->content_warning)) - [![Image]({{ $submission->thumbnailUrl }})]({{ $submission->url }}) - @else - [{{ $submission->displayTitle }} by {{ $submission->creditsPlain }} - {{ isset($submission->hash) ? '(Art)' : '(Literature)' }}{{ isset($submission->content_warning) ? ' ・ **Content Warning:** ' . nl2br(htmlentities($submission->content_warning)) : '' }}]({{ $submission->url }}) - @endif -
+ @if (!config('lorekeeper.settings.wysiwyg_comments')) + In a comment: +
+ @if (isset($submission->hash) && !isset($submission->content_warning)) + [![Image]({{ $submission->thumbnailUrl }})]({{ $submission->url }}) + @else + [{{ $submission->displayTitle }} by {{ $submission->creditsPlain }} + {{ isset($submission->hash) ? '(Art)' : '(Literature)' }}{{ isset($submission->content_warning) ? ' ・ **Content Warning:** ' . nl2br(htmlentities($submission->content_warning)) : '' }}]({{ $submission->url }}) + @endif +
+ @endif
diff --git a/resources/views/user/_profile_content.blade.php b/resources/views/user/_profile_content.blade.php index b4e3a6e419..7f32ea270e 100644 --- a/resources/views/user/_profile_content.blade.php +++ b/resources/views/user/_profile_content.blade.php @@ -162,20 +162,24 @@
{{ '@' . $user->name }}
- In a comment: -
- [{{ $user->name }}]({{ $user->url }}) -
+ @if (!config('lorekeeper.settings.wysiwyg_comments')) + In a comment: +
+ [{{ $user->name }}]({{ $user->url }}) +
+ @endif
For Names and Avatars:
In the rich text editor:
{{ '%' . $user->name }}
- In a comment: -
- [![{{ $user->name }}'s Avatar]({{ $user->avatarUrl }})]({{ $user->url }}) [{{ $user->name }}]({{ $user->url }}) -
+ @if (!config('lorekeeper.settings.wysiwyg_comments')) + In a comment: +
+ [![{{ $user->name }}'s Avatar]({{ $user->avatarUrl }})]({{ $user->url }}) [{{ $user->name }}]({{ $user->url }}) +
+ @endif @if (Auth::check() && Auth::user()->isStaff)