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

View File

@ -1,19 +1,15 @@
<!-- $o=Binary\JpegPhoto::class -->
<!-- @todo We are not handling redirect backs with updated photos --> <!-- @todo We are not handling redirect backs with updated photos -->
<div class="row pt-2"> <!-- $o=Binary\JpegPhoto::class -->
<div class="col-1"></div> <x-attribute.layout :edit="$edit" :new="false" :o="$o">
<div class="col-10 p-2">
<div id="{{ $o->name_lc }}">
<table class="table table-borderless p-0 m-0"> <table class="table table-borderless p-0 m-0">
@foreach ($o->values as $value) @foreach ($o->values as $value)
<div class="input-group has-validation">
<tr> <tr>
@switch ($x=$f->buffer($value,FILEINFO_MIME_TYPE)) @switch ($x=$f->buffer($value,FILEINFO_MIME_TYPE))
@case('image/jpeg') @case('image/jpeg')
@default @default
<td> <td>
<input type="hidden" name="{{ $o->name_lc }}[]" value="{{ md5($value) }}"> <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) @if ($edit)
<br> <br>
@ -29,12 +25,6 @@
</td> </td>
@endswitch @endswitch
</tr> </tr>
</div>
@endforeach @endforeach
</table> </table>
</div> </x-attribute.layout>
<!-- @todo TO IMPLEMENT -->
@include('components.attribute.widget.options')
</div>
</div>

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

View File

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