fix: remove photo_url text input from user form (photo only via file upload; handler keeps existing photo when no file); livewire config published (disk=local, 12MB, 2min upload — was 5s default breaking admin temp uploads)

This commit is contained in:
2026-08-10 15:07:15 +10:00
parent f5e5989c64
commit ab3aa5aee9
2 changed files with 11 additions and 10 deletions

View File

@@ -26,10 +26,13 @@
</div>
<div>
<label class="block text-sm font-medium">Photo</label>
{{if .Data.PhotoUrl.Valid}}<img src="{{.Data.PhotoUrl.String}}" alt="Current photo" class="mb-2 h-24 w-24 rounded-lg object-cover">{{end}}
<input type="file" name="photo" accept="image/*" class="mt-1 text-sm">
<p class="mt-1 text-xs text-stone-500">Choose a photo and press Save — or paste an image URL below.</p>
<input name="photo_url" type="text" value="{{if .Data.PhotoUrl.Valid}}{{.Data.PhotoUrl.String}}{{end}}" class="mt-1 w-full rounded border border-stone-300 px-3 py-2" placeholder="https://…">
<div class="flex items-center gap-3">
{{if .Data.PhotoUrl.Valid}}<img src="{{.Data.PhotoUrl.String}}" alt="Current photo" class="h-24 w-24 rounded-lg object-cover">{{else}}<img id="photo-preview" class="hidden h-24 w-24 rounded-lg object-cover" alt="New photo">{{end}}
<div>
<input type="file" name="photo" accept="image/*" class="text-sm" onchange="var f=this.files[0]; if(f){ var r=new FileReader(); r.onload=function(e){ var p=document.getElementById('photo-preview'); p.src=e.target.result; p.classList.remove('hidden'); }; r.readAsDataURL(f); }">
<p class="mt-1 text-xs text-stone-500">Choose a photo and press Save. If you choose nothing, the current photo is kept.</p>
</div>
</div>
</div>
<div>
<label class="block text-sm font-medium">Phone number (shown to finders)</label>