Added book and chapter icons to pages in global search results. Closes #19.

This commit is contained in:
Dan Brown 2015-10-14 21:55:56 +01:00
parent 7039695b65
commit 965851d112
3 changed files with 18 additions and 1 deletions

View File

@ -32,6 +32,13 @@
.book {
border-left: 5px solid $color-book;
}
.meta {
margin-top: -$-m;
font-size: 0.95em;
}
.meta span {
margin-right: $-s;
}
}
.chapter-toggle {
cursor: pointer;

View File

@ -2,6 +2,16 @@
<h3>
<a href="{{ $page->getUrl() }}" class="text-page"><i class="zmdi zmdi-file-text"></i>{{ $page->name }}</a>
</h3>
@if(isset($showMeta) && $showMeta)
<div class="meta">
<span class="text-book"><i class="zmdi zmdi-book"></i> {{ $page->book->name }}</span>
@if($page->chapter)
<span class="text-chapter"><i class="zmdi zmdi-collection-bookmark"></i> {{ $page->chapter->name }}</span>
@endif
</div>
@endif
@if(isset($page->searchSnippet))
<p class="text-muted">{!! $page->searchSnippet !!}</p>
@else

View File

@ -13,7 +13,7 @@
<div class="page-list">
@if(count($pages) > 0)
@foreach($pages as $page)
@include('pages/list-item', ['page' => $page])
@include('pages/list-item', ['page' => $page, 'showMeta' => true])
<hr>
@endforeach
@else