new way to add all locales to datagrid
This commit is contained in:
parent
e6b83beb33
commit
cccd1f6331
|
|
@ -12,10 +12,6 @@ class CategoryDataGrid extends DataGrid
|
||||||
|
|
||||||
protected $sortOrder = 'desc';
|
protected $sortOrder = 'desc';
|
||||||
|
|
||||||
protected $extraFilters = [
|
|
||||||
'locales'
|
|
||||||
];
|
|
||||||
|
|
||||||
protected $locale = 'all';
|
protected $locale = 'all';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
@php( $locale = core()->getRequestedLocaleCode())
|
||||||
|
|
||||||
@extends('admin::layouts.content')
|
@extends('admin::layouts.content')
|
||||||
|
|
||||||
@section('page_title')
|
@section('page_title')
|
||||||
|
|
@ -16,6 +18,20 @@
|
||||||
{{ __('admin::app.catalog.categories.add-title') }}
|
{{ __('admin::app.catalog.categories.add-title') }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<select class="control" id="locale-switcher" name="locale"
|
||||||
|
onchange="reloadPage('locale', this.value)">
|
||||||
|
<option value="all" {{ ! isset($locale) ? 'selected' : '' }}>
|
||||||
|
{{ __('admin::app.admin.system.all-locales') }}
|
||||||
|
</option>
|
||||||
|
@foreach (core()->getAllLocales() as $localeModel)
|
||||||
|
<option
|
||||||
|
value="{{ $localeModel->code }}" {{ (isset($locale) && ($localeModel->code) == $locale) ? 'selected' : '' }}>
|
||||||
|
{{ $localeModel->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!! view_render_event('bagisto.admin.catalog.categories.list.before') !!}
|
{!! view_render_event('bagisto.admin.catalog.categories.list.before') !!}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue