Display a DN entry with language tags - work for #16

This commit is contained in:
2025-03-23 22:16:26 +11:00
parent 705bfb2d64
commit 633513d3e9
12 changed files with 132 additions and 50 deletions

View File

@@ -1,31 +1,22 @@
<!-- $o=Attribute::class -->
<x-attribute.layout :edit="$edit ?? FALSE" :new="$new ?? FALSE" :o="$o">
@foreach(old($o->name_lc,($new ?? FALSE) ? [NULL] : $o->values) as $tag=>$tagvalues)
<div class="row p-2 border rounded">
<div class="col-2">
{{ $tag }}
</div>
<div class="col-10">
<div class="row">
<div class="col-12">
@foreach($tagvalues as $value)
@if(($edit ?? FALSE) && ! $o->is_rdn)
<div class="input-group has-validation">
<input type="text" @class(['form-control','is-invalid'=>($e=$errors->get($o->name_lc.'.'.$loop->index)),'mb-1','border-focus'=>($o->values->contains($value))]) name="{{ $o->name_lc }}[]" value="{{ $value }}" placeholder="{{ ! is_null($x=Arr::get($o->values,$loop->index)) ? $x : '['.__('NEW').']' }}" @readonly(! ($new ?? FALSE))>
@foreach(old($o->name_lc,($new ?? FALSE) ? [NULL] : $o->tagValues($langtag)) as $values)
<div class="col-12">
@foreach($values as $value)
@if(($edit ?? FALSE) && ! $o->is_rdn)
<div class="input-group has-validation">
<input type="text" @class(['form-control','is-invalid'=>($e=$errors->get($o->name_lc.'.'.$loop->index)),'mb-1','border-focus'=>($o->values->contains($value))]) name="{{ $o->name_lc }}[]" value="{{ $value }}" placeholder="{{ ! is_null($x=Arr::get($o->values,$loop->index)) ? $x : '['.__('NEW').']' }}" @readonly(! ($new ?? FALSE))>
<div class="invalid-feedback pb-2">
@if($e)
{{ join('|',$e) }}
@endif
</div>
</div>
@else
{{ $value }}
<div class="invalid-feedback pb-2">
@if($e)
{{ join('|',$e) }}
@endif
@endforeach
</div>
</div>
</div>
</div>
@else
{{ $value }}
@endif
@endforeach
</div>
@endforeach
</x-attribute.layout>