Compare commits

..

7 Commits

Author SHA1 Message Date
52d808071c Revert version to 2.2.1-dev
All checks were successful
Create Docker Image / Test Application (x86_64) (push) Successful in 28s
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 1m34s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 2m50s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
2025-07-03 13:17:25 +08:00
305ef0f5a3 Minor code consistency changes, no functional changes 2025-07-03 13:17:25 +08:00
f1316d698d Implement DN Entry rename 2025-07-03 13:17:25 +08:00
339ba7258a Make the ajax calls POST methods, and make the 'Create Entry' in the tree configurable so calls to children() can just return child entries 2025-07-03 13:17:25 +08:00
883ac5d90f Dont render delete button on Entries that have subordinates 2025-07-03 13:17:13 +08:00
46277146c5 Fix rendering of Add Value attributes when the attribute is also rendered by a template, resulting in double javascript and blank values 2025-07-03 13:16:58 +08:00
06747064d4 Fix add new attributes where being marked as readonly 2025-07-03 13:16:58 +08:00
7 changed files with 17 additions and 16 deletions

View File

@ -172,6 +172,8 @@ class Attribute implements \Countable, \ArrayAccess
'required_by' => $this->schema?->required_by_object_classes ?: collect(),
// Used in Object Classes
'used_in' => $this->schema?->used_in_object_classes ?: collect(),
// For single value attributes
'value' => $this->schema?->is_single_value ? $this->values->first() : NULL,
// The current attribute values
'values' => ($this->no_attr_tags || $this->is_internal) ? $this->tagValues() : $this->_values,
// The original attribute values

View File

@ -437,7 +437,7 @@ class HomeController extends Controller
->with('page_actions',collect([
'copy'=>FALSE,
'create'=>($x=($o->getObjects()->except('entryuuid')->count() > 0)),
'delete'=>$x,
'delete'=>(! is_null($xx=$o->getObject('hassubordinates')->value)) && ($xx === 'FALSE'),
'edit'=>$x,
'export'=>$x,
])),

View File

@ -46,7 +46,7 @@
</span>
@endif
@if((! $o->no_attr_tags) && (! $o->is_rdn))
@if((! $o->no_attr_tags) && (! $o->is_rdn) && (! $template))
<span data-bs-toggle="tab" href="#langtag-{{ $o->name_lc }}-+" class="bg-primary-subtle btn btn-outline-primary border-primary addable d-none">
<i class="fas fa-fw fa-plus text-dark" data-bs-toggle="tooltip" data-bs-custom-class="custom-tooltip" aria-label="Add Lang Tag" data-bs-original-title="Add Lang Tag"></i>
</span>

View File

@ -1,5 +1,5 @@
<!-- $o=Attribute::class -->
<x-attribute.layout :edit="$edit=($edit ?? FALSE)" :new="$new=($new ?? FALSE)" :o="$o">
<x-attribute.layout :edit="$edit=($edit ?? FALSE)" :new="$new=($new ?? FALSE)" :o="$o" :template="$template">
<div class="col-12">
<div class="tab-content">
@foreach($o->langtags as $langtag)
@ -22,7 +22,7 @@
name="{{ $o->name_lc }}[{{ $langtag }}][]"
value="{{ $value ?: ($av ?? '') }}"
placeholder="{{ ! is_null($x=$tv->get($loop->index)) ? $x : '['.__('NEW').']' }}"
readonly
@readonly(! $edit)
@disabled($o->isDynamic())>
<div class="invalid-feedback pb-2">

View File

@ -4,7 +4,7 @@
{{ $slot }}
</attribute>
<x-attribute.widget.options :o="$o" :edit="$edit" :new="$new"/>
<x-attribute.widget.options :o="$o" :edit="$edit" :new="$new" :template="$template ?? FALSE"/>
</div>
</div>

View File

@ -255,18 +255,18 @@
@default
@if($o->isDynamic()) @break @endif
@php($clone=TRUE)
@if($o->values_old->count())
<span @class(['btn','btn-sm','btn-outline-primary','mt-3','addable','d-none'=>(! $new)]) data-attribute="{{ $o->name }}" id="{{ $o->name_lc }}-addnew"><i class="fas fa-fw fa-plus"></i> @lang('Add Value')</span>
@if($o->values_old->count() && (! $template))
<span @class(['btn','btn-sm','btn-outline-primary','mt-3','addable','d-none'=>(! $new)]) data-attribute="{{ $o->name_lc }}" id="{{ $o->name_lc }}-addnew"><i class="fas fa-fw fa-plus"></i> @lang('Add Value')</span>
@endif
@section('page-scripts')
@if($clone && $edit && $o->can_addvalues)
@if((! $template) && $clone && $edit && $o->can_addvalues)
<script type="text/javascript">
$(document).ready(function() {
// Create a new entry when Add Value clicked
$('#{{ $o->name_lc }}-addnew.addable').click(function(item) {
$('form#dn-edit #{{ $o->name_lc }}-addnew.addable').click(function(item) {
var attribute = $(this).data('attribute');
var active = $('attribute[id='+attribute+']').find('.tab-pane.active');
var active = $('#template-default attribute[id='+attribute+']');
active.find('input:last')
.clone()

View File

@ -9,30 +9,29 @@
<div class="col">
<div class="action-buttons float-end">
<ul class="nav">
@if(isset($page_actions) && $page_actions->get('create'))
@if($page_actions->get('create'))
<li>
<button class="btn btn-outline-dark p-1 m-1" id="entry-create" data-bs-toggle="tooltip" data-bs-placement="bottom" title="@lang('Create Child Entry')"><i class="fas fa-fw fa-diagram-project fs-5"></i></button>
</li>
@endif
@if(isset($page_actions) && $page_actions->get('export'))
@if($page_actions->get('export'))
<li>
<span id="entry-export" data-bs-toggle="modal" data-bs-target="#page-modal">
<button class="btn btn-outline-dark p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="@lang('Export')"><i class="fas fa-fw fa-download fs-5"></i></button>
</span>
</li>
@endif
@if(isset($page_actions) && $page_actions->get('copy'))
@if($page_actions->get('copy'))
<li>
<button class="btn btn-outline-dark p-1 m-1" id="entry-copy-move" data-bs-toggle="tooltip" data-bs-placement="bottom" title="@lang('Copy/Move')" disabled><i class="fas fa-fw fa-copy fs-5"></i></button>
</li>
@endif
@if(isset($page_actions) && $page_actions->get('edit'))
@if($page_actions->get('edit'))
<li>
<button class="btn btn-outline-dark p-1 m-1" id="entry-edit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="@lang('Edit Entry')"><i class="fas fa-fw fa-edit fs-5"></i></button>
</li>
@endif
<!-- @todo Dont offer the delete button for an entry with children -->
@if(isset($page_actions) && $page_actions->get('delete'))
@if($page_actions->get('delete'))
<li>
<span id="entry-delete" data-bs-toggle="modal" data-bs-target="#page-modal">
<button class="btn btn-outline-danger p-1 m-1" data-bs-custom-class="custom-tooltip-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="@lang('Delete Entry')"><i class="fas fa-fw fa-trash-can fs-5"></i></button>