Files
dmtools/templates/npc/edit.html.twig
T
FrankandClaude Sonnet 5 d43746970b Split NPC page: read-only detail + game notes, separate full edit form
- /npcs/{id} (app_npc_show): portrait, all fields shown read-only, and
  the only editable control is the game-notes textarea. Father/Mother
  link through to their own pages.
- /npcs/{id}/edit (app_npc_edit): the full structured form, now WITHOUT
  game notes; saving returns to the detail page.
- NpcType drops gameNotes; new NpcGameNotesType holds just that field.
- The DataTable row link (/npcs/{id}) now lands on the detail page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 16:17:03 +02:00

48 lines
1.9 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Edit {{ npc.name }} · NPC's · dmtools{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-start mb-3 gap-3">
<div class="d-flex gap-3">
<img src="{{ asset(npc.portraitPath) }}" alt="Portrait of {{ npc.name }}"
width="96" height="120"
class="rounded border object-fit-cover flex-shrink-0"
onerror="this.remove()">
<div>
<a href="{{ path('app_npc_show', {id: npc.id}) }}" class="text-decoration-none small">&larr; Back to {{ npc.name }}</a>
<h1 class="h3 mb-0">Edit {{ npc.name }}</h1>
<span class="text-body-secondary">Structured details — game notes live on the NPC page.</span>
</div>
</div>
</div>
{{ form_start(form) }}
<div class="card shadow-sm" style="max-width: 40rem;">
<div class="card-header">Details</div>
<div class="card-body">
<div class="row">
<div class="col-8">{{ form_row(form.name) }}</div>
<div class="col-4">{{ form_row(form.age) }}</div>
</div>
{{ form_row(form.family) }}
{{ form_row(form.race) }}
{{ form_row(form.occupation) }}
{{ form_row(form.villageStatus) }}
{{ form_row(form.bloodCartInvolvement) }}
{{ form_row(form.mysteryImportance) }}
<div class="row">
<div class="col-6">{{ form_row(form.father) }}</div>
<div class="col-6">{{ form_row(form.mother) }}</div>
</div>
{{ form_row(form.relationships) }}
</div>
</div>
<div class="mt-3 d-flex gap-2">
<button class="btn btn-primary">Save</button>
<a href="{{ path('app_npc_show', {id: npc.id}) }}" class="btn btn-outline-secondary">Cancel</a>
</div>
{{ form_end(form) }}
{% endblock %}