Dont render delete button on Entries that have subordinates
This commit is contained in:
parent
46277146c5
commit
883ac5d90f
@ -172,6 +172,8 @@ class Attribute implements \Countable, \ArrayAccess
|
|||||||
'required_by' => $this->schema?->required_by_object_classes ?: collect(),
|
'required_by' => $this->schema?->required_by_object_classes ?: collect(),
|
||||||
// Used in Object Classes
|
// Used in Object Classes
|
||||||
'used_in' => $this->schema?->used_in_object_classes ?: collect(),
|
'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
|
// The current attribute values
|
||||||
'values' => ($this->no_attr_tags || $this->is_internal) ? $this->tagValues() : $this->_values,
|
'values' => ($this->no_attr_tags || $this->is_internal) ? $this->tagValues() : $this->_values,
|
||||||
// The original attribute values
|
// The original attribute values
|
||||||
|
@ -412,7 +412,7 @@ class HomeController extends Controller
|
|||||||
->with('page_actions',collect([
|
->with('page_actions',collect([
|
||||||
'copy'=>FALSE,
|
'copy'=>FALSE,
|
||||||
'create'=>($x=($o->getObjects()->except('entryuuid')->count() > 0)),
|
'create'=>($x=($o->getObjects()->except('entryuuid')->count() > 0)),
|
||||||
'delete'=>$x,
|
'delete'=>(! is_null($xx=$o->getObject('hassubordinates')->value)) && ($xx === 'FALSE'),
|
||||||
'edit'=>$x,
|
'edit'=>$x,
|
||||||
'export'=>$x,
|
'export'=>$x,
|
||||||
])),
|
])),
|
||||||
|
@ -9,30 +9,29 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="action-buttons float-end">
|
<div class="action-buttons float-end">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
@if(isset($page_actions) && $page_actions->get('create'))
|
@if($page_actions->get('create'))
|
||||||
<li>
|
<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>
|
<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>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@if(isset($page_actions) && $page_actions->get('export'))
|
@if($page_actions->get('export'))
|
||||||
<li>
|
<li>
|
||||||
<span id="entry-export" data-bs-toggle="modal" data-bs-target="#page-modal">
|
<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>
|
<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>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@if(isset($page_actions) && $page_actions->get('copy'))
|
@if($page_actions->get('copy'))
|
||||||
<li>
|
<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>
|
<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>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@if(isset($page_actions) && $page_actions->get('edit'))
|
@if($page_actions->get('edit'))
|
||||||
<li>
|
<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>
|
<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>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
<!-- @todo Dont offer the delete button for an entry with children -->
|
@if($page_actions->get('delete'))
|
||||||
@if(isset($page_actions) && $page_actions->get('delete'))
|
|
||||||
<li>
|
<li>
|
||||||
<span id="entry-delete" data-bs-toggle="modal" data-bs-target="#page-modal">
|
<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>
|
<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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user