Extracted text & added dropdown for book sort move actions

Primarily styling and testing left to do.
This commit is contained in:
Dan Brown 2023-01-27 13:26:58 +00:00
parent 7cacbaadf0
commit 40e112fc5b
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
4 changed files with 34 additions and 14 deletions

View File

@ -150,7 +150,16 @@ return [
'books_sort_chapters_last' => 'Chapters Last',
'books_sort_show_other' => 'Show Other Books',
'books_sort_show_other_desc' => 'Add other books here to include them in the sort operation, and allow easy cross-book reorganisation.',
'books_sort_save' => 'Save New Order',
'books_sort_move_up' => 'Move Up',
'books_sort_move_down' => 'Move Down',
'books_sort_move_prev_book' => 'Move To Previous Book',
'books_sort_move_next_book' => 'Move To Next Book',
'books_sort_move_prev_chapter' => 'Move Into Previous Chapter',
'books_sort_move_next_chapter' => 'Move Into Next Chapter',
'books_sort_move_book_start' => 'Move To Start of Book',
'books_sort_move_book_end' => 'Move To End of Book',
'books_sort_move_before_chapter' => 'Move To Before Chapter',
'books_sort_move_after_chapter' => 'Move To After Chapter',
'books_copy' => 'Copy Book',
'books_copy_success' => 'Book successfully copied',

View File

@ -232,7 +232,7 @@
}
// Sortable Lists
.sortable-page-list, .sortable-page-list ul {
.sortable-page-list, .sortable-page-sublist {
list-style: none;
}
.sort-box {
@ -278,7 +278,7 @@
> ul {
margin-inline-start: 0;
}
ul {
.sortable-page-sublist {
margin-bottom: $-m;
margin-top: 0;
padding-inline-start: $-m;

View File

@ -1,12 +1,23 @@
<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>
<button type="button" data-move="up" title="{{ trans('entities.books_sort_move_up') }}">@icon('chevron-up')</button>
<button type="button" data-move="down"
title="{{ trans('entities.books_sort_move_down') }}">@icon('chevron-down')</button>
<div class="dropdown-container" component="dropdown">
<button refs="dropdown@toggle"
title="{{ trans('common.more') }}"
aria-haspopup="true"
aria-expanded="false">
@icon('more')
</button>
<div refs="dropdown@menu" class="dropdown-menu" role="menu">
<button type="button" class="text-item" data-move="prev_book">{{ trans('entities.books_sort_move_prev_book') }}</button>
<button type="button" class="text-item" data-move="next_book">{{ trans('entities.books_sort_move_next_book') }}</button>
<button type="button" class="text-item" data-move="prev_chapter">{{ trans('entities.books_sort_move_prev_chapter') }}</button>
<button type="button" class="text-item" data-move="next_chapter">{{ trans('entities.books_sort_move_next_chapter') }}</button>
<button type="button" class="text-item" data-move="book_start">{{ trans('entities.books_sort_move_book_start') }}</button>
<button type="button" class="text-item" data-move="book_end">{{ trans('entities.books_sort_move_book_end') }}</button>
<button type="button" class="text-item" data-move="before_chapter">{{ trans('entities.books_sort_move_before_chapter') }}</button>
<button type="button" class="text-item" data-move="after_chapter">{{ trans('entities.books_sort_move_after_chapter') }}</button>
</div>
</div>
</div>

View File

@ -36,7 +36,7 @@
</div>
@include('books.parts.sort-box-actions')
@if($bookChild->isA('chapter'))
<ul>
<ul class="sortable-page-sublist">
@foreach($bookChild->visible_pages as $page)
<li class="text-page"
data-id="{{$page->id}}" data-type="page"