From 543250e1fb2b4da0cba9bf76de1347f38b3eda84 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 22 Jun 2025 22:10:21 +1000 Subject: [PATCH] Fix entry-userpassword-check when entry is rendered with a template --- .../components/attribute/password.blade.php | 4 +- .../views/fragment/template/dn.blade.php | 2 +- resources/views/frames/dn.blade.php | 43 ++++++++++--------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/resources/views/components/attribute/password.blade.php b/resources/views/components/attribute/password.blade.php index 77b5c103..546cb54f 100644 --- a/resources/views/components/attribute/password.blade.php +++ b/resources/views/components/attribute/password.blade.php @@ -4,7 +4,7 @@ @foreach(($o->tagValues($langtag)->count() ? $o->tagValues($langtag) : [$langtag => NULL]) as $key => $value) @if($edit)
- + ($e=$errors->get($o->name_lc.'.'.$langtag.'.'.$loop->index)),'mb-1','border-focus'=>! $o->tagValuesOld($langtag)->contains($value),'bg-success-subtle'=>$updated]) name="{{ $o->name_lc }}[{{ $langtag }}][]" value="{{ Arr::get(old($o->name_lc),$langtag.'.'.$loop->index,$value ? md5($value) : '') }}" @readonly(! $new)>
@@ -24,7 +24,7 @@
- +
diff --git a/resources/views/fragment/template/dn.blade.php b/resources/views/fragment/template/dn.blade.php index f0c4c5f6..7fe9100d 100644 --- a/resources/views/fragment/template/dn.blade.php +++ b/resources/views/fragment/template/dn.blade.php @@ -8,7 +8,7 @@
@php($up=(session()->get('updated') ?: collect())) - @foreach($o->getVisibleAttributes()->filter(fn($item)=>$template->attributes->map('strtolower')->contains($item->name_lc)) as $ao) + @foreach($o->getVisibleAttributes()->filter(fn($item)=>$template->attributes->keys()->map('strtolower')->contains($item->name_lc)) as $ao) @endforeach
diff --git a/resources/views/frames/dn.blade.php b/resources/views/frames/dn.blade.php index 4120f4cd..37dc2053 100644 --- a/resources/views/frames/dn.blade.php +++ b/resources/views/frames/dn.blade.php @@ -282,27 +282,30 @@ }) break; - case 'entry-userpassword-check': - $.ajax({ - method: 'GET', - url: '{{ url('modal/userpassword-check') }}/'+dn, - dataType: 'html', - cache: false, - beforeSend: function() { - that.empty().append(''); - }, - success: function(data) { - that.empty().html(data); - }, - error: function(e) { - if (e.status !== 412) - alert('That didnt work? Please try again....'); - }, - }) - break; - default: - console.log('No action for button:'+$(item.relatedTarget).attr('id')); + switch ($(item.relatedTarget).attr('name')) { + case 'entry-userpassword-check': + $.ajax({ + method: 'GET', + url: '{{ url('modal/userpassword-check') }}/'+dn, + dataType: 'html', + cache: false, + beforeSend: function() { + that.empty().append(''); + }, + success: function(data) { + that.empty().html(data); + }, + error: function(e) { + if (e.status !== 412) + alert('That didnt work? Please try again....'); + }, + }) + break; + + default: + console.log('No action for button:'+$(item.relatedTarget).attr('id')); + } } });