]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Fixes #45
[bookstack] / resources / views / books / show.blade.php
1 @extends('base')
2
3 @section('content')
4
5     <div class="faded-small" ng-non-bindable>
6         <div class="container">
7             <div class="row">
8                 <div class="col-md-12">
9                     <div class="action-buttons faded">
10                         @if($currentUser->can('page-create'))
11                             <a href="{{$book->getUrl() . '/page/create'}}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i> New Page</a>
12                         @endif
13                         @if($currentUser->can('chapter-create'))
14                             <a href="{{$book->getUrl() . '/chapter/create'}}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i> New Chapter</a>
15                         @endif
16                         @if($currentUser->can('book-update'))
17                             <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>Edit</a>
18                             <a href="{{ $book->getUrl() }}/sort" class="text-primary text-button"><i class="zmdi zmdi-sort"></i>Sort</a>
19                         @endif
20                         @if($currentUser->can('book-delete'))
21                             <a href="{{ $book->getUrl() }}/delete" class="text-neg text-button"><i class="zmdi zmdi-delete"></i>Delete</a>
22                         @endif
23                     </div>
24                 </div>
25             </div>
26         </div>
27     </div>
28
29
30     <div class="container" id="book-dashboard" ng-controller="BookShowController" book-id="{{ $book->id }}">
31         <div class="row">
32             <div class="col-md-7">
33
34                 <h1>{{$book->name}}</h1>
35                 <div class="book-content" ng-show="!searching">
36                     <p class="text-muted" ng-non-bindable>{{$book->description}}</p>
37
38                     <div class="page-list" ng-non-bindable>
39                         <hr>
40                         @if(count($bookChildren) > 0)
41                             @foreach($bookChildren as $childElement)
42                                 @if($childElement->isA('chapter'))
43                                     @include('chapters/list-item', ['chapter' => $childElement])
44                                 @else
45                                     @include('pages/list-item', ['page' => $childElement])
46                                 @endif
47                                 <hr>
48                             @endforeach
49                         @else
50                             <p class="text-muted">No pages or chapters have been created for this book.</p>
51                             <p>
52                                 <a href="{{$book->getUrl() . '/page/create'}}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
53                                 &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp;
54                                 <a href="{{$book->getUrl() . '/chapter/create'}}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>Add a chapter</a>
55                             </p>
56                             <hr>
57                         @endif
58                         <p class="text-muted small">
59                             Created {{$book->created_at->diffForHumans()}} @if($book->createdBy) by {{$book->createdBy->name}} @endif
60                             <br>
61                             Last Updated {{$book->updated_at->diffForHumans()}} @if($book->updatedBy) by {{$book->updatedBy->name}} @endif
62                         </p>
63                     </div>
64                 </div>
65                 <div class="search-results" ng-cloak ng-show="searching">
66                     <h3 class="text-muted">Search Results <a ng-if="searching" ng-click="clearSearch()" class="text-small"><i class="zmdi zmdi-close"></i>Clear Search</a></h3>
67                     <div ng-if="!searchResults">
68                         @include('partials/loading-icon')
69                     </div>
70                     <div ng-bind-html="searchResults"></div>
71                 </div>
72
73
74             </div>
75
76             <div class="col-md-4 col-md-offset-1">
77                 <div class="margin-top large"></div>
78                 <div class="search-box">
79                     <form ng-submit="searchBook($event)">
80                         <input ng-model="searchTerm" ng-change="checkSearchForm()" type="text" name="term" placeholder="Search This Book">
81                         <button type="submit"><i class="zmdi zmdi-search"></i></button>
82                         <button ng-if="searching" ng-click="clearSearch()" type="button"><i class="zmdi zmdi-close"></i></button>
83                     </form>
84                 </div>
85                 <div class="activity anim fadeIn">
86                     <h3>Recent Activity</h3>
87                     @include('partials/activity-list', ['activity' => Activity::entityActivity($book, 20, 0)])
88                 </div>
89             </div>
90         </div>
91     </div>
92
93 @stop