Skip to content

Commit

Permalink
Attributes are now editable on the entity page
Browse files Browse the repository at this point in the history
  • Loading branch information
spitfire305 committed Feb 20, 2024
1 parent 2e6ceaf commit 241af02
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions resources/views/entities/components/attributes.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{!! $attribute->name() !!}
</strong>
@if ($attribute->isCheckbox())
<span class="grow text-right">
<span class="live-edit grow text-right" data-id="{{ $attribute->id }}">
@if ($attribute->value)
<x-icon class="fa-solid fa-check "></x-icon>
@else
Expand All @@ -22,14 +22,25 @@
@endif
</span>
@elseif ($attribute->isText())
<p class="m-0 grow w-full">
<p class="m-0 grow w-full live-edit @if (trim($attribute->value) === '') empty-value @endif" data-id="{{ $attribute->id }}">
{!! nl2br($attribute->mappedValue()) !!}
</p>
@elseif (!$attribute->isCheckbox() && !$attribute->isSection())
<p class="text-right grow m-0 inline-block">
<p class="live-edit @if (trim($attribute->value) === '') empty-value @endif text-right grow m-0 inline-block" data-id="{{ $attribute->id }}">
{!! $attribute->mappedValue() !!}
</p>
@endif
</div>
@endforeach
<input type="hidden" name="live-attribute-config" data-live="{{ route('entities.attributes.live.edit', [$campaign, $entity]) }}" />
@endif

@section('scripts')
@parent
@vite('resources/js/attributes.js')
@endsection

@section('modals')
@parent
<x-dialog id="live-attribute-dialog" :loading="true"></x-dialog>
@endsection

0 comments on commit 241af02

Please sign in to comment.