fix(app-ui): color 型部位無 width/height 鍵導致 Undefined array key — blade 讀尺寸改 null 安全($part['width'] ?? null)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a0553258f8
commit
68c772b06b
@ -60,7 +60,7 @@
|
|||||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-100 dark:border-gray-700 p-4" x-data="{ thumb: @js($currentThumb) }">
|
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-100 dark:border-gray-700 p-4" x-data="{ thumb: @js($currentThumb) }">
|
||||||
<label class="block text-sm font-semibold text-gray-800 dark:text-gray-100 mb-2">
|
<label class="block text-sm font-semibold text-gray-800 dark:text-gray-100 mb-2">
|
||||||
{{ $part['label'] }}
|
{{ $part['label'] }}
|
||||||
@if($part['width'])<span class="text-xs font-normal text-gray-400">({{ $part['width'] }}x{{ $part['height'] }})</span>@endif
|
@if($part['width'] ?? null)<span class="text-xs font-normal text-gray-400">({{ $part['width'] }}x{{ $part['height'] }})</span>@endif
|
||||||
</label>
|
</label>
|
||||||
<select name="parts[{{ $key }}]"
|
<select name="parts[{{ $key }}]"
|
||||||
@change="thumb = ($event.target.selectedOptions[0]?.dataset.thumb) || ''"
|
@change="thumb = ($event.target.selectedOptions[0]?.dataset.thumb) || ''"
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
<label class="text-gray-600 dark:text-gray-400 text-sm block mb-1">{{ __('Category') }} <span class="text-rose-500">*</span></label>
|
<label class="text-gray-600 dark:text-gray-400 text-sm block mb-1">{{ __('Category') }} <span class="text-rose-500">*</span></label>
|
||||||
<select name="part_key" required class="w-full px-3 py-2 bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 border rounded-md text-gray-900 dark:text-gray-200 focus:ring-2 focus:ring-cyan-500">
|
<select name="part_key" required class="w-full px-3 py-2 bg-white dark:bg-gray-700 border-gray-300 dark:border-gray-600 border rounded-md text-gray-900 dark:text-gray-200 focus:ring-2 focus:ring-cyan-500">
|
||||||
@foreach($parts as $key => $part)
|
@foreach($parts as $key => $part)
|
||||||
<option value="{{ $key }}">{{ $part['label'] }}{{ $part['width'] ? ' — '.$part['width'].'x'.$part['height'] : '' }}</option>
|
<option value="{{ $key }}">{{ $part['label'] }}{{ ($part['width'] ?? null) ? ' — '.$part['width'].'x'.$part['height'] : '' }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<p class="text-xs text-gray-400 mt-1">{{ __('Image will be center-cropped to the category size.') }}</p>
|
<p class="text-xs text-gray-400 mt-1">{{ __('Image will be center-cropped to the category size.') }}</p>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user