Skip to content

Commit 40e112f

Browse files
committed
Extracted text & added dropdown for book sort move actions
Primarily styling and testing left to do.
1 parent 7cacbaa commit 40e112f

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

resources/lang/en/entities.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,16 @@
150150
'books_sort_chapters_last' => 'Chapters Last',
151151
'books_sort_show_other' => 'Show Other Books',
152152
'books_sort_show_other_desc' => 'Add other books here to include them in the sort operation, and allow easy cross-book reorganisation.',
153-
'books_sort_save' => 'Save New Order',
153+
'books_sort_move_up' => 'Move Up',
154+
'books_sort_move_down' => 'Move Down',
155+
'books_sort_move_prev_book' => 'Move To Previous Book',
156+
'books_sort_move_next_book' => 'Move To Next Book',
157+
'books_sort_move_prev_chapter' => 'Move Into Previous Chapter',
158+
'books_sort_move_next_chapter' => 'Move Into Next Chapter',
159+
'books_sort_move_book_start' => 'Move To Start of Book',
160+
'books_sort_move_book_end' => 'Move To End of Book',
161+
'books_sort_move_before_chapter' => 'Move To Before Chapter',
162+
'books_sort_move_after_chapter' => 'Move To After Chapter',
154163
'books_copy' => 'Copy Book',
155164
'books_copy_success' => 'Book successfully copied',
156165

resources/sass/_lists.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
}
233233

234234
// Sortable Lists
235-
.sortable-page-list, .sortable-page-list ul {
235+
.sortable-page-list, .sortable-page-sublist {
236236
list-style: none;
237237
}
238238
.sort-box {
@@ -278,7 +278,7 @@
278278
> ul {
279279
margin-inline-start: 0;
280280
}
281-
ul {
281+
.sortable-page-sublist {
282282
margin-bottom: $-m;
283283
margin-top: 0;
284284
padding-inline-start: $-m;
Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
<div class="sort-box-actions">
2-
<button type="button" data-move="up">Move Up</button>
3-
<button type="button" data-move="down">Move Down</button>
4-
<button type="button" data-move="prev_book">Move To Previous Book</button>
5-
<button type="button" data-move="next_book">Move To Next Book</button>
6-
<button type="button" data-move="prev_chapter">Move Into Previous Chapter</button>
7-
<button type="button" data-move="next_chapter">Move Into Next Chapter</button>
8-
<button type="button" data-move="book_start">Move To Start of Book</button>
9-
<button type="button" data-move="book_end">Move To End of Book</button>
10-
<button type="button" data-move="before_chapter">Move To Before Chapter</button>
11-
<button type="button" data-move="after_chapter">Move To After Chapter</button>
2+
<button type="button" data-move="up" title="{{ trans('entities.books_sort_move_up') }}">@icon('chevron-up')</button>
3+
<button type="button" data-move="down"
4+
title="{{ trans('entities.books_sort_move_down') }}">@icon('chevron-down')</button>
5+
<div class="dropdown-container" component="dropdown">
6+
<button refs="dropdown@toggle"
7+
title="{{ trans('common.more') }}"
8+
aria-haspopup="true"
9+
aria-expanded="false">
10+
@icon('more')
11+
</button>
12+
<div refs="dropdown@menu" class="dropdown-menu" role="menu">
13+
<button type="button" class="text-item" data-move="prev_book">{{ trans('entities.books_sort_move_prev_book') }}</button>
14+
<button type="button" class="text-item" data-move="next_book">{{ trans('entities.books_sort_move_next_book') }}</button>
15+
<button type="button" class="text-item" data-move="prev_chapter">{{ trans('entities.books_sort_move_prev_chapter') }}</button>
16+
<button type="button" class="text-item" data-move="next_chapter">{{ trans('entities.books_sort_move_next_chapter') }}</button>
17+
<button type="button" class="text-item" data-move="book_start">{{ trans('entities.books_sort_move_book_start') }}</button>
18+
<button type="button" class="text-item" data-move="book_end">{{ trans('entities.books_sort_move_book_end') }}</button>
19+
<button type="button" class="text-item" data-move="before_chapter">{{ trans('entities.books_sort_move_before_chapter') }}</button>
20+
<button type="button" class="text-item" data-move="after_chapter">{{ trans('entities.books_sort_move_after_chapter') }}</button>
21+
</div>
22+
</div>
1223
</div>

resources/views/books/parts/sort-box.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</div>
3737
@include('books.parts.sort-box-actions')
3838
@if($bookChild->isA('chapter'))
39-
<ul>
39+
<ul class="sortable-page-sublist">
4040
@foreach($bookChild->visible_pages as $page)
4141
<li class="text-page"
4242
data-id="{{$page->id}}" data-type="page"

0 commit comments

Comments
 (0)