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,9 +18,11 @@ ...@@ -18,9 +18,11 @@
18 </div> 18 </div>
19 19
20 20
21 - 21 + <div class="container">
22 - <div class="page-content"> 22 + <div class="row">
23 + <div class="col-md-8">
23 <h1>Books</h1> 24 <h1>Books</h1>
25 + @if(count($books) > 0)
24 @foreach($books as $book) 26 @foreach($books as $book)
25 <div class="book"> 27 <div class="book">
26 <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> 28 <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3>
...@@ -28,6 +30,13 @@ ...@@ -28,6 +30,13 @@
28 </div> 30 </div>
29 <hr> 31 <hr>
30 @endforeach 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
37 + </div>
38 + <div class="col-md-4"></div>
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,6 +36,7 @@ ...@@ -36,6 +36,7 @@
36 36
37 <div class="page-list"> 37 <div class="page-list">
38 <hr> 38 <hr>
39 + @if(count($book->children()) > 0)
39 @foreach($book->children() as $childElement) 40 @foreach($book->children() as $childElement)
40 <div class="book-child"> 41 <div class="book-child">
41 <h3> 42 <h3>
...@@ -57,6 +58,15 @@ ...@@ -57,6 +58,15 @@
57 </div> 58 </div>
58 <hr> 59 <hr>
59 @endforeach 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>
68 + <hr>
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,6 +7,7 @@ ...@@ -7,6 +7,7 @@
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 + @if(count($books) > 0)
10 @foreach($books as $book) 11 @foreach($books as $book)
11 <div class="book"> 12 <div class="book">
12 <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> 13 <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3>
...@@ -14,6 +15,10 @@ ...@@ -14,6 +15,10 @@
14 </div> 15 </div>
15 <hr> 16 <hr>
16 @endforeach 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
......