Added the ability to save user settings.
This commit is contained in:
12
resources/views/private/components/forms/select.blade.php
Normal file
12
resources/views/private/components/forms/select.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="mb-4">
|
||||
<label for="form-select-{{ $requestName }}">{{ $title }}</label>
|
||||
<select id="form-select-{{ $requestName }}" aria-label="{{ $title }}" class="form-select @error($requestName) is-invalid @enderror" name="{{ $name }}" {{ $attributes }}>
|
||||
{{ $slot }}
|
||||
@foreach($list as $elementKey => $elementValue)
|
||||
<option value="{{ $elementKey }}" @selected((string) $elementKey === (string) $value)>{{ $elementValue }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error($name)
|
||||
<span class="invalid-feedback">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
23
resources/views/private/profile/settings.blade.php
Normal file
23
resources/views/private/profile/settings.blade.php
Normal file
@@ -0,0 +1,23 @@
|
||||
@section('meta_title', __('Settings'))
|
||||
@section('h1', __('Settings'))
|
||||
<x-private.layout>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
<div class="card border-0 shadow components-section">
|
||||
<div class="card-body">
|
||||
<form method="post" action="{{ route('profile.update-settings') }}">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<x-private.forms.select :title="__('validation.attributes.lang')" name="lang" :list="$languages" :value="$user->lang?->value">
|
||||
<option value="">{{ __('Default') }}</option>
|
||||
</x-private.forms.select>
|
||||
<x-private.forms.select :title="__('validation.attributes.timezone')" name="timezone" :list="$timezone" :value="$user->timezone">
|
||||
<option value="">{{ __('Default') }}</option>
|
||||
</x-private.forms.select>
|
||||
<button class="btn btn-primary" type="submit">{{ __('Save') }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-private.layout>
|
Reference in New Issue
Block a user