Override the Paginators defaultSimpleView (#3652)

Credit to @dzava. Fixes #3355.
This commit is contained in:
dzava 2019-01-22 07:49:25 +02:00 committed by Luke Towers
parent ec2a0d5fb0
commit a539a36b30
4 changed files with 31 additions and 0 deletions

View File

@ -24,6 +24,7 @@ use System\Classes\CombineAssets;
use Backend\Classes\WidgetManager;
use October\Rain\Support\ModuleServiceProvider;
use October\Rain\Router\Helper as RouterHelper;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Schema;
class ServiceProvider extends ModuleServiceProvider
@ -87,6 +88,8 @@ class ServiceProvider extends ModuleServiceProvider
Schema::defaultStringLength(191);
}
Paginator::defaultSimpleView('system::pagination.simple-default');
/*
* Boot plugins
*/

View File

@ -317,4 +317,8 @@ return [
'invalid_path' => "Ορίστηκε μη έγκυρη διαδρομή αρχείου : ':path'.",
'folder_size_items' => 'αντικείμενο(α)',
],
'pagination' => [
'previous' => 'Προηγούμενη',
'next' => 'Επόμενη',
],
];

View File

@ -447,4 +447,8 @@ return [
'invalid_path' => "Invalid file path specified: ':path'.",
'folder_size_items' => 'item(s)',
],
'pagination' => [
'previous' => 'Previous',
'next' => 'Next',
],
];

View File

@ -0,0 +1,20 @@
@if ($paginator->hasPages())
<ul class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="disabled"><span>{!! Lang::get('system::lang.pagination.previous') !!}</span></li>
@else
<li><a href="{{ $paginator->previousPageUrl() }}"
rel="prev">{!! Lang::get('system::lang.pagination.previous') !!}</a></li>
@endif
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">{!! Lang::get('system::lang.pagination.next') !!}</a>
</li>
@else
<li class="disabled"><span>{!! Lang::get('system::lang.pagination.next') !!}</span></li>
@endif
</ul>
@endif