fix (research-backed): admin upload limits via mounted php.ini conf.d (artisan serve child ignores -d flags — Filament docs: set php.ini); user photo preview always rendered (was conditional -> FileReader target missing); PNG upload+save+display verified
This commit is contained in:
@@ -27,9 +27,9 @@
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Photo</label>
|
||||
<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}}
|
||||
<img id="photo-preview" src="{{if .Data.PhotoUrl.Valid}}{{.Data.PhotoUrl.String}}{{end}}" alt="Photo" class="h-24 w-24 rounded-lg object-cover {{if not .Data.PhotoUrl.Valid}}hidden{{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); }">
|
||||
<input type="file" name="photo" accept="image/*" class="text-sm" onchange="var f=this.files[0]; if(f){ var p=document.getElementById('photo-preview'); p.classList.remove('hidden'); var r=new FileReader(); r.onload=function(e){ p.src=e.target.result; }; 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>
|
||||
|
||||
Reference in New Issue
Block a user