1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Prevent empty-state actions visible without permission.

Fixes #411
This commit is contained in:
Dan Brown
2017-07-02 15:59:40 +01:00
parent cbff801aec
commit 4db2c274e2
3 changed files with 35 additions and 0 deletions

View File

@@ -72,9 +72,15 @@
@else
<p class="text-muted">{{ trans('entities.books_empty_contents') }}</p>
<p>
@if(userCan('page-create', $book))
<a href="{{ $book->getUrl('/page/create') }}" class="text-page"><i class="zmdi zmdi-file-text"></i>{{ trans('entities.books_empty_create_page') }}</a>
@endif
@if(userCan('page-create', $book) && userCan('chapter-create', $book))
&nbsp;&nbsp;<em class="text-muted">-{{ trans('entities.books_empty_or') }}-</em>&nbsp;&nbsp;&nbsp;
@endif
@if(userCan('chapter-create', $book))
<a href="{{ $book->getUrl('/chapter/create') }}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>{{ trans('entities.books_empty_add_chapter') }}</a>
@endif
</p>
<hr>
@endif