Dan Brown

Improved empty lists. Fixes #10.

...@@ -24,7 +24,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon ...@@ -24,7 +24,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
24 * 24 *
25 * @var array 25 * @var array
26 */ 26 */
27 - protected $fillable = ['name', 'email']; 27 + protected $fillable = ['name', 'email', 'password'];
28 28
29 /** 29 /**
30 * The attributes excluded from the model's JSON form. 30 * The attributes excluded from the model's JSON form.
......
...@@ -296,7 +296,9 @@ h1, h2, h3, h4, h5, h6 { ...@@ -296,7 +296,9 @@ h1, h2, h3, h4, h5, h6 {
296 } 296 }
297 } 297 }
298 298
299 - 299 +.book-tree {
300 + margin-top: $-xl;
301 +}
300 .book-tree h4 { 302 .book-tree h4 {
301 padding: $-m $-s 0 $-s; 303 padding: $-m $-s 0 $-s;
302 i { 304 i {
...@@ -309,7 +311,7 @@ h1, h2, h3, h4, h5, h6 { ...@@ -309,7 +311,7 @@ h1, h2, h3, h4, h5, h6 {
309 .book-tree .sidebar-page-list { 311 .book-tree .sidebar-page-list {
310 list-style: none; 312 list-style: none;
311 margin: 0; 313 margin: 0;
312 - margin-top: $-xl; 314 + margin-top: $-xs;
313 border-left: 5px solid $color-book; 315 border-left: 5px solid $color-book;
314 li a { 316 li a {
315 display: block; 317 display: block;
......
...@@ -18,16 +18,25 @@ ...@@ -18,16 +18,25 @@
18 </div> 18 </div>
19 19
20 20
21 - 21 + <div class="container">
22 - <div class="page-content"> 22 + <div class="row">
23 - <h1>Books</h1> 23 + <div class="col-md-8">
24 - @foreach($books as $book) 24 + <h1>Books</h1>
25 - <div class="book"> 25 + @if(count($books) > 0)
26 - <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> 26 + @foreach($books as $book)
27 - <p class="text-muted">{{$book->description}}</p> 27 + <div class="book">
28 + <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3>
29 + <p class="text-muted">{{$book->description}}</p>
30 + </div>
31 + <hr>
32 + @endforeach
33 + @else
34 + <p class="text-muted">No books have been created.</p>
35 + <a href="/books/create" class="text-pos"><i class="zmdi zmdi-edit"></i>Create one now</a>
36 + @endif
28 </div> 37 </div>
29 - <hr> 38 + <div class="col-md-4"></div>
30 - @endforeach 39 + </div>
31 </div> 40 </div>
32 41
33 @stop 42 @stop
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -36,27 +36,37 @@ ...@@ -36,27 +36,37 @@
36 36
37 <div class="page-list"> 37 <div class="page-list">
38 <hr> 38 <hr>
39 - @foreach($book->children() as $childElement) 39 + @if(count($book->children()) > 0)
40 - <div class="book-child"> 40 + @foreach($book->children() as $childElement)
41 - <h3> 41 + <div class="book-child">
42 - <a href="{{ $childElement->getUrl() }}" class="{{ $childElement->getName() }}"> 42 + <h3>
43 - <i class="zmdi {{ $childElement->isA('chapter') ? 'zmdi-collection-bookmark chapter-toggle':'zmdi-file-text'}}"></i>{{ $childElement->name }} 43 + <a href="{{ $childElement->getUrl() }}" class="{{ $childElement->getName() }}">
44 - </a> 44 + <i class="zmdi {{ $childElement->isA('chapter') ? 'zmdi-collection-bookmark chapter-toggle':'zmdi-file-text'}}"></i>{{ $childElement->name }}
45 - </h3> 45 + </a>
46 - <p class="text-muted"> 46 + </h3>
47 - {{$childElement->getExcerpt()}} 47 + <p class="text-muted">
48 - </p> 48 + {{$childElement->getExcerpt()}}
49 - 49 + </p>
50 - @if($childElement->isA('chapter') && count($childElement->pages) > 0) 50 +
51 - <div class="inset-list"> 51 + @if($childElement->isA('chapter') && count($childElement->pages) > 0)
52 - @foreach($childElement->pages as $page) 52 + <div class="inset-list">
53 - <h4><a href="{{$page->getUrl()}}"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h4> 53 + @foreach($childElement->pages as $page)
54 - @endforeach 54 + <h4><a href="{{$page->getUrl()}}"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h4>
55 - </div> 55 + @endforeach
56 - @endif 56 + </div>
57 - </div> 57 + @endif
58 + </div>
59 + <hr>
60 + @endforeach
61 + @else
62 + <p class="text-muted">No pages or chapters have been created for this book.</p>
63 + <p>
64 + <a href="{{$book->getUrl() . '/page/create'}}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
65 + &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp;
66 + <a href="{{$book->getUrl() . '/chapter/create'}}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>Add a chapter</a>
67 + </p>
58 <hr> 68 <hr>
59 - @endforeach 69 + @endif
60 </div> 70 </div>
61 71
62 <p class="text-muted small"> 72 <p class="text-muted small">
......
...@@ -56,7 +56,14 @@ ...@@ -56,7 +56,14 @@
56 @endforeach 56 @endforeach
57 </div> 57 </div>
58 @else 58 @else
59 - <p class="text-muted">No pages are in this chapter</p> 59 + <hr>
60 + <p class="text-muted">No pages are currently in this chapter.</p>
61 + <p>
62 + <a href="{{$chapter->getUrl() . '/create-page'}}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
63 + &nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp;
64 + <a href="{{$book->getUrl() . '/sort'}}" class="text-book"><i class="zmdi zmdi-book"></i>Sort the current book</a>
65 + </p>
66 + <hr>
60 @endif 67 @endif
61 68
62 <p class="text-muted small"> 69 <p class="text-muted small">
......
...@@ -7,13 +7,18 @@ ...@@ -7,13 +7,18 @@
7 <div class="row"> 7 <div class="row">
8 <div class="col-md-7"> 8 <div class="col-md-7">
9 <h2>Books</h2> 9 <h2>Books</h2>
10 - @foreach($books as $book) 10 + @if(count($books) > 0)
11 - <div class="book"> 11 + @foreach($books as $book)
12 - <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> 12 + <div class="book">
13 - <p class="text-muted">{{$book->description}}</p> 13 + <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3>
14 - </div> 14 + <p class="text-muted">{{$book->description}}</p>
15 - <hr> 15 + </div>
16 - @endforeach 16 + <hr>
17 + @endforeach
18 + @else
19 + <p class="text-muted">No books have been created.</p>
20 + <a href="/books/create" class="text-pos"><i class="zmdi zmdi-edit"></i>Create one now</a>
21 + @endif
17 </div> 22 </div>
18 <div class="col-md-4 col-md-offset-1"> 23 <div class="col-md-4 col-md-offset-1">
19 <div class="margin-top large">&nbsp;</div> 24 <div class="margin-top large">&nbsp;</div>
......
1 1
2 <div class="book-tree"> 2 <div class="book-tree">
3 + <h6 class="text-muted">Book Navigation</h6>
3 <ul class="sidebar-page-list menu"> 4 <ul class="sidebar-page-list menu">
4 <li class="book-header"><a href="{{$book->getUrl()}}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li> 5 <li class="book-header"><a href="{{$book->getUrl()}}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li>
5 @foreach($book->children() as $bookChild) 6 @foreach($book->children() as $bookChild)
......
...@@ -9,4 +9,6 @@ ...@@ -9,4 +9,6 @@
9 </div> 9 </div>
10 @endforeach 10 @endforeach
11 </div> 11 </div>
12 +@else
13 + <p class="text-muted">New activity will show up here.</p>
12 @endif 14 @endif
...\ No newline at end of file ...\ No newline at end of file
......