{% extends "layout.html.tera" %}
{% block title %}Edit {{ record.label }} — {{ entity_plural | capitalize }} — {{ app_display }}{% endblock title %}
{% block content %}
<nav class="breadcrumb-nav" aria-label="Breadcrumb">
<ol class="breadcrumb-list" aria-label="Breadcrumb trail">
<li class="breadcrumb-list-item"><a href="/">Home</a></li>
<li class="breadcrumb-list-item"><a href="/{{ entity_plural }}">{{ entity_plural | capitalize }}</a></li>
<li class="breadcrumb-list-item"><a href="/{{ entity_plural }}/{{ record.id }}">{{ record.label }}</a></li>
<li class="breadcrumb-list-item" aria-current="page">Edit</li>
</ol>
</nav>
<section aria-label="Edit {{ entity_singular }}">
<h2>Edit {{ record.label }}</h2>
{% if errors and errors | length > 0 %}
<div class="error-summary"
role="alert"
aria-labelledby="error-summary-title"
tabindex="-1">
<h2 id="error-summary-title">There is a problem</h2>
<ul>
{% for e in errors %}
<li><a href="#{{ e.field }}">{{ e.message }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
<form class="form"
aria-label="Edit {{ entity_singular }} form"
hx-put="/api/{{ entity_plural }}/{{ record.id }}"
hx-target="body"
hx-push-url="/{{ entity_plural }}/{{ record.id }}"
novalidate>
<div class="field" aria-label="Label field" data-required>
<label class="label" for="label">Label</label>
<button class="hover-card-trigger"
type="button"
aria-label="Help: Label"
aria-describedby="label-help-card">?</button>
<div class="hover-card" id="label-help-card" role="tooltip" aria-label="Label help">
Required. The primary display name used in lists, search results, breadcrumbs, and audit-log summaries. Keep it short (under 80 characters) and human-readable.
</div>
<span class="hint" id="label-hint">A short, human-readable label.</span>
{% if field_errors and field_errors.label %}
<span class="error-message" id="label-error" role="alert">{{ field_errors.label }}</span>
{% endif %}
<input class="text-input"
type="text"
id="label"
name="label"
value="{{ record.label | default(value='') }}"
aria-label="Label"
aria-describedby="label-hint{% if field_errors and field_errors.label %} label-error{% endif %}"
{% if field_errors and field_errors.label %}aria-invalid="true" aria-errormessage="label-error"{% endif %}
required>
</div>
<div class="field" aria-label="Subtitle field">
<label class="label" for="subtitle">Subtitle</label>
<button class="hover-card-trigger"
type="button"
aria-label="Help: Subtitle"
aria-describedby="subtitle-help-card">?</button>
<div class="hover-card" id="subtitle-help-card" role="tooltip" aria-label="Subtitle help">
Optional secondary text shown beneath the label in the index table. Use it for disambiguation (e.g. department, location, or year of birth).
</div>
<span class="hint" id="subtitle-hint">Optional description shown alongside the label.</span>
{% if field_errors and field_errors.subtitle %}
<span class="error-message" id="subtitle-error" role="alert">{{ field_errors.subtitle }}</span>
{% endif %}
<input class="text-input"
type="text"
id="subtitle"
name="subtitle"
value="{{ record.subtitle | default(value='') }}"
aria-label="Subtitle"
aria-describedby="subtitle-hint{% if field_errors and field_errors.subtitle %} subtitle-error{% endif %}"
{% if field_errors and field_errors.subtitle %}aria-invalid="true" aria-errormessage="subtitle-error"{% endif %}>
</div>
{% if healthcare %}
<fieldset class="fieldset" aria-label="Healthcare identifiers">
<legend>Healthcare identifiers</legend>
<div class="field" aria-label="UK NHS number field">
<label class="label" for="nhs-number">UK NHS number</label>
<span class="hint" id="nhs-number-hint">10 digits, optionally formatted as 123 456 7890.</span>
{% if field_errors and field_errors.nhs_number %}
<span class="error-message" id="nhs-number-error" role="alert">{{ field_errors.nhs_number }}</span>
{% endif %}
<input class="united-kingdom-national-health-service-number-input"
type="text"
id="nhs-number"
name="nhs_number"
value="{{ healthcare.nhs_number | default(value='') }}"
inputmode="numeric"
pattern="[0-9 ]*"
maxlength="12"
aria-label="UK NHS number"
aria-describedby="nhs-number-hint{% if field_errors and field_errors.nhs_number %} nhs-number-error{% endif %}"
{% if field_errors and field_errors.nhs_number %}aria-invalid="true" aria-errormessage="nhs-number-error"{% endif %}>
</div>
<div class="field" aria-label="US Social Security number field">
<label class="label" for="ssn">US Social Security number</label>
<span class="hint" id="ssn-hint">9 digits, formatted as 123-45-6789.</span>
{% if field_errors and field_errors.ssn %}
<span class="error-message" id="ssn-error" role="alert">{{ field_errors.ssn }}</span>
{% endif %}
<input class="united-states-social-security-number-input"
type="text"
id="ssn"
name="ssn"
value="{{ healthcare.ssn | default(value='') }}"
inputmode="numeric"
pattern="[0-9-]*"
maxlength="11"
autocomplete="off"
aria-label="US Social Security number"
aria-describedby="ssn-hint{% if field_errors and field_errors.ssn %} ssn-error{% endif %}"
{% if field_errors and field_errors.ssn %}aria-invalid="true" aria-errormessage="ssn-error"{% endif %}>
</div>
</fieldset>
{% endif %}
<fieldset class="fieldset" aria-label="Identifiers">
<legend>Identifiers</legend>
<span class="hint" id="identifiers-hint">Add or remove external identifiers such as MRN, SSN, NPI, PPN.</span>
<div class="tag-input"
aria-label="Identifier tag input"
x-data='{
items: {{ identifiers | json_encode | safe }},
draftType: "MRN",
draftValue: "",
add() {
var v = this.draftValue.trim();
if (!v) return;
this.items.push({ type: this.draftType, value: v });
this.draftValue = "";
if (window.lily && window.lily.toast) {
window.lily.toast(this.draftType + " added", "info");
}
},
remove(i) {
var removed = this.items.splice(i, 1)[0];
if (window.lily && window.lily.toast && removed) {
window.lily.toast(removed.type + " removed", "info");
}
}
}'>
<div class="tag-group" aria-label="Current identifiers">
<template x-for="(item, i) in items" :key="i">
<span class="tag" x-bind:aria-label="'Identifier: ' + item.type + ' ' + item.value">
<strong x-text="item.type"></strong>
<span x-text="item.value"></span>
<button type="button"
x-bind:aria-label="'Remove ' + item.type + ' ' + item.value"
@click="remove(i)">×</button>
<input type="hidden"
x-bind:name="'identifiers[' + i + '][type]'"
x-bind:value="item.type">
<input type="hidden"
x-bind:name="'identifiers[' + i + '][value]'"
x-bind:value="item.value">
</span>
</template>
<span class="hint"
aria-label="Empty identifier list"
x-show="items.length === 0">No identifiers yet.</span>
</div>
<div class="action-group" aria-label="Add identifier">
<label class="screen-reader-span" for="identifier-type">Identifier type</label>
<select class="select"
id="identifier-type"
aria-label="Identifier type"
x-model="draftType">
<option class="option" value="MRN">MRN</option>
<option class="option" value="SSN">SSN</option>
<option class="option" value="NPI">NPI</option>
<option class="option" value="PPN">PPN</option>
<option class="option" value="DL">Driver's licence</option>
<option class="option" value="TAX">Tax ID</option>
<option class="option" value="OTHER">Other</option>
</select>
<label class="screen-reader-span" for="identifier-value">Identifier value</label>
<input class="text-input"
type="text"
id="identifier-value"
aria-label="Identifier value"
placeholder="Enter value"
x-model="draftValue"
@keydown.enter.prevent="add()">
<button class="button"
type="button"
aria-label="Add identifier"
@click="add()">Add</button>
</div>
</div>
</fieldset>
<fieldset class="fieldset" aria-label="Addresses">
<legend>Addresses</legend>
<span class="hint" id="addresses-hint">Add or remove postal addresses. At least one of city, postal code, or country is required per address.</span>
<div class="address-input"
aria-label="Address list editor"
x-data='{
items: {{ addresses | json_encode | safe }},
draft: { line1: "", line2: "", city: "", state: "", postal_code: "", country: "" },
add() {
var hasContent = this.draft.city || this.draft.postal_code || this.draft.country || this.draft.line1;
if (!hasContent) return;
this.items.push(Object.assign({}, this.draft));
this.draft = { line1: "", line2: "", city: "", state: "", postal_code: "", country: "" };
if (window.lily && window.lily.toast) {
window.lily.toast("Address added", "info");
}
},
remove(i) {
this.items.splice(i, 1);
if (window.lily && window.lily.toast) {
window.lily.toast("Address removed", "info");
}
},
summary(a) {
return [a.line1, a.city, a.postal_code, a.country].filter(Boolean).join(", ");
}
}'>
<div class="tag-group" aria-label="Current addresses">
<template x-for="(item, i) in items" :key="i">
<span class="tag" x-bind:aria-label="'Address: ' + summary(item)">
<span x-text="summary(item)"></span>
<button type="button"
x-bind:aria-label="'Remove address: ' + summary(item)"
@click="remove(i)">×</button>
<template x-for="(k) in Object.keys(item)" :key="k">
<input type="hidden"
x-bind:name="'addresses[' + i + '][' + k + ']'"
x-bind:value="item[k]">
</template>
</span>
</template>
<span class="hint"
aria-label="Empty address list"
x-show="items.length === 0">No addresses yet.</span>
</div>
<div class="field" aria-label="Address line 1 field">
<label class="label" for="address-line1">Line 1</label>
<input class="text-input"
type="text"
id="address-line1"
aria-label="Address line 1"
placeholder="10 Downing St"
x-model="draft.line1">
</div>
<div class="field" aria-label="Address line 2 field">
<label class="label" for="address-line2">Line 2</label>
<input class="text-input"
type="text"
id="address-line2"
aria-label="Address line 2"
placeholder="Apartment, suite, building"
x-model="draft.line2">
</div>
<div class="field" aria-label="City field">
<label class="label" for="address-city">City</label>
<input class="text-input"
type="text"
id="address-city"
aria-label="City"
placeholder="London"
x-model="draft.city">
</div>
<div class="field" aria-label="State field">
<label class="label" for="address-state">State / region</label>
<input class="text-input"
type="text"
id="address-state"
aria-label="State or region"
placeholder="Greater London"
x-model="draft.state">
</div>
<div class="field" aria-label="Postal code field">
<label class="label" for="address-postal">Postal code</label>
<input class="text-input"
type="text"
id="address-postal"
aria-label="Postal code"
placeholder="SW1A 2AA"
x-model="draft.postal_code">
</div>
<div class="field" aria-label="Country field">
<label class="label" for="address-country">Country (ISO 3166)</label>
<input class="text-input"
type="text"
id="address-country"
aria-label="Country code"
placeholder="GB"
maxlength="2"
x-model="draft.country">
</div>
<div class="action-bar" role="toolbar" aria-label="Address actions">
<button class="button"
type="button"
aria-label="Add address"
@click="add()">Add address</button>
</div>
</div>
</fieldset>
<fieldset class="fieldset" aria-label="Contact points">
<legend>Contacts</legend>
<span class="hint" id="contacts-hint">Phone, email, SMS, fax, pager, URL. The input switches based on the system.</span>
<div class="tag-input"
aria-label="Contact-point editor"
x-data='{
items: {{ telecoms | json_encode | safe }},
draftSystem: "phone",
draftValue: "",
add() {
var v = this.draftValue.trim();
if (!v) return;
this.items.push({ system: this.draftSystem, value: v });
this.draftValue = "";
if (window.lily && window.lily.toast) {
window.lily.toast(this.draftSystem + " added", "info");
}
},
remove(i) {
var removed = this.items.splice(i, 1)[0];
if (window.lily && window.lily.toast && removed) {
window.lily.toast(removed.system + " removed", "info");
}
}
}'>
<div class="tag-group" aria-label="Current contact points">
<template x-for="(item, i) in items" :key="i">
<span class="tag" x-bind:aria-label="'Contact: ' + item.system + ' ' + item.value">
<strong x-text="item.system"></strong>
<span x-text="item.value"></span>
<button type="button"
x-bind:aria-label="'Remove ' + item.system + ' ' + item.value"
@click="remove(i)">×</button>
<input type="hidden"
x-bind:name="'telecoms[' + i + '][system]'"
x-bind:value="item.system">
<input type="hidden"
x-bind:name="'telecoms[' + i + '][value]'"
x-bind:value="item.value">
</span>
</template>
<span class="hint"
aria-label="Empty contact list"
x-show="items.length === 0">No contact points yet.</span>
</div>
<div class="action-group" aria-label="Add contact point">
<label class="screen-reader-span" for="contact-system">Contact system</label>
<select class="select"
id="contact-system"
aria-label="Contact system"
x-model="draftSystem">
<option class="option" value="phone">Phone</option>
<option class="option" value="email">Email</option>
<option class="option" value="sms">SMS</option>
<option class="option" value="fax">Fax</option>
<option class="option" value="pager">Pager</option>
<option class="option" value="url">URL</option>
</select>
<label class="screen-reader-span" for="contact-value">Contact value</label>
<template x-if="draftSystem === 'phone' || draftSystem === 'sms' || draftSystem === 'fax' || draftSystem === 'pager'">
<input class="tel-input"
type="tel"
id="contact-value"
aria-label="Contact value (telephone)"
placeholder="+44 20 7946 0958"
x-model="draftValue"
@keydown.enter.prevent="add()">
</template>
<template x-if="draftSystem === 'email'">
<input class="email-input"
type="email"
id="contact-value"
aria-label="Contact value (email)"
placeholder="alice@example.test"
x-model="draftValue"
@keydown.enter.prevent="add()">
</template>
<template x-if="draftSystem === 'url'">
<input class="text-input"
type="url"
id="contact-value"
aria-label="Contact value (URL)"
placeholder="https://example.test/alice"
x-model="draftValue"
@keydown.enter.prevent="add()">
</template>
<button class="button"
type="button"
aria-label="Add contact point"
@click="add()">Add</button>
</div>
</div>
</fieldset>
{% if healthcare %}
<fieldset class="fieldset" aria-label="Emergency contacts">
<legend>Emergency contacts</legend>
<span class="hint" id="emergency-contacts-hint">Family, next-of-kin, and other contacts to reach in an emergency. Mark one as primary.</span>
<div class="tag-input"
aria-label="Emergency contact editor"
x-data='{
items: {{ emergency_contacts | json_encode | safe }},
draft: { name: "", relationship: "", phone: "", email: "", is_primary: false },
error: "",
add() {
this.error = "";
if (!this.draft.name.trim()) { this.error = "Name is required."; return; }
if (!this.draft.relationship.trim()) { this.error = "Relationship is required."; return; }
if (!this.draft.phone.trim() && !this.draft.email.trim()) {
this.error = "At least one phone or email is required.";
return;
}
if (this.draft.is_primary) {
this.items.forEach(function (it) { it.is_primary = false; });
}
this.items.push(Object.assign({}, this.draft));
this.draft = { name: "", relationship: "", phone: "", email: "", is_primary: false };
if (window.lily && window.lily.toast) {
window.lily.toast("Emergency contact added", "info");
}
},
remove(i) {
var removed = this.items.splice(i, 1)[0];
if (window.lily && window.lily.toast && removed) {
window.lily.toast(removed.name + " removed", "info");
}
},
setPrimary(i) {
this.items.forEach(function (it, j) { it.is_primary = (i === j); });
if (window.lily && window.lily.toast) {
window.lily.toast(this.items[i].name + " set as primary", "info");
}
}
}'>
<ol class="summary-list" aria-label="Current emergency contacts">
<template x-for="(item, i) in items" :key="i">
<li class="summary-list-item"
x-bind:aria-label="'Emergency contact: ' + item.name + ' (' + item.relationship + ')'">
<dl>
<dt>
<strong x-text="item.name"></strong>
<span x-show="item.relationship">· <span x-text="item.relationship"></span></span>
<template x-if="item.is_primary">
<span class="badge" data-type="success" aria-label="Primary contact">Primary</span>
</template>
</dt>
<dd>
<div class="tag-group" aria-label="Contact telecoms">
<template x-if="item.phone">
<span class="tag" x-bind:aria-label="'Phone: ' + item.phone">
<strong>phone</strong>
<span x-text="item.phone"></span>
</span>
</template>
<template x-if="item.email">
<span class="tag" x-bind:aria-label="'Email: ' + item.email">
<strong>email</strong>
<span x-text="item.email"></span>
</span>
</template>
</div>
<div class="action-bar" role="toolbar" aria-label="Contact actions">
<button type="button"
class="action-bar-button"
x-show="!item.is_primary"
x-bind:aria-label="'Mark ' + item.name + ' as primary'"
@click="setPrimary(i)">Make primary</button>
<button type="button"
class="action-bar-button"
x-bind:aria-label="'Remove ' + item.name"
@click="remove(i)">Remove</button>
</div>
<template x-for="(k) in Object.keys(item)" :key="k">
<input type="hidden"
x-bind:name="'emergency_contacts[' + i + '][' + k + ']'"
x-bind:value="item[k]">
</template>
</dd>
</dl>
</li>
</template>
</ol>
<p x-show="items.length === 0">
<span class="hint" aria-label="Empty emergency contact list">No emergency contacts yet.</span>
</p>
<div x-show="error" x-transition>
<span class="error-message"
role="alert"
x-text="error"
x-bind:aria-label="error"></span>
</div>
<div class="field" aria-label="Contact name field" data-required>
<label class="label" for="ec-name">Name</label>
<input class="text-input"
type="text"
id="ec-name"
aria-label="Emergency contact name"
placeholder="Jane Smith"
x-model="draft.name">
</div>
<div class="field" aria-label="Contact relationship field" data-required>
<label class="label" for="ec-relationship">Relationship</label>
<select class="select"
id="ec-relationship"
aria-label="Relationship to {{ entity_singular }}"
x-model="draft.relationship">
<option class="option" value="">Choose…</option>
<option class="option" value="spouse">Spouse</option>
<option class="option" value="partner">Partner</option>
<option class="option" value="parent">Parent</option>
<option class="option" value="child">Child</option>
<option class="option" value="sibling">Sibling</option>
<option class="option" value="guardian">Guardian</option>
<option class="option" value="friend">Friend</option>
<option class="option" value="other">Other</option>
</select>
</div>
<div class="field" aria-label="Contact phone field">
<label class="label" for="ec-phone">Phone</label>
<input class="tel-input"
type="tel"
id="ec-phone"
aria-label="Emergency contact phone"
placeholder="+44 20 7946 0958"
x-model="draft.phone">
</div>
<div class="field" aria-label="Contact email field">
<label class="label" for="ec-email">Email</label>
<input class="email-input"
type="email"
id="ec-email"
aria-label="Emergency contact email"
placeholder="jane@example.test"
x-model="draft.email">
</div>
<div class="field" aria-label="Primary flag field">
<label class="label" for="ec-primary">
<input id="ec-primary"
type="checkbox"
aria-label="Mark as primary contact"
x-model="draft.is_primary">
Primary contact
</label>
<span class="hint">Setting this clears the primary flag on any existing contact.</span>
</div>
<div class="action-bar" role="toolbar" aria-label="Emergency contact actions">
<button class="button"
type="button"
aria-label="Add emergency contact"
@click="add()">Add contact</button>
</div>
</div>
</fieldset>
{% endif %}
<fieldset class="fieldset" aria-label="Identity documents">
<legend>Identity documents</legend>
<span class="hint" id="documents-hint">Passport, driver's licence, national ID, etc. Numbers are validated; expiry must be after issue date.</span>
<div class="tag-input"
aria-label="Document editor"
x-data='{
items: {{ documents | json_encode | safe }},
draft: { type: "PASSPORT", number: "", issuing_country: "", issuing_authority: "", issue_date: "", expiry_date: "" },
error: "",
add() {
this.error = "";
if (!this.draft.number.trim()) {
this.error = "Document number is required.";
return;
}
if (this.draft.issue_date && this.draft.expiry_date && this.draft.issue_date >= this.draft.expiry_date) {
this.error = "Expiry date must be after issue date.";
return;
}
this.items.push(Object.assign({}, this.draft));
this.draft = { type: this.draft.type, number: "", issuing_country: "", issuing_authority: "", issue_date: "", expiry_date: "" };
if (window.lily && window.lily.toast) {
window.lily.toast("Document added", "info");
}
},
remove(i) {
var removed = this.items.splice(i, 1)[0];
if (window.lily && window.lily.toast && removed) {
window.lily.toast(removed.type + " removed", "info");
}
},
expiryBadge(item) {
if (!item.expiry_date) return { type: "info", label: "no expiry" };
var today = new Date().toISOString().slice(0, 10);
if (item.expiry_date < today) return { type: "error", label: "expired" };
var soon = new Date(); soon.setMonth(soon.getMonth() + 6);
if (item.expiry_date < soon.toISOString().slice(0, 10)) return { type: "warning", label: "expiring soon" };
return { type: "success", label: "valid" };
}
}'>
<div class="tag-group" aria-label="Current documents">
<template x-for="(item, i) in items" :key="i">
<span class="tag" x-bind:aria-label="'Document: ' + item.type + ' ' + item.number">
<strong x-text="item.type"></strong>
<span x-text="item.number"></span>
<span x-show="item.issuing_country">(<span x-text="item.issuing_country"></span>)</span>
<span class="badge"
x-bind:data-type="expiryBadge(item).type"
x-bind:aria-label="'Expiry: ' + expiryBadge(item).label"
x-text="expiryBadge(item).label"></span>
<button type="button"
x-bind:aria-label="'Remove ' + item.type + ' ' + item.number"
@click="remove(i)">×</button>
<template x-for="(k) in Object.keys(item)" :key="k">
<input type="hidden"
x-bind:name="'documents[' + i + '][' + k + ']'"
x-bind:value="item[k]">
</template>
</span>
</template>
<span class="hint"
aria-label="Empty document list"
x-show="items.length === 0">No documents yet.</span>
</div>
<div x-show="error" x-transition>
<span class="error-message"
role="alert"
x-text="error"
x-bind:aria-label="error"></span>
</div>
<div class="field" aria-label="Document type field" data-required>
<label class="label" for="document-type">Type</label>
<select class="select"
id="document-type"
aria-label="Document type"
x-model="draft.type">
<option class="option" value="PASSPORT">Passport</option>
<option class="option" value="BIRTH_CERTIFICATE">Birth certificate</option>
<option class="option" value="NATIONAL_ID">National ID</option>
<option class="option" value="DRIVERS_LICENSE">Driver's licence</option>
<option class="option" value="VOTER_ID">Voter ID</option>
<option class="option" value="MILITARY_ID">Military ID</option>
<option class="option" value="RESIDENCE_PERMIT">Residence permit</option>
<option class="option" value="WORK_PERMIT">Work permit</option>
<option class="option" value="OTHER">Other</option>
</select>
</div>
<div class="field" aria-label="Document number field" data-required>
<label class="label" for="document-number">Number</label>
<input class="text-input"
type="text"
id="document-number"
aria-label="Document number"
placeholder="X12345678"
x-model="draft.number">
</div>
<div class="field" aria-label="Issuing country field">
<label class="label" for="document-country">Issuing country (ISO 3166)</label>
<input class="text-input"
type="text"
id="document-country"
aria-label="Issuing country"
placeholder="US"
maxlength="2"
x-model="draft.issuing_country">
</div>
<div class="field" aria-label="Issuing authority field">
<label class="label" for="document-authority">Issuing authority</label>
<input class="text-input"
type="text"
id="document-authority"
aria-label="Issuing authority"
placeholder="US Dept of State"
x-model="draft.issuing_authority">
</div>
<div class="field" aria-label="Issue date field">
<label class="label" for="document-issue">Issue date</label>
<input class="text-input"
type="date"
id="document-issue"
aria-label="Issue date"
x-model="draft.issue_date">
</div>
<div class="field" aria-label="Expiry date field">
<label class="label" for="document-expiry">Expiry date</label>
<input class="text-input"
type="date"
id="document-expiry"
aria-label="Expiry date"
x-model="draft.expiry_date">
</div>
<div class="action-bar" role="toolbar" aria-label="Document actions">
<button class="button"
type="button"
aria-label="Add document"
@click="add()">Add document</button>
</div>
</div>
</fieldset>
<div class="field" aria-label="Status field">
<label class="label" for="status">Status</label>
<button class="hover-card-trigger"
type="button"
aria-label="Help: Status"
aria-describedby="status-help-card">?</button>
<div class="hover-card" id="status-help-card" role="tooltip" aria-label="Status help">
Setting status to <strong>Inactive</strong> performs a soft delete: the record is removed from search and the index table, but the full history remains in the audit log and can be restored within 30 days.
</div>
<span class="hint" id="status-hint">Active records appear in search; inactive records are soft-deleted.</span>
<select class="select"
id="status"
name="status"
aria-label="Status"
aria-describedby="status-hint">
<option class="option" value="active" {% if record.active %}selected{% endif %}>Active</option>
<option class="option" value="inactive" {% if not record.active %}selected{% endif %}>Inactive</option>
</select>
</div>
<div class="action-bar" role="toolbar" aria-label="Edit form actions">
<button class="button" type="submit" aria-label="Save {{ entity_singular }}">Save</button>
<a class="button"
href="/{{ entity_plural }}/{{ record.id }}"
aria-label="Cancel edit and return to {{ entity_singular }}">Cancel</a>
</div>
</form>
</section>
{% endblock content %}