Standardise attribute layout

This commit is contained in:
Deon George 2024-01-09 23:28:17 +11:00
parent c02f390f64
commit 1f753c4dc6
5 changed files with 93 additions and 114 deletions

View File

@ -1,8 +1,5 @@
<!-- $o=Attribute::class -->
<div class="row pt-2">
<div class="col-1"></div>
<div class="col-10 p-2">
<div id="{{ $o->name_lc }}">
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
@foreach (old($o->name_lc,$new ? [NULL] : $o->values) as $value)
@if ($edit && ! $o->is_rdn)
<div class="input-group has-validation">
@ -19,8 +16,4 @@
{{ $value }}
@endif
@endforeach
</div>
@include('components.attribute.widget.options')
</div>
</div>
</x-attribute.layout>

View File

@ -1,19 +1,15 @@
<!-- $o=Binary\JpegPhoto::class -->
<!-- @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 }}">
<!-- $o=Binary\JpegPhoto::class -->
<x-attribute.layout :edit="$edit" :new="false" :o="$o">
<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 />
<img class="jpegphoto @if($e=$errors->get($o->name_lc.'.'.$loop->index))is-invalid @endif" src="data:{{ $x }};base64, {{ base64_encode($value) }}" />
@if ($edit)
<br>
@ -29,12 +25,6 @@
</td>
@endswitch
</tr>
</div>
@endforeach
</table>
</div>
<!-- @todo TO IMPLEMENT -->
@include('components.attribute.widget.options')
</div>
</div>
</x-attribute.layout>

View File

@ -0,0 +1,10 @@
<div class="row pt-2">
<div class="col-1 @if(! $edit)d-none @endif"></div>
<div class="col-10 p-2">
<div id="{{ $o->name_lc }}">
{{ $slot }}
</div>
<x-attribute.widget.options :o="$o" :edit="$edit" :new="$new"></x-attribute.widget.options>
</div>
</div>

View File

@ -1,8 +1,5 @@
<!-- $o=Attribute::class -->
<div class="row">
<div class="col-1"></div>
<div class="col-10 p-2">
<div id="{{ $o->name_lc }}">
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
@foreach (old($o->name_lc,$o->values) as $value)
@if ($edit && ($value === NULL || (! $o->isStructural($value))))
<div class="input-group has-validation">
@ -22,8 +19,4 @@
<br>
@endif
@endforeach
</div>
@include('components.attribute.widget.options')
</div>
</div>
</x-attribute.layout>

View File

@ -1,9 +1,6 @@
<!-- $o=Password::class -->
<!-- @todo We are not handling redirect backs with updated values -->
<div class="row pt-2">
<div class="col-1"></div>
<div class="col-10 p-2">
<div id="{{ $o->name_lc }}">
<!-- $o=Password::class -->
<x-attribute.layout :edit="$edit" :new="$new" :o="$o">
@foreach ($o->values as $value)
@if ($edit)
<div class="input-group has-validation">
@ -19,12 +16,8 @@
{{ $value }}<br>
@endif
@endforeach
</div>
@include('components.attribute.widget.options')
<span class="p-0 m-0">
<span class="btn btn-sm btn-outline-dark mt-3"><i class="fas fa-user-check"></i> @lang('Check Password')</span>
</span>
</div>
</div>
</x-attribute.layout>