diff --git a/app/Http/Requests/ToggleShoppingItemRequest.php b/app/Http/Requests/ToggleShoppingItemRequest.php index 0900d58..5681906 100644 --- a/app/Http/Requests/ToggleShoppingItemRequest.php +++ b/app/Http/Requests/ToggleShoppingItemRequest.php @@ -3,6 +3,7 @@ namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; +use Illuminate\Validation\Rules\File; class ToggleShoppingItemRequest extends FormRequest { @@ -34,7 +35,11 @@ class ToggleShoppingItemRequest extends FormRequest 'store_id' => ['nullable', 'integer', 'exists:stores,id'], 'new_store_name' => ['nullable', 'string', 'max:255'], 'price_decimal' => ['nullable', 'numeric', 'min:0', 'max:999999.99'], - 'photo' => ['nullable', 'image', 'max:5120'], + 'photo' => [ + 'nullable', + File::types(['jpg', 'jpeg', 'png', 'gif', 'webp', 'heic', 'heif']) + ->max(15 * 1024), + ], ]; } @@ -49,8 +54,7 @@ class ToggleShoppingItemRequest extends FormRequest 'price_decimal.numeric' => 'Der Preis muss eine Zahl sein.', 'price_decimal.min' => 'Der Preis darf nicht negativ sein.', 'price_decimal.max' => 'Der Preis ist zu gross.', - 'photo.image' => 'Das Foto muss ein Bild sein.', - 'photo.max' => 'Das Foto darf maximal 5 MB gross sein.', + 'photo.max' => 'Das Foto darf maximal 15 MB gross sein.', ]; } diff --git a/resources/views/shopping-list/index.blade.php b/resources/views/shopping-list/index.blade.php index 2ff3c0d..2d0ccd5 100644 --- a/resources/views/shopping-list/index.blade.php +++ b/resources/views/shopping-list/index.blade.php @@ -150,6 +150,7 @@ loading="lazy" > + Foto oeffnen (bei HEIC oft noetig) @endif @@ -157,7 +158,7 @@ @include('shopping-list.partials.item-pencil-panel', [ 'item' => $item, 'stores' => $stores, - 'showToggleExtras' => false, + 'showToggleExtras' => true, ]) diff --git a/resources/views/shopping-list/partials/item-pencil-panel.blade.php b/resources/views/shopping-list/partials/item-pencil-panel.blade.php index 293f132..4a9cfa5 100644 --- a/resources/views/shopping-list/partials/item-pencil-panel.blade.php +++ b/resources/views/shopping-list/partials/item-pencil-panel.blade.php @@ -62,8 +62,20 @@ @if($showToggleExtras)
-Beim Abhaken (optional)
-Preis und Foto nur noetig, wenn du sie gleich mit erfassen willst – reicht auch die Checkbox in der Liste.
++ @if($item->is_done) + Preis / Foto (optional) + @else + Beim Abhaken (optional) + @endif +
++ @if($item->is_done) + Neuen Kassenbon oder Preis eintragen. JPEG/PNG/WebP werden ueberall angezeigt; iPhone-HEIC: ggf. Foto-Link nutzen. + @else + Preis und Foto nur noetig, wenn du sie gleich mit erfassen willst – reicht auch die Checkbox in der Liste. + @endif +
@endif