CluPilotCloud/resources/views/livewire/admin/edit-mail-template.blade.php

44 lines
2.3 KiB
PHP

<div class="p-6">
<h2 class="text-lg font-semibold text-ink">{{ __('templates.edit_title') }}</h2>
<p class="mt-1 text-sm text-muted">{{ __('templates.edit_body') }}</p>
<form wire:submit="save" class="mt-5 space-y-4">
<x-ui.input name="name" wire:model="name" :label="__('templates.name')" />
<x-ui.input name="subject" wire:model="subject" :label="__('templates.subject')" />
<div>
<label for="edit-body" class="block text-sm font-medium text-body">{{ __('templates.body') }}</label>
<textarea id="edit-body" rows="10" wire:model="body"
class="mt-1.5 block w-full rounded border border-line bg-surface px-3.5 py-2.5 text-sm text-ink"></textarea>
@error('body')<p class="mt-1.5 text-xs text-danger">{{ $message }}</p>@enderror
</div>
{{-- One checkbox, one value: retiring an answer rather than deleting it,
because it is still the answer somebody was given last year. --}}
<label class="flex items-center gap-2.5 text-sm text-body">
<input type="checkbox" wire:model="active"
class="size-4 rounded border-line-strong text-accent-active focus:ring-accent-active" />
{{ __('templates.active') }}
</label>
<div class="rounded-md border border-line bg-surface-2 p-3">
<p class="lbl">{{ __('templates.placeholders') }}</p>
<p class="mt-2 flex flex-wrap gap-x-3 gap-y-1 font-mono text-xs text-accent-text">
@foreach ($placeholders as $token => $explanation)
{{-- See mail-templates.blade.php: a literal }} inside an
echo tag ends the tag. --}}
@php $literal = '{{'.$token.'}}'; @endphp
<span class="select-all">{{ $literal }}</span>
@endforeach
</p>
</div>
<div class="flex flex-wrap gap-2 border-t border-line pt-4">
<x-ui.button type="submit" variant="primary" wire:loading.attr="disabled" wire:target="save">
{{ __('templates.save') }}
</x-ui.button>
<x-ui.button variant="secondary" x-on:click="$dispatch('closeModal')">{{ __('templates.cancel') }}</x-ui.button>
</div>
</form>
</div>