1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Added functionality/logic for button-based sorting

This commit is contained in:
Dan Brown
2023-01-27 13:08:35 +00:00
parent a3e7e754b9
commit 7cacbaadf0
3 changed files with 186 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
<div class="sort-box-actions">
<button type="button" data-move="up">Move Up</button>
<button type="button" data-move="down">Move Down</button>
<button type="button" data-move="prev_book">Move To Previous Book</button>
<button type="button" data-move="next_book">Move To Next Book</button>
<button type="button" data-move="prev_chapter">Move Into Previous Chapter</button>
<button type="button" data-move="next_chapter">Move Into Next Chapter</button>
<button type="button" data-move="book_start">Move To Start of Book</button>
<button type="button" data-move="book_end">Move To End of Book</button>
<button type="button" data-move="before_chapter">Move To Before Chapter</button>
<button type="button" data-move="after_chapter">Move To After Chapter</button>
</div>

View File

@@ -23,7 +23,8 @@
<li class="text-{{ $bookChild->getType() }}"
data-id="{{$bookChild->id}}" data-type="{{ $bookChild->getType() }}"
data-name="{{ $bookChild->name }}" data-created="{{ $bookChild->created_at->timestamp }}"
data-updated="{{ $bookChild->updated_at->timestamp }}">
data-updated="{{ $bookChild->updated_at->timestamp }}" tabindex="0">
<div class="text-muted sort-list-handle">@icon('grip')</div>
<div class="entity-list-item">
<span>@icon($bookChild->getType()) </span>
<div>
@@ -33,17 +34,21 @@
</div>
</div>
</div>
@include('books.parts.sort-box-actions')
@if($bookChild->isA('chapter'))
<ul>
@foreach($bookChild->visible_pages as $page)
<li class="text-page"
data-id="{{$page->id}}" data-type="page"
data-name="{{ $page->name }}" data-created="{{ $page->created_at->timestamp }}"
data-updated="{{ $page->updated_at->timestamp }}">
data-updated="{{ $page->updated_at->timestamp }}"
tabindex="0">
<div class="text-muted sort-list-handle">@icon('grip')</div>
<div class="entity-list-item">
<span>@icon('page')</span>
<span>{{ $page->name }}</span>
</div>
@include('books.parts.sort-box-actions')
</li>
@endforeach
</ul>