Add button to add a book directly from a shelf view

This commit is contained in:
Christopher Wilkinson
2019-04-02 16:35:46 +01:00
parent c836862d89
commit faa3a8b842
5 changed files with 57 additions and 5 deletions

View File

@ -17,7 +17,7 @@
<div class="content-wrap card">
<h1 class="list-heading">{{ trans('entities.books_create') }}</h1>
<form action="{{ baseUrl("/books") }}" method="POST" enctype="multipart/form-data">
<form action="{{ isset($bookshelf) ? $bookshelf->getUrl('/create-book') : baseUrl('/books') }}" method="POST" enctype="multipart/form-data">
@include('books.form')
</form>
</div>

View File

@ -23,6 +23,12 @@
<hr>
<p class="text-muted italic mt-xl mb-m">{{ trans('entities.shelves_empty_contents') }}</p>
<div class="icon-list inline block">
@if($currentUser->can('book-create-all'))
<a href="{{ $shelf->getUrl('/create-book') }}" class="icon-list-item text-bookshelf">
<span class="icon">@icon('add')</span>
<span>{{ trans('entities.books_create') }}</span>
</a>
@endif
@if(userCan('bookshelf-update', $shelf))
<a href="{{ $shelf->getUrl('/edit') }}" class="icon-list-item text-bookshelf">
<span class="icon">@icon('edit')</span>