]> BookStack Code Mirror - bookstack/blob - resources/views/books/show.blade.php
Added created_by and updated_by to entities. Fixes #3
[bookstack] / resources / views / books / show.blade.php
1 @extends('base')
2
3 @section('content')
4
5     <div class="row faded-small">
6         <div class="col-md-6"></div>
7         <div class="col-md-6">
8             <div class="action-buttons faded">
9                 <a href="{{$book->getUrl() . '/page/create'}}" class="text-pos"><i class="zmdi zmdi-plus"></i> New Page</a>
10                 <a href="{{$book->getUrl() . '/chapter/create'}}" class="text-pos"><i class="zmdi zmdi-plus"></i> New Chapter</a>
11                 <a href="{{$book->getEditUrl()}}" class="text-primary"><i class="zmdi zmdi-edit"></i>Edit</a>
12                 <a href="{{ $book->getUrl() }}/sort" class="text-primary"><i class="zmdi zmdi-sort"></i>Sort</a>
13                 <a href="{{ $book->getUrl() }}/delete" class="text-neg"><i class="zmdi zmdi-delete"></i>Delete</a>
14             </div>
15         </div>
16     </div>
17
18     <div class="page-content">
19         <h1>{{$book->name}}</h1>
20         <p class="text-muted">{{$book->description}}</p>
21
22         <div class="page-list">
23             <hr>
24             @foreach($book->children() as $childElement)
25                 <div class="book-child">
26                     <h3>
27                         <a href="{{ $childElement->getUrl() }}">
28                             @if(is_a($childElement, 'Oxbow\Chapter'))
29                                 <i class="zmdi zmdi-collection-bookmark chapter-toggle"></i>
30                             @else
31                                 <i class="zmdi zmdi-file-text"></i>
32                             @endif
33                             {{ $childElement->name }}
34                         </a>
35                     </h3>
36                     <p class="text-muted">
37                         {{$childElement->getExcerpt()}}
38                     </p>
39
40                     @if(is_a($childElement, 'Oxbow\Chapter') && count($childElement->pages) > 0)
41                         <div class="inset-list">
42                             @foreach($childElement->pages as $page)
43                                 <h4><a href="{{$page->getUrl()}}"><i class="zmdi zmdi-file-text"></i> {{$page->name}}</a></h4>
44                             @endforeach
45                         </div>
46                     @endif
47                 </div>
48                 <hr>
49             @endforeach
50         </div>
51
52         <p class="text-muted small">
53             Created {{$book->created_at->diffForHumans()}} @if($book->createdBy) by {{$book->createdBy->name}} @endif
54             <br>
55             Last Updated {{$book->updated_at->diffForHumans()}} @if($book->createdBy) by {{$book->updatedBy->name}} @endif
56         </p>
57
58     </div>
59
60
61     <script>
62         $(function() {
63
64             $('.chapter-toggle').click(function(e) {
65                 e.preventDefault();
66                 $(this).closest('.book-child').find('.inset-list').slideToggle(180);
67             });
68
69         });
70     </script>
71
72 @stop