2015-08-06 10:51:11 +08:00
|
|
|
<?php
|
|
|
|
$discussion = $document->data;
|
|
|
|
$postsCount = count($discussion->relationships->posts->data);
|
|
|
|
?>
|
|
|
|
<div class="container">
|
|
|
|
<h2>{{ $discussion->attributes->title }}</h2>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
@foreach ($posts as $post)
|
|
|
|
<div>
|
2017-12-10 18:32:35 +08:00
|
|
|
<?php $user = ! empty($post->relationships->user->data) ? $getResource($post->relationships->user->data) : null; ?>
|
2016-04-07 19:50:35 +08:00
|
|
|
<h3>{{ $user ? $user->attributes->username : $translator->trans('core.lib.username.deleted_text') }}</h3>
|
2015-08-06 10:51:11 +08:00
|
|
|
<div class="Post-body">
|
|
|
|
{!! $post->attributes->contentHtml !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@if ($page > 1)
|
2016-04-07 16:45:58 +08:00
|
|
|
<a href="{{ $url(['page' => $page - 1]) }}">« {{ $translator->trans('core.views.discussion.previous_page_button') }}</a>
|
2015-08-06 10:51:11 +08:00
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($page < $postsCount / 20)
|
2016-04-07 16:45:58 +08:00
|
|
|
<a href="{{ $url(['page' => $page + 1]) }}">{{ $translator->trans('core.views.discussion.next_page_button') }} »</a>
|
2015-08-06 10:51:11 +08:00
|
|
|
@endif
|
|
|
|
</div>
|