snapshot: preserve state before onboarding field parity and refactor slice
This commit is contained in:
@@ -25,97 +25,167 @@
|
||||
|
||||
{% include 'workflows/includes/messages.html' %}
|
||||
|
||||
<form class="card" method="post" action="/admin-tools/intro-builder/">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="builder_action" value="add_item" />
|
||||
<div class="grid">
|
||||
<div class="field">
|
||||
<label for="section">{% trans "Abschnitt" %}</label>
|
||||
<select id="section" name="section">
|
||||
{% for value, label in section_choices %}
|
||||
<option value="{{ value }}">{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="label">{% trans "Checklistenpunkt (DE)" %}</label>
|
||||
<input id="label" name="label" placeholder="{% trans 'z. B. Nextcloud Ordnerstruktur erklärt' %}" required />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="label_en">{% trans "Checklist item (EN)" %}</label>
|
||||
<input id="label_en" name="label_en" placeholder="{% trans 'e.g. Nextcloud folder structure explained' %}" />
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="btn btn-primary" type="submit">{% trans "Punkt hinzufügen" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hint">{% trans "Bedingungen und Sortierung können anschließend in der Tabelle bearbeitet werden." %}</div>
|
||||
</form>
|
||||
<section class="intro-builder-shell">
|
||||
<aside class="intro-builder-sidebar">
|
||||
<section class="card intro-side-card">
|
||||
<span class="page-eyebrow intro-eyebrow">{% trans "Übersicht" %}</span>
|
||||
<div class="intro-side-stats">
|
||||
<div class="intro-side-stat">
|
||||
<strong>{{ intro_summary.total_items }}</strong>
|
||||
<span>{% trans "Punkte gesamt" %}</span>
|
||||
</div>
|
||||
<div class="intro-side-stat">
|
||||
<strong>{{ intro_summary.active_items }}</strong>
|
||||
<span>{% trans "aktiv" %}</span>
|
||||
</div>
|
||||
<div class="intro-side-stat">
|
||||
<strong>{{ intro_summary.conditional_items }}</strong>
|
||||
<span>{% trans "mit Bedingung" %}</span>
|
||||
</div>
|
||||
<div class="intro-side-stat">
|
||||
<strong>{{ intro_summary.section_count }}</strong>
|
||||
<span>{% trans "genutzte Abschnitte" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form class="card" method="post" action="/admin-tools/intro-builder/">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="builder_action" value="save_items" />
|
||||
<div class="table-wrap app-table-shell">
|
||||
<table class="app-table table-controls">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Sortierung" %}</th>
|
||||
<th>{% trans "Abschnitt" %}</th>
|
||||
<th>{% trans "Checklistenpunkt (DE)" %}</th>
|
||||
<th>{% trans "Checklistenpunkt (EN)" %}</th>
|
||||
<th>{% trans "Feld-Bedingung" %}</th>
|
||||
<th>{% trans "Operator" %}</th>
|
||||
<th>{% trans "Wert" %}</th>
|
||||
<th>{% trans "Aktiv" %}</th>
|
||||
<th>{% trans "Löschen" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="item_ids" value="{{ item.id }}" />
|
||||
{{ forloop.counter }}
|
||||
</td>
|
||||
<td>
|
||||
<select name="section_{{ item.id }}">
|
||||
{% for value, label in section_choices %}
|
||||
<option value="{{ value }}" {% if item.section == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="label_{{ item.id }}" value="{{ item.label }}" required /></td>
|
||||
<td><input type="text" name="label_en_{{ item.id }}" value="{{ item.label_en }}" /></td>
|
||||
<td>
|
||||
<select name="field_{{ item.id }}">
|
||||
{% for value, label in condition_field_choices %}
|
||||
<option value="{{ value }}" {% if item.condition_field == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="operator_{{ item.id }}">
|
||||
{% for value, label in operator_choices %}
|
||||
<option value="{{ value }}" {% if item.condition_operator == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="value_{{ item.id }}" value="{{ item.condition_value }}" placeholder="{% trans 'z. B. HR Works' %}" /></td>
|
||||
<td><input type="checkbox" name="active_{{ item.id }}" {% if item.is_active %}checked{% endif %} /></td>
|
||||
<td class="actions">
|
||||
<button class="btn btn-secondary" type="submit" name="delete_item_id" value="{{ item.id }}" data-confirm="{% trans 'Checklistenpunkt wirklich löschen?' %}">{% trans "Löschen" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="9">{% trans "Noch keine benutzerdefinierten Checklistenpunkte angelegt. Solange die Liste leer ist, nutzt das System die integrierten Standardpunkte." %}</td></tr>
|
||||
<nav class="app-module-nav intro-section-nav" aria-label="{% trans 'Abschnitte' %}">
|
||||
{% for group in grouped_items %}
|
||||
{% if group.count %}
|
||||
<a class="app-module-link intro-section-link" href="#intro-section-{{ group.key }}">{{ group.label }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<div class="intro-builder-main">
|
||||
<form class="card intro-builder-form-card" method="post" action="/admin-tools/intro-builder/">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="builder_action" value="add_item" />
|
||||
<div class="surface-head intro-surface-head">
|
||||
<div>
|
||||
<h2>{% trans "Punkt hinzufügen" %}</h2>
|
||||
<p>{% trans "Neue Checklistenpunkte direkt in den passenden Abschnitt einfügen." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="field">
|
||||
<label for="section">{% trans "Abschnitt" %}</label>
|
||||
<select id="section" name="section">
|
||||
{% for value, label in section_choices %}
|
||||
<option value="{{ value }}">{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="label">{% trans "Checklistenpunkt (DE)" %}</label>
|
||||
<input id="label" name="label" placeholder="{% trans 'z. B. Nextcloud Ordnerstruktur erklärt' %}" required />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="label_en">{% trans "Checklist item (EN)" %}</label>
|
||||
<input id="label_en" name="label_en" placeholder="{% trans 'e.g. Nextcloud folder structure explained' %}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="intro-builder-actions">
|
||||
<button class="btn btn-primary" type="submit">{% trans "Punkt hinzufügen" %}</button>
|
||||
<span class="hint">{% trans "Bedingungen und Sortierung können anschließend im Editor gepflegt werden." %}</span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="card intro-builder-list-card" method="post" action="/admin-tools/intro-builder/">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="builder_action" value="save_items" />
|
||||
<div class="surface-head intro-surface-head">
|
||||
<div>
|
||||
<h2>{% trans "Checkliste bearbeiten" %}</h2>
|
||||
<p>{% trans "Punkte pro Abschnitt pflegen, Bedingungen setzen und aktive Einträge steuern." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="intro-group-stack">
|
||||
{% for group in grouped_items %}
|
||||
<section class="intro-group-card" id="intro-section-{{ group.key }}">
|
||||
<div class="intro-group-head">
|
||||
<div>
|
||||
<h3>{{ group.label }}</h3>
|
||||
<p class="mini">{% blocktrans trimmed with count=group.count active=group.active_count %}{{ count }} Punkte, {{ active }} aktiv{% endblocktrans %}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if group.items %}
|
||||
<div class="intro-item-list">
|
||||
{% for item in group.items %}
|
||||
<article class="intro-item-card">
|
||||
<input type="hidden" name="item_ids" value="{{ item.id }}" />
|
||||
<div class="intro-item-head">
|
||||
<strong>{{ item.label }}</strong>
|
||||
<div class="intro-item-actions">
|
||||
<label class="intro-inline-check">
|
||||
<input type="checkbox" name="active_{{ item.id }}" {% if item.is_active %}checked{% endif %} />
|
||||
<span>{% trans "Aktiv" %}</span>
|
||||
</label>
|
||||
<button class="btn btn-secondary" type="submit" name="delete_item_id" value="{{ item.id }}" data-confirm="{% trans 'Checklistenpunkt wirklich löschen?' %}">{% trans "Löschen" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="intro-item-grid">
|
||||
<label class="field intro-item-field">
|
||||
<span>{% trans "Sortierung" %}</span>
|
||||
<div class="branding-inline-value">{{ item.sort_order|add:1 }}</div>
|
||||
</label>
|
||||
<label class="field intro-item-field">
|
||||
<span>{% trans "Abschnitt" %}</span>
|
||||
<select name="section_{{ item.id }}">
|
||||
{% for value, label in section_choices %}
|
||||
<option value="{{ value }}" {% if item.section == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="field intro-item-field intro-item-field-wide">
|
||||
<span>{% trans "Checklistenpunkt (DE)" %}</span>
|
||||
<input type="text" name="label_{{ item.id }}" value="{{ item.label }}" required />
|
||||
</label>
|
||||
<label class="field intro-item-field intro-item-field-wide">
|
||||
<span>{% trans "Checklistenpunkt (EN)" %}</span>
|
||||
<input type="text" name="label_en_{{ item.id }}" value="{{ item.label_en }}" />
|
||||
</label>
|
||||
<label class="field intro-item-field">
|
||||
<span>{% trans "Feld-Bedingung" %}</span>
|
||||
<select name="field_{{ item.id }}">
|
||||
{% for value, label in condition_field_choices %}
|
||||
<option value="{{ value }}" {% if item.condition_field == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="field intro-item-field">
|
||||
<span>{% trans "Operator" %}</span>
|
||||
<select name="operator_{{ item.id }}">
|
||||
{% for value, label in operator_choices %}
|
||||
<option value="{{ value }}" {% if item.condition_operator == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="field intro-item-field intro-item-field-wide">
|
||||
<span>{% trans "Wert" %}</span>
|
||||
<input type="text" name="value_{{ item.id }}" value="{{ item.condition_value }}" placeholder="{% trans 'z. B. HR Works' %}" />
|
||||
</label>
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="builder-empty-state">{% trans "Noch keine Punkte in diesem Abschnitt." %}</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="intro-builder-actions intro-builder-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit">{% trans "Checkliste speichern" %}</button>
|
||||
<span class="hint">{% trans "Die Reihenfolge folgt aktuell der gespeicherten Listenreihenfolge innerhalb der Abschnitte." %}</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="hint">{% trans "Reihenfolge folgt derzeit der Tabellenreihenfolge beim Speichern." %}</div>
|
||||
<div class="u-mt-12">
|
||||
<button class="btn btn-primary" type="submit">{% trans "Checkliste speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user