From 240b46aa9ea0b999ae8339b6bcb10c87b1e2d3b5 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 12 Mar 2025 22:28:23 +1100 Subject: [PATCH] Some jquery selector changes, change some button spans to buttons, set readonly on the form for attribute javascript, fix krbTicketFlags to only be changed when in edit mode --- .../components/attribute/krbticketflags.blade.php | 3 +++ .../components/attribute/widget/options.blade.php | 2 +- resources/views/frames/dn.blade.php | 11 +++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/resources/views/components/attribute/krbticketflags.blade.php b/resources/views/components/attribute/krbticketflags.blade.php index c10d7aa8..bad7d557 100644 --- a/resources/views/components/attribute/krbticketflags.blade.php +++ b/resources/views/components/attribute/krbticketflags.blade.php @@ -51,6 +51,9 @@ $('attribute#krbTicketFlags').find('i') .on('click',function() { var item = $(this); + if ($('form#dn-edit').attr('readonly')) + return; + var key = Number(item.attr('id').substring(1)); if (item.data('old') === undefined) diff --git a/resources/views/components/attribute/widget/options.blade.php b/resources/views/components/attribute/widget/options.blade.php index 5dbccb70..977b0a20 100644 --- a/resources/views/components/attribute/widget/options.blade.php +++ b/resources/views/components/attribute/widget/options.blade.php @@ -220,7 +220,7 @@ @default @php($clone=TRUE) - (! $new)]) id="{{ $o->name }}-addnew"> @lang('Add Value') + @section('page-scripts') @if($clone && $edit && $o->can_addvalues) diff --git a/resources/views/frames/dn.blade.php b/resources/views/frames/dn.blade.php index e36977a9..f53c2827 100644 --- a/resources/views/frames/dn.blade.php +++ b/resources/views/frames/dn.blade.php @@ -23,7 +23,7 @@
-
+ @csrf @@ -156,9 +156,12 @@ function editmode() { $('#dn-edit input[name="dn"]').val(dn); + $('form#dn-edit').attr('readonly',false); $('button[id=entry-edit]') .removeClass('btn-outline-dark') - .addClass('btn-dark'); + .addClass('btn-dark') + .addClass('opacity-100') + .attr('disabled',true); // Find all input items and turn off readonly $('input.form-control').each(function() { @@ -175,8 +178,8 @@ }) $('.row.d-none').removeClass('d-none'); - $('.addable.d-none').removeClass('d-none'); - $('.deletable.d-none').removeClass('d-none'); + $('button.addable.d-none').removeClass('d-none'); + $('button.deletable.d-none').removeClass('d-none'); @if($o->getMissingAttributes()->count()) $('#newattr-select.d-none').removeClass('d-none');