mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
merges 5.5 and master into next-back
This commit is contained in:
29
views/frontend/content/discussion.blade.php
Normal file
29
views/frontend/content/discussion.blade.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
$discussion = $document->data;
|
||||
$postsCount = count($discussion->relationships->posts->data);
|
||||
?>
|
||||
<div class="container">
|
||||
<h2>{{ $discussion->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 ($page > 1)
|
||||
<a href="{{ $url(['page' => $page - 1]) }}">« {{ $translator->trans('core.views.discussion.previous_page_button') }}</a>
|
||||
@endif
|
||||
|
||||
@if ($page < $postsCount / 20)
|
||||
<a href="{{ $url(['page' => $page + 1]) }}">{{ $translator->trans('core.views.discussion.next_page_button') }} »</a>
|
||||
@endif
|
||||
</div>
|
20
views/frontend/content/index.blade.php
Normal file
20
views/frontend/content/index.blade.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
$url = app('Flarum\Http\UrlGenerator');
|
||||
?>
|
||||
<div class="container">
|
||||
<h2>{{ $translator->trans('core.views.index.all_discussions_heading') }}</h2>
|
||||
|
||||
<ul>
|
||||
@foreach ($document->data as $discussion)
|
||||
<li>
|
||||
<a href="{{ $url->to('forum')->route('discussion', [
|
||||
'id' => $discussion->id . '-' . $discussion->attributes->slug
|
||||
]) }}">
|
||||
{{ $discussion->attributes->title }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<a href="{{ $url->to('forum')->route('index') }}?page={{ $page + 1 }}">{{ $translator->trans('core.views.index.next_page_button') }} »</a>
|
||||
</div>
|
Reference in New Issue
Block a user