mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 12:43:52 +08:00
0e73785498
Refactor Frontend + Asset code - Use Laravel's Filesystem component for asset IO, meaning theoretically assets should be storable on S3 etc. - More reliable checking for asset recompilation when debug mode is on, so you don't have to constantly delete the compiled assets to force a recompile. Should also fix issues with locale JS files being recompiled with the same name and cached. - Remove JavaScript minification, because it will be done by Webpack (exception is for the TextFormatter JS). - Add support for JS sourcemaps. - Separate frontend view and assets completely. This is an important distinction because frontend assets are compiled independent of a request, whereas putting together a view depends on a request. - Bind frontend view/asset factory instances to the container (in service providers) rather than subclassing. Asset and content populators can be added to these factories – these are simply objects that populate the asset compilers or the view with information. - Add RouteHandlerFactory functions that make it easy to hook up a frontend controller with a frontend instance ± some content. - Remove the need for "nojs" - Fix cache:clear command - Recompile assets when settings/enabled extensions change
26 lines
972 B
PHP
26 lines
972 B
PHP
<div class="container">
|
|
<h2>{{ $apiDocument->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($apiDocument->links->prev))
|
|
<a href="{{ $url(['page' => $page - 1]) }}">« {{ $translator->trans('core.views.discussion.previous_page_button') }}</a>
|
|
@endif
|
|
|
|
@if (isset($apiDocument->links->next))
|
|
<a href="{{ $url(['page' => $page + 1]) }}">{{ $translator->trans('core.views.discussion.next_page_button') }} »</a>
|
|
@endif
|
|
</div>
|