Fix display of password attributes and update processing with jpegphoto and password

This commit is contained in:
2024-01-09 17:44:50 +11:00
parent c8fffd6d81
commit c02f390f64
9 changed files with 237 additions and 66 deletions

View File

@@ -1,33 +1,40 @@
<!-- $o=Binary\JpegPhoto::class -->
@if($edit)
<div class="input-group has-validation @if($e=$errors->get($o->name_lc))is-invalid @endif">
@endif
<!-- @todo We are not handling redirect backs with updated photos -->
<div class="row pt-2">
<div class="col-1"></div>
<div class="col-10 p-2">
<div id="{{ $o->name_lc }}">
<table class="table table-borderless p-0 m-0">
@foreach ($o->values as $value)
<div class="input-group has-validation">
<tr>
@switch ($x=$f->buffer($value,FILEINFO_MIME_TYPE))
@case('image/jpeg')
@default
<td>
<input type="hidden" name="{{ $o->name_lc }}[]" value="{{ md5($value) }}">
<img class="jpegphoto" src="data:{{ $x }};base64, {{ base64_encode($value) }}" @if($e=$errors->get($o->name_lc.'.'.$loop->index))is-invalid @endif />
<table class="table table-borderless p-0 m-0">
<tr>
@foreach ($o->values as $value)
@switch ($x=$f->buffer($value,FILEINFO_MIME_TYPE))
@case('image/jpeg')
@default
<td>
<input type="hidden" name="{{ $o->name_lc }}[]" value="{{ md5($value) }}">
<img class="jpegphoto" src="data:{{ $x }};base64, {{ base64_encode($value) }}" />
@if ($edit)
<br>
<!-- @todo TO IMPLEMENT -->
<span class="btn btn-sm btn-danger deletable d-none"><i class="fas fa-trash-alt"></i> @lang('Delete')</span>
@if($edit)
<br><span class="btn btn-sm btn-danger deletable d-none"><i class="fas fa-trash-alt"></i> @lang('Delete')</span>
@endif
</td>
@endswitch
@endforeach
</tr>
</table>
<div class="invalid-feedback pb-2">
@if($e)
{{ join('|',$e) }}
@endif
</div>
@endif
</td>
@endswitch
</tr>
</div>
@endforeach
</table>
</div>
@if($edit)
<div class="invalid-feedback pb-2">
@if($e)
{{ join('|',$e) }}
@endif
<!-- @todo TO IMPLEMENT -->
@include('components.attribute.widget.options')
</div>
</div>
@endif
</div>