]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Started another major redsign
[bookstack] / resources / views / books / show.blade.php
1 @extends('base')
2
3 @section('content')
4
5     <div class="faded-small">
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"><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"><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"><i class="zmdi zmdi-edit"></i>Edit</a>
18                             <a href="{{ $book->getUrl() }}/sort" class="text-primary"><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"><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">
31         <div class="row">
32             <div class="col-md-7">
33
34                 <h1>{{$book->name}}</h1>
35                 <p class="text-muted">{{$book->description}}</p>
36
37                 <div class="page-list">
38                     <hr>
39                     @foreach($book->children() as $childElement)
40                         <div class="book-child">
41                             <h3>
42                                 <a href="{{ $childElement->getUrl() }}">
43                                     @if(is_a($childElement, 'Oxbow\Chapter'))
44                                         <i class="zmdi zmdi-collection-bookmark chapter-toggle"></i>
45                                     @else
46                                         <i class="zmdi zmdi-file-text"></i>
47                                     @endif
48                                     {{ $childElement->name }}
49                                 </a>
50                             </h3>
51                             <p class="text-muted">
52                                 {{$childElement->getExcerpt()}}
53                             </p>
54
55                             @if(is_a($childElement, 'Oxbow\Chapter') && count($childElement->pages) > 0)
56                                 <div class="inset-list">
57                                     @foreach($childElement->pages as $page)
58                                         <h4><a href="{{$page->getUrl()}}"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h4>
59                                     @endforeach
60                                 </div>
61                             @endif
62                         </div>
63                         <hr>
64                     @endforeach
65                 </div>
66
67                 <p class="text-muted small">
68                     Created {{$book->created_at->diffForHumans()}} @if($book->createdBy) by {{$book->createdBy->name}} @endif
69                     <br>
70                     Last Updated {{$book->updated_at->diffForHumans()}} @if($book->createdBy) by {{$book->updatedBy->name}} @endif
71                 </p>
72
73
74             </div>
75
76             <div class="col-md-4 col-md-offset-1">
77                 <div class="margin-top large"><br></div>
78                 <h3>Recent Activity</h3>
79                 @include('partials/activity-list', ['activity' => Activity::entityActivity($book, 20, 0)])
80             </div>
81         </div>
82     </div>
83
84
85
86     <script>
87         $(function() {
88
89             $('.chapter-toggle').click(function(e) {
90                 e.preventDefault();
91                 $(this).closest('.book-child').find('.inset-list').slideToggle(180);
92             });
93
94         });
95     </script>
96
97 @stop