1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Added Popular books list with relevant tests

This commit is contained in:
Dan Brown
2015-12-02 20:22:41 +00:00
parent 9f435553dc
commit f1c2866fbc
7 changed files with 117 additions and 8 deletions

View File

@@ -34,11 +34,22 @@
@endif
</div>
<div class="col-sm-4 col-sm-offset-1">
<div id="recents">
@if($recents)
<div class="margin-top large">&nbsp;</div>
<h3>Recently Viewed</h3>
@include('partials/entity-list', ['entities' => $recents])
@endif
</div>
<div class="margin-top large">&nbsp;</div>
@if($recents)
<h3>Recently Viewed</h3>
@include('partials/entity-list', ['entities' => $recents])
@endif
<div id="popular">
<h3>Popular Books</h3>
@if(count($popular) > 0)
@include('partials/entity-list', ['entities' => $popular])
@else
<p class="text-muted">The most popular books will appear here.</p>
@endif
</div>
</div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
@if(count($entities) > 0)
@foreach($entities as $entity)
@foreach($entities as $index => $entity)
@if($entity->isA('page'))
@include('pages/list-item', ['page' => $entity])
@elseif($entity->isA('book'))
@@ -8,7 +8,11 @@
@elseif($entity->isA('chapter'))
@include('chapters/list-item', ['chapter' => $entity, 'hidePages' => true])
@endif
<hr>
@if($index !== count($entities) - 1)
<hr>
@endif
@endforeach
@else
<p class="text-muted">