Compare commits
7 Commits
302f3f2f4e
...
52d808071c
Author | SHA1 | Date | |
---|---|---|---|
52d808071c | |||
305ef0f5a3 | |||
f1316d698d | |||
339ba7258a | |||
883ac5d90f | |||
46277146c5 | |||
06747064d4 |
@ -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
|
||||||
|
@ -437,7 +437,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,
|
||||||
])),
|
])),
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
</span>
|
</span>
|
||||||
@endif
|
@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">
|
<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>
|
<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>
|
</span>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!-- $o=Attribute::class -->
|
<!-- $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="col-12">
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
@foreach($o->langtags as $langtag)
|
@foreach($o->langtags as $langtag)
|
||||||
@ -22,7 +22,7 @@
|
|||||||
name="{{ $o->name_lc }}[{{ $langtag }}][]"
|
name="{{ $o->name_lc }}[{{ $langtag }}][]"
|
||||||
value="{{ $value ?: ($av ?? '') }}"
|
value="{{ $value ?: ($av ?? '') }}"
|
||||||
placeholder="{{ ! is_null($x=$tv->get($loop->index)) ? $x : '['.__('NEW').']' }}"
|
placeholder="{{ ! is_null($x=$tv->get($loop->index)) ? $x : '['.__('NEW').']' }}"
|
||||||
readonly
|
@readonly(! $edit)
|
||||||
@disabled($o->isDynamic())>
|
@disabled($o->isDynamic())>
|
||||||
|
|
||||||
<div class="invalid-feedback pb-2">
|
<div class="invalid-feedback pb-2">
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</attribute>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -255,18 +255,18 @@
|
|||||||
@default
|
@default
|
||||||
@if($o->isDynamic()) @break @endif
|
@if($o->isDynamic()) @break @endif
|
||||||
@php($clone=TRUE)
|
@php($clone=TRUE)
|
||||||
@if($o->values_old->count())
|
@if($o->values_old->count() && (! $template))
|
||||||
<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>
|
<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
|
@endif
|
||||||
|
|
||||||
@section('page-scripts')
|
@section('page-scripts')
|
||||||
@if($clone && $edit && $o->can_addvalues)
|
@if((! $template) && $clone && $edit && $o->can_addvalues)
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Create a new entry when Add Value clicked
|
// 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 attribute = $(this).data('attribute');
|
||||||
var active = $('attribute[id='+attribute+']').find('.tab-pane.active');
|
var active = $('#template-default attribute[id='+attribute+']');
|
||||||
|
|
||||||
active.find('input:last')
|
active.find('input:last')
|
||||||
.clone()
|
.clone()
|
||||||
|
@ -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