Skip to content

NOW MANAGED ON CODEBERG

Views: Made index/show sidebars a lot more modular

Dan Brown057d7be0bc7e
diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php
index 52d23241a..660c008df 100644
--- a/resources/views/books/index.blade.php
+++ b/resources/views/books/index.blade.php
@@ -5,58 +5,11 @@
@stop
@section('left')
- @if($recents)
- <div id="recents" class="mb-xl">
- <h5>{{ trans('entities.recently_viewed') }}</h5>
- @include('entities.list', ['entities' => $recents, 'style' => 'compact'])
- </div>
- @endif
-
- <div id="popular" class="mb-xl">
- <h5>{{ trans('entities.books_popular') }}</h5>
- @if(count($popular) > 0)
- @include('entities.list', ['entities' => $popular, 'style' => 'compact'])
- @else
- <p class="text-muted pb-l mb-none">{{ trans('entities.books_popular_empty') }}</p>
- @endif
- </div>
-
- <div id="new" class="mb-xl">
- <h5>{{ trans('entities.books_new') }}</h5>
- @if(count($new) > 0)
- @include('entities.list', ['entities' => $new, 'style' => 'compact'])
- @else
- <p class="text-muted pb-l mb-none">{{ trans('entities.books_new_empty') }}</p>
- @endif
- </div>
+ @include('books.parts.index-sidebar-section-recents', ['recents' => $recents])
+ @include('books.parts.index-sidebar-section-popular', ['popular' => $popular])
+ @include('books.parts.index-sidebar-section-new', ['new' => $new])
@stop
@section('right')
-
- <div class="actions mb-xl">
- <h5>{{ trans('common.actions') }}</h5>
- <div class="icon-list text-link">
- @if(userCan(\BookStack\Permissions\Permission::BookCreateAll))
- <a href="{{ url("/create-book") }}" data-shortcut="new" class="icon-list-item">
- <span>@icon('add')</span>
- <span>{{ trans('entities.books_create') }}</span>
- </a>
- @endif
-
- @include('entities.view-toggle', ['view' => $view, 'type' => 'books'])
-
- <a href="{{ url('/tags') }}" class="icon-list-item">
- <span>@icon('tag')</span>
- <span>{{ trans('entities.tags_view_tags') }}</span>
- </a>
-
- @if(userCan(\BookStack\Permissions\Permission::ContentImport))
- <a href="{{ url('/import') }}" class="icon-list-item">
- <span>@icon('upload')</span>
- <span>{{ trans('entities.import') }}</span>
- </a>
- @endif
- </div>
- </div>
-
+ @include('books.parts.index-sidebar-section-actions', ['view' => $view])
@stop
diff --git a/resources/views/books/parts/index-sidebar-section-actions.blade.php b/resources/views/books/parts/index-sidebar-section-actions.blade.php
new file mode 100644
index 000000000..8f8b254c8
--- /dev/null
+++ b/resources/views/books/parts/index-sidebar-section-actions.blade.php
@@ -0,0 +1,25 @@
+<div id="actions" class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+ <div class="icon-list text-link">
+ @if(userCan(\BookStack\Permissions\Permission::BookCreateAll))
+ <a href="{{ url("/create-book") }}" data-shortcut="new" class="icon-list-item">
+ <span>@icon('add')</span>
+ <span>{{ trans('entities.books_create') }}</span>
+ </a>
+ @endif
+
+ @include('entities.view-toggle', ['view' => $view, 'type' => 'books'])
+
+ <a href="{{ url('/tags') }}" class="icon-list-item">
+ <span>@icon('tag')</span>
+ <span>{{ trans('entities.tags_view_tags') }}</span>
+ </a>
+
+ @if(userCan(\BookStack\Permissions\Permission::ContentImport))
+ <a href="{{ url('/import') }}" class="icon-list-item">
+ <span>@icon('upload')</span>
+ <span>{{ trans('entities.import') }}</span>
+ </a>
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/books/parts/index-sidebar-section-new.blade.php b/resources/views/books/parts/index-sidebar-section-new.blade.php
new file mode 100644
index 000000000..a9aa52c59
--- /dev/null
+++ b/resources/views/books/parts/index-sidebar-section-new.blade.php
@@ -0,0 +1,8 @@
+<div id="new" class="mb-xl">
+ <h5>{{ trans('entities.books_new') }}</h5>
+ @if(count($new) > 0)
+ @include('entities.list', ['entities' => $new, 'style' => 'compact'])
+ @else
+ <p class="text-muted pb-l mb-none">{{ trans('entities.books_new_empty') }}</p>
+ @endif
+</div>
\ No newline at end of file
diff --git a/resources/views/books/parts/index-sidebar-section-popular.blade.php b/resources/views/books/parts/index-sidebar-section-popular.blade.php
new file mode 100644
index 000000000..030c75eb9
--- /dev/null
+++ b/resources/views/books/parts/index-sidebar-section-popular.blade.php
@@ -0,0 +1,8 @@
+<div id="popular" class="mb-xl">
+ <h5>{{ trans('entities.books_popular') }}</h5>
+ @if(count($popular) > 0)
+ @include('entities.list', ['entities' => $popular, 'style' => 'compact'])
+ @else
+ <p class="text-muted pb-l mb-none">{{ trans('entities.books_popular_empty') }}</p>
+ @endif
+</div>
\ No newline at end of file
diff --git a/resources/views/books/parts/index-sidebar-section-recents.blade.php b/resources/views/books/parts/index-sidebar-section-recents.blade.php
new file mode 100644
index 000000000..f1a68ba4f
--- /dev/null
+++ b/resources/views/books/parts/index-sidebar-section-recents.blade.php
@@ -0,0 +1,6 @@
+@if($recents)
+ <div id="recents" class="mb-xl">
+ <h5>{{ trans('entities.recently_viewed') }}</h5>
+ @include('entities.list', ['entities' => $recents, 'style' => 'compact'])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/books/parts/show-sidebar-section-actions.blade.php b/resources/views/books/parts/show-sidebar-section-actions.blade.php
new file mode 100644
index 000000000..8e5b5c4d7
--- /dev/null
+++ b/resources/views/books/parts/show-sidebar-section-actions.blade.php
@@ -0,0 +1,61 @@
+<div class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+ <div class="icon-list text-link">
+
+ @if(userCan(\BookStack\Permissions\Permission::PageCreate, $book))
+ <a href="{{ $book->getUrl('/create-page') }}" data-shortcut="new" class="icon-list-item">
+ <span>@icon('add')</span>
+ <span>{{ trans('entities.pages_new') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::ChapterCreate, $book))
+ <a href="{{ $book->getUrl('/create-chapter') }}" data-shortcut="new" class="icon-list-item">
+ <span>@icon('add')</span>
+ <span>{{ trans('entities.chapters_new') }}</span>
+ </a>
+ @endif
+
+ <hr class="primary-background">
+
+ @if(userCan(\BookStack\Permissions\Permission::BookUpdate, $book))
+ <a href="{{ $book->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
+ <span>@icon('edit')</span>
+ <span>{{ trans('common.edit') }}</span>
+ </a>
+ <a href="{{ $book->getUrl('/sort') }}" data-shortcut="sort" class="icon-list-item">
+ <span>@icon('sort')</span>
+ <span>{{ trans('common.sort') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::BookCreateAll))
+ <a href="{{ $book->getUrl('/copy') }}" data-shortcut="copy" class="icon-list-item">
+ <span>@icon('copy')</span>
+ <span>{{ trans('common.copy') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
+ <a href="{{ $book->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
+ <span>@icon('lock')</span>
+ <span>{{ trans('entities.permissions') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::BookDelete, $book))
+ <a href="{{ $book->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
+ <span>@icon('delete')</span>
+ <span>{{ trans('common.delete') }}</span>
+ </a>
+ @endif
+
+ <hr class="primary-background">
+
+ @if($watchOptions->canWatch() && !$watchOptions->isWatching())
+ @include('entities.watch-action', ['entity' => $book])
+ @endif
+ @if(!user()->isGuest())
+ @include('entities.favourite-action', ['entity' => $book])
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::ContentExport))
+ @include('entities.export-menu', ['entity' => $book])
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/books/parts/show-sidebar-section-activity.blade.php b/resources/views/books/parts/show-sidebar-section-activity.blade.php
new file mode 100644
index 000000000..c1c5c1d3e
--- /dev/null
+++ b/resources/views/books/parts/show-sidebar-section-activity.blade.php
@@ -0,0 +1,6 @@
+@if(count($activity) > 0)
+ <div id="recent-activity" class="mb-xl">
+ <h5>{{ trans('entities.recent_activity') }}</h5>
+ @include('common.activity-list', ['activity' => $activity])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/books/parts/show-sidebar-section-details.blade.php b/resources/views/books/parts/show-sidebar-section-details.blade.php
new file mode 100644
index 000000000..709d0ffd9
--- /dev/null
+++ b/resources/views/books/parts/show-sidebar-section-details.blade.php
@@ -0,0 +1,21 @@
+<div class="mb-xl">
+ <h5>{{ trans('common.details') }}</h5>
+ <div class="blended-links">
+ @include('entities.meta', ['entity' => $book, 'watchOptions' => $watchOptions])
+ @if($book->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
+ <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.books_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.books_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/books/parts/show-sidebar-section-shelves.blade.php b/resources/views/books/parts/show-sidebar-section-shelves.blade.php
new file mode 100644
index 000000000..9de9b95c6
--- /dev/null
+++ b/resources/views/books/parts/show-sidebar-section-shelves.blade.php
@@ -0,0 +1,6 @@
+@if(count($bookParentShelves) > 0)
+ <div class="actions mb-xl">
+ <h5>{{ trans('entities.shelves') }}</h5>
+ @include('entities.list', ['entities' => $bookParentShelves, 'style' => 'compact'])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/books/parts/show-sidebar-section-tags.blade.php b/resources/views/books/parts/show-sidebar-section-tags.blade.php
new file mode 100644
index 000000000..440a780c8
--- /dev/null
+++ b/resources/views/books/parts/show-sidebar-section-tags.blade.php
@@ -0,0 +1,5 @@
+@if($book->tags->count() > 0)
+ <div class="mb-xl">
+ @include('entities.tag-list', ['entity' => $book])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/books/show.blade.php b/resources/views/books/show.blade.php
index d510c8fd5..4eb83164f 100644
--- a/resources/views/books/show.blade.php
+++ b/resources/views/books/show.blade.php
@@ -67,114 +67,14 @@
@stop
@section('right')
- <div class="mb-xl">
- <h5>{{ trans('common.details') }}</h5>
- <div class="blended-links">
- @include('entities.meta', ['entity' => $book, 'watchOptions' => $watchOptions])
- @if($book->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
- <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.books_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.books_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
- </div>
- </div>
-
- <div class="actions mb-xl">
- <h5>{{ trans('common.actions') }}</h5>
- <div class="icon-list text-link">
-
- @if(userCan(\BookStack\Permissions\Permission::PageCreate, $book))
- <a href="{{ $book->getUrl('/create-page') }}" data-shortcut="new" class="icon-list-item">
- <span>@icon('add')</span>
- <span>{{ trans('entities.pages_new') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::ChapterCreate, $book))
- <a href="{{ $book->getUrl('/create-chapter') }}" data-shortcut="new" class="icon-list-item">
- <span>@icon('add')</span>
- <span>{{ trans('entities.chapters_new') }}</span>
- </a>
- @endif
-
- <hr class="primary-background">
-
- @if(userCan(\BookStack\Permissions\Permission::BookUpdate, $book))
- <a href="{{ $book->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
- <span>@icon('edit')</span>
- <span>{{ trans('common.edit') }}</span>
- </a>
- <a href="{{ $book->getUrl('/sort') }}" data-shortcut="sort" class="icon-list-item">
- <span>@icon('sort')</span>
- <span>{{ trans('common.sort') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::BookCreateAll))
- <a href="{{ $book->getUrl('/copy') }}" data-shortcut="copy" class="icon-list-item">
- <span>@icon('copy')</span>
- <span>{{ trans('common.copy') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
- <a href="{{ $book->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
- <span>@icon('lock')</span>
- <span>{{ trans('entities.permissions') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::BookDelete, $book))
- <a href="{{ $book->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
- <span>@icon('delete')</span>
- <span>{{ trans('common.delete') }}</span>
- </a>
- @endif
-
- <hr class="primary-background">
-
- @if($watchOptions->canWatch() && !$watchOptions->isWatching())
- @include('entities.watch-action', ['entity' => $book])
- @endif
- @if(!user()->isGuest())
- @include('entities.favourite-action', ['entity' => $book])
- @endif
- @if(userCan(\BookStack\Permissions\Permission::ContentExport))
- @include('entities.export-menu', ['entity' => $book])
- @endif
- </div>
- </div>
-
+ @include('books.parts.show-sidebar-section-details', ['book' => $book, 'watchOptions' => $watchOptions])
+ @include('books.parts.show-sidebar-section-actions', ['book' => $book, 'watchOptions' => $watchOptions])
@stop
@section('left')
-
@include('entities.search-form', ['label' => trans('entities.books_search_this')])
-
- @if($book->tags->count() > 0)
- <div class="mb-xl">
- @include('entities.tag-list', ['entity' => $book])
- </div>
- @endif
-
- @if(count($bookParentShelves) > 0)
- <div class="actions mb-xl">
- <h5>{{ trans('entities.shelves') }}</h5>
- @include('entities.list', ['entities' => $bookParentShelves, 'style' => 'compact'])
- </div>
- @endif
-
- @if(count($activity) > 0)
- <div id="recent-activity" class="mb-xl">
- <h5>{{ trans('entities.recent_activity') }}</h5>
- @include('common.activity-list', ['activity' => $activity])
- </div>
- @endif
+ @include('books.parts.show-sidebar-section-tags', ['book' => $book])
+ @include('books.parts.show-sidebar-section-shelves', ['bookParentShelves' => $bookParentShelves])
+ @include('books.parts.show-sidebar-section-activity', ['activity' => $activity])
@stop
diff --git a/resources/views/chapters/parts/show-sidebar-section-actions.blade.php b/resources/views/chapters/parts/show-sidebar-section-actions.blade.php
new file mode 100644
index 000000000..55df999a2
--- /dev/null
+++ b/resources/views/chapters/parts/show-sidebar-section-actions.blade.php
@@ -0,0 +1,65 @@
+<div class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+ <div class="icon-list text-link">
+
+ @if(userCan(\BookStack\Permissions\Permission::PageCreate, $chapter))
+ <a href="{{ $chapter->getUrl('/create-page') }}" data-shortcut="new" class="icon-list-item">
+ <span>@icon('add')</span>
+ <span>{{ trans('entities.pages_new') }}</span>
+ </a>
+ @endif
+
+ <hr class="primary-background"/>
+
+ @if(userCan(\BookStack\Permissions\Permission::ChapterUpdate, $chapter))
+ <a href="{{ $chapter->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
+ <span>@icon('edit')</span>
+ <span>{{ trans('common.edit') }}</span>
+ </a>
+ @endif
+ @if(userCanOnAny(\BookStack\Permissions\Permission::Create, \BookStack\Entities\Models\Book::class) || userCan(\BookStack\Permissions\Permission::ChapterCreateAll) || userCan(\BookStack\Permissions\Permission::ChapterCreateOwn))
+ <a href="{{ $chapter->getUrl('/copy') }}" data-shortcut="copy" class="icon-list-item">
+ <span>@icon('copy')</span>
+ <span>{{ trans('common.copy') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::ChapterUpdate, $chapter) && userCan(\BookStack\Permissions\Permission::ChapterDelete, $chapter))
+ <a href="{{ $chapter->getUrl('/move') }}" data-shortcut="move" class="icon-list-item">
+ <span>@icon('folder')</span>
+ <span>{{ trans('common.move') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $chapter))
+ <a href="{{ $chapter->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
+ <span>@icon('lock')</span>
+ <span>{{ trans('entities.permissions') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::ChapterDelete, $chapter))
+ <a href="{{ $chapter->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
+ <span>@icon('delete')</span>
+ <span>{{ trans('common.delete') }}</span>
+ </a>
+ @endif
+
+ @if($chapter->book && userCan(\BookStack\Permissions\Permission::BookUpdate, $chapter->book))
+ <hr class="primary-background"/>
+ <a href="{{ $chapter->book->getUrl('/sort') }}" data-shortcut="sort" class="icon-list-item">
+ <span>@icon('sort')</span>
+ <span>{{ trans('entities.chapter_sort_book') }}</span>
+ </a>
+ @endif
+
+ <hr class="primary-background"/>
+
+ @if($watchOptions->canWatch() && !$watchOptions->isWatching())
+ @include('entities.watch-action', ['entity' => $chapter])
+ @endif
+ @if(!user()->isGuest())
+ @include('entities.favourite-action', ['entity' => $chapter])
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::ContentExport))
+ @include('entities.export-menu', ['entity' => $chapter])
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/chapters/parts/show-sidebar-section-details.blade.php b/resources/views/chapters/parts/show-sidebar-section-details.blade.php
new file mode 100644
index 000000000..a424b8d3f
--- /dev/null
+++ b/resources/views/chapters/parts/show-sidebar-section-details.blade.php
@@ -0,0 +1,38 @@
+<div class="mb-xl">
+ <h5>{{ trans('common.details') }}</h5>
+ <div class="blended-links">
+ @include('entities.meta', ['entity' => $chapter, 'watchOptions' => $watchOptions])
+
+ @if($book->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
+ <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.books_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.books_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+
+ @if($chapter->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $chapter))
+ <a href="{{ $chapter->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.chapters_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.chapters_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/chapters/parts/show-sidebar-section-tags.blade.php b/resources/views/chapters/parts/show-sidebar-section-tags.blade.php
new file mode 100644
index 000000000..d28ff6383
--- /dev/null
+++ b/resources/views/chapters/parts/show-sidebar-section-tags.blade.php
@@ -0,0 +1,5 @@
+@if($chapter->tags->count() > 0)
+ <div class="mb-xl">
+ @include('entities.tag-list', ['entity' => $chapter])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/chapters/show.blade.php b/resources/views/chapters/show.blade.php
index 585bf8a3b..7ef877661 100644
--- a/resources/views/chapters/show.blade.php
+++ b/resources/views/chapters/show.blade.php
@@ -63,123 +63,13 @@
@stop
@section('right')
-
- <div class="mb-xl">
- <h5>{{ trans('common.details') }}</h5>
- <div class="blended-links">
- @include('entities.meta', ['entity' => $chapter, 'watchOptions' => $watchOptions])
-
- @if($book->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
- <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.books_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.books_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
-
- @if($chapter->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $chapter))
- <a href="{{ $chapter->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.chapters_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.chapters_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
- </div>
- </div>
-
- <div class="actions mb-xl">
- <h5>{{ trans('common.actions') }}</h5>
- <div class="icon-list text-link">
-
- @if(userCan(\BookStack\Permissions\Permission::PageCreate, $chapter))
- <a href="{{ $chapter->getUrl('/create-page') }}" data-shortcut="new" class="icon-list-item">
- <span>@icon('add')</span>
- <span>{{ trans('entities.pages_new') }}</span>
- </a>
- @endif
-
- <hr class="primary-background"/>
-
- @if(userCan(\BookStack\Permissions\Permission::ChapterUpdate, $chapter))
- <a href="{{ $chapter->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
- <span>@icon('edit')</span>
- <span>{{ trans('common.edit') }}</span>
- </a>
- @endif
- @if(userCanOnAny(\BookStack\Permissions\Permission::Create, \BookStack\Entities\Models\Book::class) || userCan(\BookStack\Permissions\Permission::ChapterCreateAll) || userCan(\BookStack\Permissions\Permission::ChapterCreateOwn))
- <a href="{{ $chapter->getUrl('/copy') }}" data-shortcut="copy" class="icon-list-item">
- <span>@icon('copy')</span>
- <span>{{ trans('common.copy') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::ChapterUpdate, $chapter) && userCan(\BookStack\Permissions\Permission::ChapterDelete, $chapter))
- <a href="{{ $chapter->getUrl('/move') }}" data-shortcut="move" class="icon-list-item">
- <span>@icon('folder')</span>
- <span>{{ trans('common.move') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $chapter))
- <a href="{{ $chapter->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
- <span>@icon('lock')</span>
- <span>{{ trans('entities.permissions') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::ChapterDelete, $chapter))
- <a href="{{ $chapter->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
- <span>@icon('delete')</span>
- <span>{{ trans('common.delete') }}</span>
- </a>
- @endif
-
- @if($chapter->book && userCan(\BookStack\Permissions\Permission::BookUpdate, $chapter->book))
- <hr class="primary-background"/>
- <a href="{{ $chapter->book->getUrl('/sort') }}" data-shortcut="sort" class="icon-list-item">
- <span>@icon('sort')</span>
- <span>{{ trans('entities.chapter_sort_book') }}</span>
- </a>
- @endif
-
- <hr class="primary-background"/>
-
- @if($watchOptions->canWatch() && !$watchOptions->isWatching())
- @include('entities.watch-action', ['entity' => $chapter])
- @endif
- @if(!user()->isGuest())
- @include('entities.favourite-action', ['entity' => $chapter])
- @endif
- @if(userCan(\BookStack\Permissions\Permission::ContentExport))
- @include('entities.export-menu', ['entity' => $chapter])
- @endif
- </div>
- </div>
+ @include('chapters.parts.show-sidebar-section-details', ['chapter' => $chapter, 'book' => $book, 'watchOptions' => $watchOptions])
+ @include('chapters.parts.show-sidebar-section-actions', ['chapter' => $chapter, 'watchOptions' => $watchOptions])
@stop
@section('left')
-
@include('entities.search-form', ['label' => trans('entities.chapters_search_this')])
-
- @if($chapter->tags->count() > 0)
- <div class="mb-xl">
- @include('entities.tag-list', ['entity' => $chapter])
- </div>
- @endif
-
+ @include('chapters.parts.show-sidebar-section-tags', ['chapter' => $chapter])
@include('entities.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
@stop
diff --git a/resources/views/pages/parts/show-sidebar-section-actions.blade.php b/resources/views/pages/parts/show-sidebar-section-actions.blade.php
new file mode 100644
index 000000000..ae115b69e
--- /dev/null
+++ b/resources/views/pages/parts/show-sidebar-section-actions.blade.php
@@ -0,0 +1,57 @@
+<div id="actions" class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+
+ <div class="icon-list text-link">
+
+ {{--User Actions--}}
+ @if(userCan(\BookStack\Permissions\Permission::PageUpdate, $page))
+ <a href="{{ $page->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
+ <span>@icon('edit')</span>
+ <span>{{ trans('common.edit') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::PageCreateAll) || userCan(\BookStack\Permissions\Permission::PageCreateOwn) || userCanOnAny(\BookStack\Permissions\Permission::Create, \BookStack\Entities\Models\Book::class) || userCanOnAny(\BookStack\Permissions\Permission::Create, \BookStack\Entities\Models\Chapter::class))
+ <a href="{{ $page->getUrl('/copy') }}" data-shortcut="copy" class="icon-list-item">
+ <span>@icon('copy')</span>
+ <span>{{ trans('common.copy') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::PageUpdate, $page))
+ @if(userCan(\BookStack\Permissions\Permission::PageDelete, $page))
+ <a href="{{ $page->getUrl('/move') }}" data-shortcut="move" class="icon-list-item">
+ <span>@icon('folder')</span>
+ <span>{{ trans('common.move') }}</span>
+ </a>
+ @endif
+ @endif
+ <a href="{{ $page->getUrl('/revisions') }}" data-shortcut="revisions" class="icon-list-item">
+ <span>@icon('history')</span>
+ <span>{{ trans('entities.revisions') }}</span>
+ </a>
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $page))
+ <a href="{{ $page->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
+ <span>@icon('lock')</span>
+ <span>{{ trans('entities.permissions') }}</span>
+ </a>
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::PageDelete, $page))
+ <a href="{{ $page->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
+ <span>@icon('delete')</span>
+ <span>{{ trans('common.delete') }}</span>
+ </a>
+ @endif
+
+ <hr class="primary-background"/>
+
+ @if($watchOptions->canWatch() && !$watchOptions->isWatching())
+ @include('entities.watch-action', ['entity' => $page])
+ @endif
+ @if(!user()->isGuest())
+ @include('entities.favourite-action', ['entity' => $page])
+ @endif
+ @if(userCan(\BookStack\Permissions\Permission::ContentExport))
+ @include('entities.export-menu', ['entity' => $page])
+ @endif
+ </div>
+
+</div>
\ No newline at end of file
diff --git a/resources/views/pages/parts/show-sidebar-section-attachments.blade.php b/resources/views/pages/parts/show-sidebar-section-attachments.blade.php
new file mode 100644
index 000000000..975724015
--- /dev/null
+++ b/resources/views/pages/parts/show-sidebar-section-attachments.blade.php
@@ -0,0 +1,8 @@
+@if($page->attachments->count() > 0)
+ <div id="page-attachments" class="mb-l">
+ <h5>{{ trans('entities.pages_attachments') }}</h5>
+ <div class="body">
+ @include('attachments.list', ['attachments' => $page->attachments])
+ </div>
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/pages/parts/show-sidebar-section-details.blade.php b/resources/views/pages/parts/show-sidebar-section-details.blade.php
new file mode 100644
index 000000000..391f30ce4
--- /dev/null
+++ b/resources/views/pages/parts/show-sidebar-section-details.blade.php
@@ -0,0 +1,61 @@
+<div id="page-details" class="entity-details mb-xl">
+ <h5>{{ trans('common.details') }}</h5>
+ <div class="blended-links">
+ @include('entities.meta', ['entity' => $page, 'watchOptions' => $watchOptions])
+
+ @if($book->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
+ <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.books_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.books_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+
+ @if($page->chapter && $page->chapter->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $page->chapter))
+ <a href="{{ $page->chapter->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.chapters_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.chapters_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+
+ @if($page->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $page))
+ <a href="{{ $page->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.pages_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.pages_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+
+ @if($page->template)
+ <div class="entity-meta-item">
+ @icon('template')
+ <div>{{ trans('entities.pages_is_template') }}</div>
+ </div>
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/pages/parts/show-sidebar-section-page-nav.blade.php b/resources/views/pages/parts/show-sidebar-section-page-nav.blade.php
new file mode 100644
index 000000000..88db87e64
--- /dev/null
+++ b/resources/views/pages/parts/show-sidebar-section-page-nav.blade.php
@@ -0,0 +1,15 @@
+@if(isset($pageNav) && count($pageNav))
+ <nav id="page-navigation" class="mb-xl" aria-label="{{ trans('entities.pages_navigation') }}">
+ <h5>{{ trans('entities.pages_navigation') }}</h5>
+ <div class="body">
+ <div class="sidebar-page-nav menu">
+ @foreach($pageNav as $navItem)
+ <li class="page-nav-item h{{ $navItem['level'] }}">
+ <a href="{{ $navItem['link'] }}" class="text-limit-lines-1 block">{{ $navItem['text'] }}</a>
+ <div class="link-background sidebar-page-nav-bullet"></div>
+ </li>
+ @endforeach
+ </div>
+ </div>
+ </nav>
+@endif
\ No newline at end of file
diff --git a/resources/views/pages/parts/show-sidebar-section-tags.blade.php b/resources/views/pages/parts/show-sidebar-section-tags.blade.php
new file mode 100644
index 000000000..354da627c
--- /dev/null
+++ b/resources/views/pages/parts/show-sidebar-section-tags.blade.php
@@ -0,0 +1,5 @@
+@if($page->tags->count() > 0)
+ <section>
+ @include('entities.tag-list', ['entity' => $page])
+ </section>
+@endif
\ No newline at end of file
diff --git a/resources/views/pages/show.blade.php b/resources/views/pages/show.blade.php
index 3338646a5..d34bfc6ae 100644
--- a/resources/views/pages/show.blade.php
+++ b/resources/views/pages/show.blade.php
@@ -36,159 +36,13 @@
@stop
@section('left')
-
- @if($page->tags->count() > 0)
- <section>
- @include('entities.tag-list', ['entity' => $page])
- </section>
- @endif
-
- @if ($page->attachments->count() > 0)
- <div id="page-attachments" class="mb-l">
- <h5>{{ trans('entities.pages_attachments') }}</h5>
- <div class="body">
- @include('attachments.list', ['attachments' => $page->attachments])
- </div>
- </div>
- @endif
-
- @if (isset($pageNav) && count($pageNav))
- <nav id="page-navigation" class="mb-xl" aria-label="{{ trans('entities.pages_navigation') }}">
- <h5>{{ trans('entities.pages_navigation') }}</h5>
- <div class="body">
- <div class="sidebar-page-nav menu">
- @foreach($pageNav as $navItem)
- <li class="page-nav-item h{{ $navItem['level'] }}">
- <a href="{{ $navItem['link'] }}" class="text-limit-lines-1 block">{{ $navItem['text'] }}</a>
- <div class="link-background sidebar-page-nav-bullet"></div>
- </li>
- @endforeach
- </div>
- </div>
- </nav>
- @endif
-
+ @include('pages.parts.show-sidebar-section-tags', ['page' => $page])
+ @include('pages.parts.show-sidebar-section-attachments', ['page' => $page])
+ @include('pages.parts.show-sidebar-section-page-nav', ['pageNav' => $pageNav])
@include('entities.book-tree', ['book' => $book, 'sidebarTree' => $sidebarTree])
@stop
@section('right')
- <div id="page-details" class="entity-details mb-xl">
- <h5>{{ trans('common.details') }}</h5>
- <div class="blended-links">
- @include('entities.meta', ['entity' => $page, 'watchOptions' => $watchOptions])
-
- @if($book->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $book))
- <a href="{{ $book->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.books_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.books_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
-
- @if($page->chapter && $page->chapter->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $page->chapter))
- <a href="{{ $page->chapter->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.chapters_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.chapters_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
-
- @if($page->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $page))
- <a href="{{ $page->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.pages_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.pages_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
-
- @if($page->template)
- <div class="entity-meta-item">
- @icon('template')
- <div>{{ trans('entities.pages_is_template') }}</div>
- </div>
- @endif
- </div>
- </div>
-
- <div class="actions mb-xl">
- <h5>{{ trans('common.actions') }}</h5>
-
- <div class="icon-list text-link">
-
- {{--User Actions--}}
- @if(userCan(\BookStack\Permissions\Permission::PageUpdate, $page))
- <a href="{{ $page->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
- <span>@icon('edit')</span>
- <span>{{ trans('common.edit') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::PageCreateAll) || userCan(\BookStack\Permissions\Permission::PageCreateOwn) || userCanOnAny(\BookStack\Permissions\Permission::Create, \BookStack\Entities\Models\Book::class) || userCanOnAny(\BookStack\Permissions\Permission::Create, \BookStack\Entities\Models\Chapter::class))
- <a href="{{ $page->getUrl('/copy') }}" data-shortcut="copy" class="icon-list-item">
- <span>@icon('copy')</span>
- <span>{{ trans('common.copy') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::PageUpdate, $page))
- @if(userCan(\BookStack\Permissions\Permission::PageDelete, $page))
- <a href="{{ $page->getUrl('/move') }}" data-shortcut="move" class="icon-list-item">
- <span>@icon('folder')</span>
- <span>{{ trans('common.move') }}</span>
- </a>
- @endif
- @endif
- <a href="{{ $page->getUrl('/revisions') }}" data-shortcut="revisions" class="icon-list-item">
- <span>@icon('history')</span>
- <span>{{ trans('entities.revisions') }}</span>
- </a>
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $page))
- <a href="{{ $page->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
- <span>@icon('lock')</span>
- <span>{{ trans('entities.permissions') }}</span>
- </a>
- @endif
- @if(userCan(\BookStack\Permissions\Permission::PageDelete, $page))
- <a href="{{ $page->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
- <span>@icon('delete')</span>
- <span>{{ trans('common.delete') }}</span>
- </a>
- @endif
-
- <hr class="primary-background"/>
-
- @if($watchOptions->canWatch() && !$watchOptions->isWatching())
- @include('entities.watch-action', ['entity' => $page])
- @endif
- @if(!user()->isGuest())
- @include('entities.favourite-action', ['entity' => $page])
- @endif
- @if(userCan(\BookStack\Permissions\Permission::ContentExport))
- @include('entities.export-menu', ['entity' => $page])
- @endif
- </div>
-
- </div>
+ @include('pages.parts.show-sidebar-section-details', ['page' => $page, 'watchOptions' => $watchOptions, 'book' => $book])
+ @include('pages.parts.show-sidebar-section-actions', ['page' => $page, 'watchOptions' => $watchOptions])
@stop
diff --git a/resources/views/shelves/index.blade.php b/resources/views/shelves/index.blade.php
index bb7c57e0f..70357068d 100644
--- a/resources/views/shelves/index.blade.php
+++ b/resources/views/shelves/index.blade.php
@@ -5,51 +5,11 @@
@stop
@section('right')
-
- <div class="actions mb-xl">
- <h5>{{ trans('common.actions') }}</h5>
- <div class="icon-list text-link">
- @if(userCan(\BookStack\Permissions\Permission::BookshelfCreateAll))
- <a href="{{ url("/create-shelf") }}" data-shortcut="new" class="icon-list-item">
- <span>@icon('add')</span>
- <span>{{ trans('entities.shelves_new_action') }}</span>
- </a>
- @endif
-
- @include('entities.view-toggle', ['view' => $view, 'type' => 'bookshelves'])
-
- <a href="{{ url('/tags') }}" class="icon-list-item">
- <span>@icon('tag')</span>
- <span>{{ trans('entities.tags_view_tags') }}</span>
- </a>
- </div>
- </div>
-
+ @include('shelves.parts.index-sidebar-section-actions', ['view' => $view])
@stop
@section('left')
- @if($recents)
- <div id="recents" class="mb-xl">
- <h5>{{ trans('entities.recently_viewed') }}</h5>
- @include('entities.list', ['entities' => $recents, 'style' => 'compact'])
- </div>
- @endif
-
- <div id="popular" class="mb-xl">
- <h5>{{ trans('entities.shelves_popular') }}</h5>
- @if(count($popular) > 0)
- @include('entities.list', ['entities' => $popular, 'style' => 'compact'])
- @else
- <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_popular_empty') }}</p>
- @endif
- </div>
-
- <div id="new" class="mb-xl">
- <h5>{{ trans('entities.shelves_new') }}</h5>
- @if(count($new) > 0)
- @include('entities.list', ['entities' => $new, 'style' => 'compact'])
- @else
- <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_new_empty') }}</p>
- @endif
- </div>
+ @include('shelves.parts.index-sidebar-section-recents', ['recents' => $recents])
+ @include('shelves.parts.index-sidebar-section-popular', ['popular' => $popular])
+ @include('shelves.parts.index-sidebar-section-new', ['new' => $new])
@stop
\ No newline at end of file
diff --git a/resources/views/shelves/parts/index-sidebar-section-actions.blade.php b/resources/views/shelves/parts/index-sidebar-section-actions.blade.php
new file mode 100644
index 000000000..d5cdb4056
--- /dev/null
+++ b/resources/views/shelves/parts/index-sidebar-section-actions.blade.php
@@ -0,0 +1,18 @@
+<div id="actions" class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+ <div class="icon-list text-link">
+ @if(userCan(\BookStack\Permissions\Permission::BookshelfCreateAll))
+ <a href="{{ url("/create-shelf") }}" data-shortcut="new" class="icon-list-item">
+ <span>@icon('add')</span>
+ <span>{{ trans('entities.shelves_new_action') }}</span>
+ </a>
+ @endif
+
+ @include('entities.view-toggle', ['view' => $view, 'type' => 'bookshelves'])
+
+ <a href="{{ url('/tags') }}" class="icon-list-item">
+ <span>@icon('tag')</span>
+ <span>{{ trans('entities.tags_view_tags') }}</span>
+ </a>
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/shelves/parts/index-sidebar-section-new.blade.php b/resources/views/shelves/parts/index-sidebar-section-new.blade.php
new file mode 100644
index 000000000..602f60ebe
--- /dev/null
+++ b/resources/views/shelves/parts/index-sidebar-section-new.blade.php
@@ -0,0 +1,8 @@
+<div id="new" class="mb-xl">
+ <h5>{{ trans('entities.shelves_new') }}</h5>
+ @if(count($new) > 0)
+ @include('entities.list', ['entities' => $new, 'style' => 'compact'])
+ @else
+ <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_new_empty') }}</p>
+ @endif
+</div>
\ No newline at end of file
diff --git a/resources/views/shelves/parts/index-sidebar-section-popular.blade.php b/resources/views/shelves/parts/index-sidebar-section-popular.blade.php
new file mode 100644
index 000000000..956321c5e
--- /dev/null
+++ b/resources/views/shelves/parts/index-sidebar-section-popular.blade.php
@@ -0,0 +1,8 @@
+<div id="popular" class="mb-xl">
+ <h5>{{ trans('entities.shelves_popular') }}</h5>
+ @if(count($popular) > 0)
+ @include('entities.list', ['entities' => $popular, 'style' => 'compact'])
+ @else
+ <p class="text-muted pb-l mb-none">{{ trans('entities.shelves_popular_empty') }}</p>
+ @endif
+</div>
\ No newline at end of file
diff --git a/resources/views/shelves/parts/index-sidebar-section-recents.blade.php b/resources/views/shelves/parts/index-sidebar-section-recents.blade.php
new file mode 100644
index 000000000..f1a68ba4f
--- /dev/null
+++ b/resources/views/shelves/parts/index-sidebar-section-recents.blade.php
@@ -0,0 +1,6 @@
+@if($recents)
+ <div id="recents" class="mb-xl">
+ <h5>{{ trans('entities.recently_viewed') }}</h5>
+ @include('entities.list', ['entities' => $recents, 'style' => 'compact'])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/shelves/parts/show-sidebar-section-actions.blade.php b/resources/views/shelves/parts/show-sidebar-section-actions.blade.php
new file mode 100644
index 000000000..ba92e5f70
--- /dev/null
+++ b/resources/views/shelves/parts/show-sidebar-section-actions.blade.php
@@ -0,0 +1,43 @@
+<div id="actions" class="actions mb-xl">
+ <h5>{{ trans('common.actions') }}</h5>
+ <div class="icon-list text-link">
+
+ @if(userCan(\BookStack\Permissions\Permission::BookCreateAll) && userCan(\BookStack\Permissions\Permission::BookshelfUpdate, $shelf))
+ <a href="{{ $shelf->getUrl('/create-book') }}" data-shortcut="new" class="icon-list-item">
+ <span class="icon">@icon('add')</span>
+ <span>{{ trans('entities.books_new_action') }}</span>
+ </a>
+ @endif
+
+ @include('entities.view-toggle', ['view' => $view, 'type' => 'bookshelf'])
+
+ <hr class="primary-background">
+
+ @if(userCan(\BookStack\Permissions\Permission::BookshelfUpdate, $shelf))
+ <a href="{{ $shelf->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
+ <span>@icon('edit')</span>
+ <span>{{ trans('common.edit') }}</span>
+ </a>
+ @endif
+
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $shelf))
+ <a href="{{ $shelf->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
+ <span>@icon('lock')</span>
+ <span>{{ trans('entities.permissions') }}</span>
+ </a>
+ @endif
+
+ @if(userCan(\BookStack\Permissions\Permission::BookshelfDelete, $shelf))
+ <a href="{{ $shelf->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
+ <span>@icon('delete')</span>
+ <span>{{ trans('common.delete') }}</span>
+ </a>
+ @endif
+
+ @if(!user()->isGuest())
+ <hr class="primary-background">
+ @include('entities.favourite-action', ['entity' => $shelf])
+ @endif
+
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/shelves/parts/show-sidebar-section-activity.blade.php b/resources/views/shelves/parts/show-sidebar-section-activity.blade.php
new file mode 100644
index 000000000..c1c5c1d3e
--- /dev/null
+++ b/resources/views/shelves/parts/show-sidebar-section-activity.blade.php
@@ -0,0 +1,6 @@
+@if(count($activity) > 0)
+ <div id="recent-activity" class="mb-xl">
+ <h5>{{ trans('entities.recent_activity') }}</h5>
+ @include('common.activity-list', ['activity' => $activity])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/shelves/parts/show-sidebar-section-details.blade.php b/resources/views/shelves/parts/show-sidebar-section-details.blade.php
new file mode 100644
index 000000000..8933cc419
--- /dev/null
+++ b/resources/views/shelves/parts/show-sidebar-section-details.blade.php
@@ -0,0 +1,21 @@
+<div id="details" class="mb-xl">
+ <h5>{{ trans('common.details') }}</h5>
+ <div class="blended-links">
+ @include('entities.meta', ['entity' => $shelf, 'watchOptions' => null])
+ @if($shelf->hasPermissions())
+ <div class="active-restriction">
+ @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $shelf))
+ <a href="{{ $shelf->getUrl('/permissions') }}" class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.shelves_permissions_active') }}</div>
+ </a>
+ @else
+ <div class="entity-meta-item">
+ @icon('lock')
+ <div>{{ trans('entities.shelves_permissions_active') }}</div>
+ </div>
+ @endif
+ </div>
+ @endif
+ </div>
+</div>
\ No newline at end of file
diff --git a/resources/views/shelves/parts/show-sidebar-section-tags.blade.php b/resources/views/shelves/parts/show-sidebar-section-tags.blade.php
new file mode 100644
index 000000000..265d61cd0
--- /dev/null
+++ b/resources/views/shelves/parts/show-sidebar-section-tags.blade.php
@@ -0,0 +1,5 @@
+@if($shelf->tags->count() > 0)
+ <div id="tags" class="mb-xl">
+ @include('entities.tag-list', ['entity' => $shelf])
+ </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/shelves/show.blade.php b/resources/views/shelves/show.blade.php
index 9ee14f1bf..9d07e5da0 100644
--- a/resources/views/shelves/show.blade.php
+++ b/resources/views/shelves/show.blade.php
@@ -69,87 +69,13 @@
@stop
@section('left')
-
- @if($shelf->tags->count() > 0)
- <div id="tags" class="mb-xl">
- @include('entities.tag-list', ['entity' => $shelf])
- </div>
- @endif
-
- <div id="details" class="mb-xl">
- <h5>{{ trans('common.details') }}</h5>
- <div class="blended-links">
- @include('entities.meta', ['entity' => $shelf, 'watchOptions' => null])
- @if($shelf->hasPermissions())
- <div class="active-restriction">
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $shelf))
- <a href="{{ $shelf->getUrl('/permissions') }}" class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.shelves_permissions_active') }}</div>
- </a>
- @else
- <div class="entity-meta-item">
- @icon('lock')
- <div>{{ trans('entities.shelves_permissions_active') }}</div>
- </div>
- @endif
- </div>
- @endif
- </div>
- </div>
-
- @if(count($activity) > 0)
- <div id="recent-activity" class="mb-xl">
- <h5>{{ trans('entities.recent_activity') }}</h5>
- @include('common.activity-list', ['activity' => $activity])
- </div>
- @endif
+ @include('shelves.parts.show-sidebar-section-tags', ['shelf' => $shelf])
+ @include('shelves.parts.show-sidebar-section-details', ['shelf' => $shelf])
+ @include('shelves.parts.show-sidebar-section-activity', ['activity' => $activity])
@stop
@section('right')
- <div class="actions mb-xl">
- <h5>{{ trans('common.actions') }}</h5>
- <div class="icon-list text-link">
-
- @if(userCan(\BookStack\Permissions\Permission::BookCreateAll) && userCan(\BookStack\Permissions\Permission::BookshelfUpdate, $shelf))
- <a href="{{ $shelf->getUrl('/create-book') }}" data-shortcut="new" class="icon-list-item">
- <span class="icon">@icon('add')</span>
- <span>{{ trans('entities.books_new_action') }}</span>
- </a>
- @endif
-
- @include('entities.view-toggle', ['view' => $view, 'type' => 'bookshelf'])
-
- <hr class="primary-background">
-
- @if(userCan(\BookStack\Permissions\Permission::BookshelfUpdate, $shelf))
- <a href="{{ $shelf->getUrl('/edit') }}" data-shortcut="edit" class="icon-list-item">
- <span>@icon('edit')</span>
- <span>{{ trans('common.edit') }}</span>
- </a>
- @endif
-
- @if(userCan(\BookStack\Permissions\Permission::RestrictionsManage, $shelf))
- <a href="{{ $shelf->getUrl('/permissions') }}" data-shortcut="permissions" class="icon-list-item">
- <span>@icon('lock')</span>
- <span>{{ trans('entities.permissions') }}</span>
- </a>
- @endif
-
- @if(userCan(\BookStack\Permissions\Permission::BookshelfDelete, $shelf))
- <a href="{{ $shelf->getUrl('/delete') }}" data-shortcut="delete" class="icon-list-item">
- <span>@icon('delete')</span>
- <span>{{ trans('common.delete') }}</span>
- </a>
- @endif
-
- @if(!user()->isGuest())
- <hr class="primary-background">
- @include('entities.favourite-action', ['entity' => $shelf])
- @endif
-
- </div>
- </div>
+ @include('shelves.parts.show-sidebar-section-actions', ['shelf' => $shelf, 'view' => $view])
@stop