Showing
3 changed files
with
37 additions
and
32 deletions
| ... | @@ -32,12 +32,14 @@ class HomeController extends Controller | ... | @@ -32,12 +32,14 @@ class HomeController extends Controller |
| 32 | $recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 10*$recentFactor); | 32 | $recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 10*$recentFactor); |
| 33 | $recentlyCreatedPages = $this->entityRepo->getRecentlyCreated('page', 5); | 33 | $recentlyCreatedPages = $this->entityRepo->getRecentlyCreated('page', 5); |
| 34 | $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 5); | 34 | $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 5); |
| 35 | + $books = $this->entityRepo->getAllPaginated('book', 10); | ||
| 35 | return view('home', [ | 36 | return view('home', [ |
| 36 | 'activity' => $activity, | 37 | 'activity' => $activity, |
| 37 | 'recents' => $recents, | 38 | 'recents' => $recents, |
| 38 | 'recentlyCreatedPages' => $recentlyCreatedPages, | 39 | 'recentlyCreatedPages' => $recentlyCreatedPages, |
| 39 | 'recentlyUpdatedPages' => $recentlyUpdatedPages, | 40 | 'recentlyUpdatedPages' => $recentlyUpdatedPages, |
| 40 | - 'draftPages' => $draftPages | 41 | + 'draftPages' => $draftPages, |
| 42 | + 'books'=>$books | ||
| 41 | ]); | 43 | ]); |
| 42 | } | 44 | } |
| 43 | 45 | ... | ... |
| ... | @@ -18,23 +18,15 @@ | ... | @@ -18,23 +18,15 @@ |
| 18 | <div class="row"> | 18 | <div class="row"> |
| 19 | 19 | ||
| 20 | <div class="col-sm-4"> | 20 | <div class="col-sm-4"> |
| 21 | - <div id="recent-drafts"> | 21 | + <h4><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">{{ trans('entities.books') }}</a></h4> |
| 22 | - @if(count($draftPages) > 0) | 22 | + <div id="all-books"> |
| 23 | - <h4>{{ trans('entities.my_recent_drafts') }}</h4> | ||
| 24 | - @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact']) | ||
| 25 | - @endif | ||
| 26 | - </div> | ||
| 27 | - @if($signedIn) | ||
| 28 | - <h4>{{ trans('entities.my_recently_viewed') }}</h4> | ||
| 29 | - @else | ||
| 30 | - <h4>{{ trans('entities.books_recent') }}</h4> | ||
| 31 | - @endif | ||
| 32 | @include('partials/entity-list', [ | 23 | @include('partials/entity-list', [ |
| 33 | - 'entities' => $recents, | 24 | + 'entities' => $books, |
| 34 | 'style' => 'compact', | 25 | 'style' => 'compact', |
| 35 | - 'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty') | 26 | + 'emptyText' => trans('entities.no_pages_recently_created') |
| 36 | ]) | 27 | ]) |
| 37 | </div> | 28 | </div> |
| 29 | + </div> | ||
| 38 | 30 | ||
| 39 | <div class="col-sm-4"> | 31 | <div class="col-sm-4"> |
| 40 | <h4><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">{{ trans('entities.recently_created_pages') }}</a></h4> | 32 | <h4><a class="no-color" href="{{ baseUrl("/pages/recently-created") }}">{{ trans('entities.recently_created_pages') }}</a></h4> |
| ... | @@ -57,6 +49,24 @@ | ... | @@ -57,6 +49,24 @@ |
| 57 | </div> | 49 | </div> |
| 58 | 50 | ||
| 59 | <div class="col-sm-4" id="recent-activity"> | 51 | <div class="col-sm-4" id="recent-activity"> |
| 52 | + | ||
| 53 | + <div id="recent-drafts"> | ||
| 54 | + @if(count($draftPages) > 0) | ||
| 55 | + <h4>{{ trans('entities.my_recent_drafts') }}</h4> | ||
| 56 | + @include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact']) | ||
| 57 | + @endif | ||
| 58 | + </div> | ||
| 59 | + @if($signedIn) | ||
| 60 | + <h4>{{ trans('entities.my_recently_viewed') }}</h4> | ||
| 61 | + @else | ||
| 62 | + <h4>{{ trans('entities.books_recent') }}</h4> | ||
| 63 | + @endif | ||
| 64 | + @include('partials/entity-list', [ | ||
| 65 | + 'entities' => $recents, | ||
| 66 | + 'style' => 'compact', | ||
| 67 | + 'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty') | ||
| 68 | + ]) | ||
| 69 | + | ||
| 60 | <h4>{{ trans('entities.recent_activity') }}</h4> | 70 | <h4>{{ trans('entities.recent_activity') }}</h4> |
| 61 | @include('partials/activity-list', ['activity' => $activity]) | 71 | @include('partials/activity-list', ['activity' => $activity]) |
| 62 | </div> | 72 | </div> | ... | ... |
| 1 | 1 | ||
| 2 | <div class="book-tree" ng-non-bindable> | 2 | <div class="book-tree" ng-non-bindable> |
| 3 | 3 | ||
| 4 | - @if(isset($page) && $page->tags->count() > 0) | ||
| 5 | - <div class="tag-display"> | ||
| 6 | - <h6 class="text-muted">{{ trans('entities.page_tags') }}</h6> | ||
| 7 | - <table> | ||
| 8 | - <tbody> | ||
| 9 | - @foreach($page->tags as $tag) | ||
| 10 | - <tr class="tag"> | ||
| 11 | - <td @if(!$tag->value) colspan="2" @endif><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">{{ $tag->name }}</a></td> | ||
| 12 | - @if($tag->value) <td class="tag-value"><a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%3D' . urlencode($tag->value) . '%5D') }}">{{$tag->value}}</a></td> @endif | ||
| 13 | - </tr> | ||
| 14 | - @endforeach | ||
| 15 | - </tbody> | ||
| 16 | - </table> | ||
| 17 | - </div> | ||
| 18 | - @endif | ||
| 19 | - | ||
| 20 | @if (isset($page) && $page->attachments->count() > 0) | 4 | @if (isset($page) && $page->attachments->count() > 0) |
| 21 | <h6 class="text-muted">{{ trans('entities.pages_attachments') }}</h6> | 5 | <h6 class="text-muted">{{ trans('entities.pages_attachments') }}</h6> |
| 22 | @foreach($page->attachments as $attachment) | 6 | @foreach($page->attachments as $attachment) |
| ... | @@ -68,7 +52,16 @@ | ... | @@ -68,7 +52,16 @@ |
| 68 | 52 | ||
| 69 | </li> | 53 | </li> |
| 70 | @endforeach | 54 | @endforeach |
| 71 | - | ||
| 72 | - | ||
| 73 | </ul> | 55 | </ul> |
| 56 | + | ||
| 57 | + @if(isset($page) && $page->tags->count() > 0) | ||
| 58 | + <div class="tag-display"> | ||
| 59 | + <h6 class="text-muted">{{ trans('entities.page_tags') }}</h6> | ||
| 60 | + @foreach($page->tags as $tag) | ||
| 61 | + <span class="tag"> | ||
| 62 | + <a href="{{ baseUrl('/search?term=%5B' . urlencode($tag->name) .'%5D') }}">{{ $tag->name }}</a> | ||
| 63 | + </span> | ||
| 64 | + @endforeach | ||
| 65 | + </div> | ||
| 66 | + @endif | ||
| 74 | </div> | 67 | </div> | ... | ... |
-
Please register or sign in to post a comment