|
18 | 18 | {{-- profile photo file input --}} |
19 | 19 | <input type="file" id="photo" class="hidden" wire:model.live="photo" x-ref="photo" |
20 | 20 | x-on:change=" |
21 | | - photoName = $refs.photo.files[0].name; |
22 | | - const reader = new FileReader(); |
23 | | - reader.onload = (e) => { |
24 | | - photoPreview = e.target.result; |
25 | | - }; |
26 | | - reader.readAsDataURL($refs.photo.files[0]); |
27 | | - " /> |
| 21 | + photoName = $refs.photo.files[0].name; |
| 22 | + const reader = new FileReader(); |
| 23 | + reader.onload = (e) => { |
| 24 | + photoPreview = e.target.result; |
| 25 | + }; |
| 26 | + reader.readAsDataURL($refs.photo.files[0]); |
| 27 | + " /> |
28 | 28 |
|
29 | 29 | <x-label for="photo" value="{{ __('user.photo') }} :" /> |
30 | 30 |
|
|
103 | 103 | <div class="col-span-6 md:col-span-4"> |
104 | 104 | <x-label for="timezone" value="{{ __('user.timezone') }} :" /> |
105 | 105 | <select id="timezone" class="block w-full mt-1 rounded-sm" name="timezone" wire:model="state.timezone" required> |
106 | | - @foreach (timezone_identifiers_list() as $timezone) |
107 | | - <option value="{{ $timezone }}" @selected(old('timezone') === $timezone)>{{ $timezone }}</option> |
| 106 | + @php |
| 107 | + $timezones = collect(timezone_identifiers_list()) |
| 108 | + ->groupBy(fn($tz) => str_contains($tz, '/') ? explode('/', $tz)[0] : 'Other') |
| 109 | + ->sortKeys(); |
| 110 | + @endphp |
| 111 | + |
| 112 | + @foreach ($timezones as $continent => $zones) |
| 113 | + <optgroup label="{{ $continent }}"> |
| 114 | + @foreach ($zones as $timezone) |
| 115 | + <option value="{{ $timezone }}" @selected(old('timezone') === $timezone)> |
| 116 | + {{ str_replace('_', ' ', $timezone) }} |
| 117 | + </option> |
| 118 | + @endforeach |
| 119 | + </optgroup> |
108 | 120 | @endforeach |
109 | 121 | </select> |
110 | 122 | </div> |
|
0 commit comments