mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-05 08:39:55 +03:00
As per PR #5800 * DB: Planned out new entity table format via migrations * DB: Created entity migration logic Made some other tweaks/fixes while testing. * DB: Added change of entity relation columns to suit new entities table * DB: Got most view queries working for new structure * Entities: Started logic change to new structure Updated base entity class, and worked through BaseRepo. Need to go through other repos next. Removed a couple of redundant interfaces as part of this since we can move the logic onto the shared ContainerData model as needed. * Entities: Been through repos to update for new format * Entities: Updated repos to act on refreshed clones Changes to core entity models are now done on clones to ensure clean state before save, and those clones are returned back if changes are needed after that action. * Entities: Updated model classes & relations for changes * Entities: Changed from *Data to a common "contents" system Added smart loading from builder instances which should hydrate with "contents()" loaded via join, while keeping the core model original. * Entities: Moved entity description/covers to own non-model classes Added back some interfaces. * Entities: Removed use of contents system for data access * Entities: Got most queries back to working order * Entities: Reverted back to data from contents, fixed various issues * Entities: Started addressing issues from tests * Entities: Addressed further tests/issues * Entities: Been through tests to get all passing in dev Fixed issues and needed test changes along the way. * Entities: Addressed phpstan errors * Entities: Reviewed TODO notes * Entities: Ensured book/shelf relation data removed on destroy * Entities: Been through API responses & adjusted field visibility * Entities: Added type index to massively improve query speed
93 lines
4.3 KiB
PHP
93 lines
4.3 KiB
PHP
{{ csrf_field() }}
|
|
<div class="form-group title-input">
|
|
<label for="name">{{ trans('common.name') }}</label>
|
|
@include('form.text', ['name' => 'name', 'autofocus' => true])
|
|
</div>
|
|
|
|
<div class="form-group description-input">
|
|
<label for="description_html">{{ trans('common.description') }}</label>
|
|
@include('form.description-html-input')
|
|
</div>
|
|
|
|
<div component="shelf-sort" class="grid half gap-xl">
|
|
<div class="form-group">
|
|
<label for="books" id="shelf-sort-books-label">{{ trans('entities.shelves_books') }}</label>
|
|
<input refs="shelf-sort@input" type="hidden" name="books"
|
|
value="{{ isset($shelf) ? $shelf->visibleBooks->implode('id', ',') : '' }}">
|
|
<div class="scroll-box-header-item flex-container-row items-center py-xs">
|
|
<span class="px-m py-xs">{{ trans('entities.shelves_drag_books') }}</span>
|
|
<div class="dropdown-container ml-auto" component="dropdown">
|
|
<button refs="dropdown@toggle"
|
|
type="button"
|
|
title="{{ trans('common.more') }}"
|
|
class="icon-button px-xs py-xxs mx-xs text-bigger"
|
|
aria-haspopup="true"
|
|
aria-expanded="false">
|
|
@icon('more')
|
|
</button>
|
|
<div refs="dropdown@menu shelf-sort@sort-button-container" class="dropdown-menu" role="menu">
|
|
<button type="button" class="text-item"
|
|
data-sort="name">{{ trans('entities.books_sort_name') }}</button>
|
|
<button type="button" class="text-item"
|
|
data-sort="created">{{ trans('entities.books_sort_created') }}</button>
|
|
<button type="button" class="text-item"
|
|
data-sort="updated">{{ trans('entities.books_sort_updated') }}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<ul refs="shelf-sort@shelf-book-list"
|
|
aria-labelledby="shelf-sort-books-label"
|
|
class="scroll-box configured-option-list">
|
|
@foreach (($shelf->visibleBooks ?? []) as $book)
|
|
@include('shelves.parts.shelf-sort-book-item', ['book' => $book])
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="books" id="shelf-sort-all-books-label">{{ trans('entities.shelves_add_books') }}</label>
|
|
<input type="text" refs="shelf-sort@book-search" class="scroll-box-search"
|
|
placeholder="{{ trans('common.search') }}">
|
|
<ul refs="shelf-sort@all-book-list"
|
|
aria-labelledby="shelf-sort-all-books-label"
|
|
class="scroll-box available-option-list">
|
|
@foreach ($books as $book)
|
|
@include('shelves.parts.shelf-sort-book-item', ['book' => $book])
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group collapsible" component="collapsible" id="logo-control">
|
|
<button refs="collapsible@trigger" type="button" class="collapse-title text-link" aria-expanded="false">
|
|
<label>{{ trans('common.cover_image') }}</label>
|
|
</button>
|
|
<div refs="collapsible@content" class="collapse-content">
|
|
<p class="small">{{ trans('common.cover_image_description') }}</p>
|
|
|
|
@include('form.image-picker', [
|
|
'defaultImage' => url('/book_default_cover.png'),
|
|
'currentImage' => (($shelf ?? null)?->coverInfo()->getUrl(440, 250, null) ?? url('/book_default_cover.png')),
|
|
'name' => 'image',
|
|
'imageClass' => 'cover'
|
|
])
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group collapsible" component="collapsible" id="tags-control">
|
|
<button refs="collapsible@trigger" type="button" class="collapse-title text-link" aria-expanded="false">
|
|
<label for="tag-manager">{{ trans('entities.shelf_tags') }}</label>
|
|
</button>
|
|
<div refs="collapsible@content" class="collapse-content">
|
|
@include('entities.tag-manager', ['entity' => $shelf ?? null])
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group text-right">
|
|
<a href="{{ isset($shelf) ? $shelf->getUrl() : url('/shelves') }}"
|
|
class="button outline">{{ trans('common.cancel') }}</a>
|
|
<button type="submit" class="button">{{ trans('entities.shelves_save') }}</button>
|
|
</div>
|
|
|
|
@include('entities.selector-popup')
|
|
@include('form.editor-translations') |