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>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}{{ npc.name }} · NPC's · dmtools{% endblock %}
|
||||
{% 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">
|
||||
@@ -10,53 +10,38 @@
|
||||
class="rounded border object-fit-cover flex-shrink-0"
|
||||
onerror="this.remove()">
|
||||
<div>
|
||||
<a href="{{ path('app_npcs') }}" class="text-decoration-none small">← All NPC's</a>
|
||||
<h1 class="h3 mb-0">{{ npc.name }}</h1>
|
||||
<span class="text-body-secondary">{{ npc.family }}{% if npc.occupation %} · {{ npc.occupation }}{% endif %}</span>
|
||||
<a href="{{ path('app_npc_show', {id: npc.id}) }}" class="text-decoration-none small">← 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>
|
||||
{% if npc.updatedAt %}
|
||||
<span class="text-body-secondary small">Updated {{ npc.updatedAt|date('Y-m-d H:i') }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{ form_start(form) }}
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-5">
|
||||
<div class="card shadow-sm">
|
||||
<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 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>
|
||||
</div>
|
||||
<div class="col-lg-7">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header">Game notes</div>
|
||||
<div class="card-body">
|
||||
{{ form_row(form.gameNotes, {label: false}) }}
|
||||
</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_npcs') }}" class="btn btn-outline-secondary">Cancel</a>
|
||||
<a href="{{ path('app_npc_show', {id: npc.id}) }}" class="btn btn-outline-secondary">Cancel</a>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user