Improved empty lists. Fixes #10.

This commit is contained in:
Dan Brown 2015-08-31 17:59:45 +01:00
parent ee8795dcda
commit 1b29d44689
8 changed files with 75 additions and 39 deletions

View File

@ -24,7 +24,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
* *
* @var array * @var array
*/ */
protected $fillable = ['name', 'email']; protected $fillable = ['name', 'email', 'password'];
/** /**
* The attributes excluded from the model's JSON form. * The attributes excluded from the model's JSON form.

View File

@ -296,7 +296,9 @@ h1, h2, h3, h4, h5, h6 {
} }
} }
.book-tree {
margin-top: $-xl;
}
.book-tree h4 { .book-tree h4 {
padding: $-m $-s 0 $-s; padding: $-m $-s 0 $-s;
i { i {
@ -309,7 +311,7 @@ h1, h2, h3, h4, h5, h6 {
.book-tree .sidebar-page-list { .book-tree .sidebar-page-list {
list-style: none; list-style: none;
margin: 0; margin: 0;
margin-top: $-xl; margin-top: $-xs;
border-left: 5px solid $color-book; border-left: 5px solid $color-book;
li a { li a {
display: block; display: block;

View File

@ -18,16 +18,25 @@
</div> </div>
<div class="container">
<div class="page-content"> <div class="row">
<h1>Books</h1> <div class="col-md-8">
@foreach($books as $book) <h1>Books</h1>
<div class="book"> @if(count($books) > 0)
<h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> @foreach($books as $book)
<p class="text-muted">{{$book->description}}</p> <div class="book">
<h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3>
<p class="text-muted">{{$book->description}}</p>
</div>
<hr>
@endforeach
@else
<p class="text-muted">No books have been created.</p>
<a href="/books/create" class="text-pos"><i class="zmdi zmdi-edit"></i>Create one now</a>
@endif
</div> </div>
<hr> <div class="col-md-4"></div>
@endforeach </div>
</div> </div>
@stop @stop

View File

@ -36,27 +36,37 @@
<div class="page-list"> <div class="page-list">
<hr> <hr>
@foreach($book->children() as $childElement) @if(count($book->children()) > 0)
<div class="book-child"> @foreach($book->children() as $childElement)
<h3> <div class="book-child">
<a href="{{ $childElement->getUrl() }}" class="{{ $childElement->getName() }}"> <h3>
<i class="zmdi {{ $childElement->isA('chapter') ? 'zmdi-collection-bookmark chapter-toggle':'zmdi-file-text'}}"></i>{{ $childElement->name }} <a href="{{ $childElement->getUrl() }}" class="{{ $childElement->getName() }}">
</a> <i class="zmdi {{ $childElement->isA('chapter') ? 'zmdi-collection-bookmark chapter-toggle':'zmdi-file-text'}}"></i>{{ $childElement->name }}
</h3> </a>
<p class="text-muted"> </h3>
{{$childElement->getExcerpt()}} <p class="text-muted">
</p> {{$childElement->getExcerpt()}}
</p>
@if($childElement->isA('chapter') && count($childElement->pages) > 0) @if($childElement->isA('chapter') && count($childElement->pages) > 0)
<div class="inset-list"> <div class="inset-list">
@foreach($childElement->pages as $page) @foreach($childElement->pages as $page)
<h4><a href="{{$page->getUrl()}}"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h4> <h4><a href="{{$page->getUrl()}}"><i class="zmdi zmdi-file-text"></i>{{$page->name}}</a></h4>
@endforeach @endforeach
</div> </div>
@endif @endif
</div> </div>
<hr>
@endforeach
@else
<p class="text-muted">No pages or chapters have been created for this book.</p>
<p>
<a href="{{$book->getUrl() . '/page/create'}}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
&nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp;
<a href="{{$book->getUrl() . '/chapter/create'}}" class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i>Add a chapter</a>
</p>
<hr> <hr>
@endforeach @endif
</div> </div>
<p class="text-muted small"> <p class="text-muted small">

View File

@ -56,7 +56,14 @@
@endforeach @endforeach
</div> </div>
@else @else
<p class="text-muted">No pages are in this chapter</p> <hr>
<p class="text-muted">No pages are currently in this chapter.</p>
<p>
<a href="{{$chapter->getUrl() . '/create-page'}}" class="text-page"><i class="zmdi zmdi-file-text"></i>Create a new page</a>
&nbsp;&nbsp;<em class="text-muted">-or-</em>&nbsp;&nbsp;&nbsp;
<a href="{{$book->getUrl() . '/sort'}}" class="text-book"><i class="zmdi zmdi-book"></i>Sort the current book</a>
</p>
<hr>
@endif @endif
<p class="text-muted small"> <p class="text-muted small">

View File

@ -7,13 +7,18 @@
<div class="row"> <div class="row">
<div class="col-md-7"> <div class="col-md-7">
<h2>Books</h2> <h2>Books</h2>
@foreach($books as $book) @if(count($books) > 0)
<div class="book"> @foreach($books as $book)
<h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3> <div class="book">
<p class="text-muted">{{$book->description}}</p> <h3><a href="{{$book->getUrl()}}">{{$book->name}}</a></h3>
</div> <p class="text-muted">{{$book->description}}</p>
<hr> </div>
@endforeach <hr>
@endforeach
@else
<p class="text-muted">No books have been created.</p>
<a href="/books/create" class="text-pos"><i class="zmdi zmdi-edit"></i>Create one now</a>
@endif
</div> </div>
<div class="col-md-4 col-md-offset-1"> <div class="col-md-4 col-md-offset-1">
<div class="margin-top large">&nbsp;</div> <div class="margin-top large">&nbsp;</div>

View File

@ -1,5 +1,6 @@
<div class="book-tree"> <div class="book-tree">
<h6 class="text-muted">Book Navigation</h6>
<ul class="sidebar-page-list menu"> <ul class="sidebar-page-list menu">
<li class="book-header"><a href="{{$book->getUrl()}}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li> <li class="book-header"><a href="{{$book->getUrl()}}" class="book {{ $current->matches($book)? 'selected' : '' }}"><i class="zmdi zmdi-book"></i>{{$book->name}}</a></li>
@foreach($book->children() as $bookChild) @foreach($book->children() as $bookChild)

View File

@ -9,4 +9,6 @@
</div> </div>
@endforeach @endforeach
</div> </div>
@else
<p class="text-muted">New activity will show up here.</p>
@endif @endif