Introduce locale select component and make replacement on profile page
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
<div class="col-md-7">
|
||||
|
||||
@if (!config('app.lock_passwords'))
|
||||
{!! Form::locales('locale', old('locale', $user->locale), 'select2') !!}
|
||||
<x-input.locale-select name="locales" :selected="old('locale', $user->locale)"/>
|
||||
{!! $errors->first('locale', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@else
|
||||
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
||||
|
||||
24
resources/views/blade/input/locale-select.blade.php
Normal file
24
resources/views/blade/input/locale-select.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
@props([
|
||||
'name' => 'locale',
|
||||
'selected' => null,
|
||||
])
|
||||
<div>
|
||||
<select
|
||||
name="{{ $name }}"
|
||||
{{ $attributes->merge(['class' => 'select2', 'style' => 'width:100%']) }}
|
||||
aria-label="{{ $name }}"
|
||||
data-placeholder="{{ trans('localizations.select_language') }}"
|
||||
>
|
||||
<option value="" role="option">{{ trans('localizations.select_language') }}</option>'
|
||||
@foreach (trans('localizations.languages') as $abbr => $locale)
|
||||
<option
|
||||
value="{{ $abbr }}"
|
||||
role="option"
|
||||
@selected($abbr == $selected)
|
||||
aria-selected="{{ $abbr == $selected ? 'true' : 'false' }}"
|
||||
>
|
||||
{{ $locale }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
Reference in New Issue
Block a user