]> BookStack Code Mirror - bookstack/blobdiff - resources/views/chapters/show.blade.php
Added restriction tests and fixed any bugs in the process
[bookstack] / resources / views / chapters / show.blade.php
index ac36a6b3ee6d3a04d5b3faa34b15df61d6974e53..f053edc1c68e39d0441c2f0764802ed347ac3050 100644 (file)
                 <h1>{{ $chapter->name }}</h1>
                 <p class="text-muted">{{ $chapter->description }}</p>
 
-                @if(count($chapter->pages) > 0)
+                @if(count($pages) > 0)
                     <div class="page-list">
                         <hr>
-                        @foreach($chapter->pages as $page)
+                        @foreach($pages as $page)
                             @include('pages/list-item', ['page' => $page])
                             <hr>
                         @endforeach
                 </p>
             </div>
             <div class="col-md-3 col-md-offset-1">
+                <div class="margin-top large"></div>
+                @if($book->restricted || $chapter->restricted)
+                    <div class="text-muted">
+
+                        @if($book->restricted)
+                            @if(userCan('restrictions-manage', $book))
+                                <a href="{{ $book->getUrl() }}/restrict"><i class="zmdi zmdi-lock-outline"></i>Book Restricted</a>
+                            @else
+                                <i class="zmdi zmdi-lock-outline"></i>Book Restricted
+                            @endif
+                                <br>
+                        @endif
+
+                        @if($chapter->restricted)
+                            @if(userCan('restrictions-manage', $chapter))
+                                <a href="{{ $chapter->getUrl() }}/restrict"><i class="zmdi zmdi-lock-outline"></i>Chapter Restricted</a>
+                            @else
+                                <i class="zmdi zmdi-lock-outline"></i>Chapter Restricted
+                            @endif
+                        @endif
+                    </div>
+                @endif
+
                 @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree])
             </div>
         </div>