framework/views/frontend/content/discussion.blade.php
Franz Liedke 3480a65989
Avoid calculations in views
Instead, look up existence of navigation links in the underlying
API document.
2018-01-10 20:39:53 +01:00

26 lines
963 B
PHP

<div class="container">
<h2>{{ $document->data->attributes->title }}</h2>
<div>
@foreach ($posts as $post)
<div>
<?php $user = ! empty($post->relationships->user->data) ? $getResource($post->relationships->user->data) : null; ?>
<h3>{{ $user ? $user->attributes->username : $translator->trans('core.lib.username.deleted_text') }}</h3>
<div class="Post-body">
{!! $post->attributes->contentHtml !!}
</div>
</div>
<hr>
@endforeach
</div>
@if (isset($document->links->prev))
<a href="{{ $url(['page' => $page - 1]) }}">&laquo; {{ $translator->trans('core.views.discussion.previous_page_button') }}</a>
@endif
@if (isset($document->links->next))
<a href="{{ $url(['page' => $page + 1]) }}">{{ $translator->trans('core.views.discussion.next_page_button') }} &raquo;</a>
@endif
</div>