]> BookStack Code Mirror - bookstack/commitdiff
Add the "Create Shelf" resp. "Create Book" to the home view 1756/head
authorjakob <redacted>
Wed, 30 Oct 2019 10:42:37 +0000 (11:42 +0100)
committerjakob <redacted>
Wed, 30 Oct 2019 10:42:37 +0000 (11:42 +0100)
resources/views/common/home-book.blade.php
resources/views/common/home-shelves.blade.php

index 7644eeb8871278e6b0618d911a5a935c5fd5f948..de2822261b9508fa581319ec1b300051c9e51780 100644 (file)
     <div class="actions mb-xl">
         <h5>{{ trans('common.actions') }}</h5>
         <div class="icon-list text-primary">
+            @if($currentUser->can('book-create-all'))
+                <a href="{{ url("/create-book") }}" class="icon-list-item">
+                    <span>@icon('add')</span>
+                    <span>{{ trans('entities.books_create') }}</span>
+                </a>
+            @endif
             @include('partials.view-toggle', ['view' => $view, 'type' => 'book'])
             @include('components.expand-toggle', ['target' => '.entity-list.compact .entity-item-snippet', 'key' => 'home-details'])
         </div>
index a9c58589386df4ac996facacd32c3edc8c3c4753..3935734d4667d3872b3be0d220fd427eecec536d 100644 (file)
     <div class="actions mb-xl">
         <h5>{{ trans('common.actions') }}</h5>
         <div class="icon-list text-primary">
+            @if($currentUser->can('bookshelf-create-all'))
+                <a href="{{ url("/create-shelf") }}" class="icon-list-item">
+                    <span>@icon('add')</span>
+                    <span>{{ trans('entities.shelves_new_action') }}</span>
+                </a>
+            @endif
             @include('partials.view-toggle', ['view' => $view, 'type' => 'shelf'])
             @include('components.expand-toggle', ['target' => '.entity-list.compact .entity-item-snippet', 'key' => 'home-details'])
         </div>