Skip to content

Commit

Permalink
Merge pull request #11535 from nanaya/forum-list-separator
Browse files Browse the repository at this point in the history
Add separator before each forum main categories
  • Loading branch information
notbakaneko authored Oct 11, 2024
2 parents a8faa3e + 78eaa90 commit a430cf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion resources/views/forum/topics/_moderate_move.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ class="btn-circle btn-circle--topic-nav btn-circle--yellow"
<label class="form-select">
<select name="destination_forum_id" class="form-select__input">
@foreach (App\Models\Forum\Forum::displayList()->get() as $dstForum)
@php
$currentDepth = $dstForum->currentDepth();
@endphp
@if (!$loop->first && $currentDepth === 0)
<hr>
@endif
<option value="{{ $dstForum->getKey() }}"
{{ $dstForum->isOpen() ? '' : 'disabled' }}
{{ $dstForum->getKey() === $topic->forum_id ? 'selected' : '' }}
>
{{ str_repeat('', $dstForum->currentDepth()) }}
{{ str_repeat('', $currentDepth) }}
{{ $dstForum->forum_name }}
</option>
@endforeach
Expand Down
8 changes: 7 additions & 1 deletion resources/views/objects/search/_forum_options.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,17 @@ class="form-select__input"

@foreach (App\Models\Forum\Forum::searchable()->displayList()->get() as $forum)
@if (priv_check('ForumView', $forum)->can())
@php
$currentDepth = $forum->currentDepth();
@endphp
@if ($currentDepth === 0)
<hr>
@endif
<option
value="{{ $forum->getKey() }}"
{{ $forum->getKey() === get_int($params[$fields['forumId']] ?? null) ? 'selected' : '' }}
>
{{ str_repeat('', $forum->currentDepth()) }}
{{ str_repeat('', $currentDepth) }}
{{ $forum->forum_name }}
</option>
@endif
Expand Down

0 comments on commit a430cf1

Please sign in to comment.