snapshot: preserve builder deletion and onboarding ux improvements

This commit is contained in:
Md Bayazid Bostame
2026-03-27 17:02:06 +01:00
parent 30877ed8ee
commit b0cc5bda78
9 changed files with 300 additions and 140 deletions

View File

@@ -98,11 +98,17 @@
{% for section in section_rule_items %}
<article
class="section-rule-card{% if section.locked %} is-locked{% endif %}"
draggable="true"
data-section-key="{{ section.key }}"
>
<input type="hidden" name="section_order" value="{{ section.key }}" />
<div class="section-rule-drag" aria-hidden="true" title="{% trans 'Zum Verschieben ziehen' %}">⋮⋮</div>
<div class="section-rule-actions">
<button class="section-move-btn" type="button" data-move-section="up" aria-label="{% trans 'Nach oben' %}" title="{% trans 'Nach oben' %}">
<span aria-hidden="true"></span>
</button>
<button class="section-move-btn" type="button" data-move-section="down" aria-label="{% trans 'Nach unten' %}" title="{% trans 'Nach unten' %}">
<span aria-hidden="true"></span>
</button>
</div>
<div class="section-rule-copy">
<strong>{{ section.title }}</strong>
<span>{% blocktrans trimmed with count=section.field_count %}{{ count }} Feld/Felder in diesem Abschnitt.{% endblocktrans %}</span>
@@ -491,10 +497,13 @@
<strong>{{ item.title }}</strong>
<div class="entity-meta">{{ item.section_key }}</div>
</div>
<label class="builder-switch">
<input type="checkbox" name="custom_section_is_active_{{ item.id }}" {% if item.is_active %}checked{% endif %} />
<span>{% trans "Aktiv" %}</span>
</label>
<div class="builder-card-head-actions">
<label class="builder-switch">
<input type="checkbox" name="custom_section_is_active_{{ item.id }}" {% if item.is_active %}checked{% endif %} />
<span>{% trans "Aktiv" %}</span>
</label>
<button class="btn btn-secondary" type="submit" name="delete_custom_section_id" value="{{ item.id }}" data-confirm="{% trans 'Eigenen Abschnitt wirklich löschen? Zugehörige eigene Felder werden ebenfalls entfernt.' %}">{% trans "Löschen" %}</button>
</div>
</div>
<div class="builder-entity-grid">
<label class="builder-entity-control">
@@ -613,7 +622,7 @@
<strong>{{ item.label }}</strong>
<div class="entity-meta">{{ item.field_key }}</div>
</div>
<div class="builder-switch-stack">
<div class="builder-switch-stack">
<label class="builder-switch">
<input type="checkbox" name="custom_is_required_{{ item.id }}" {% if item.is_required %}checked{% endif %} />
<span>{% trans "Pflicht" %}</span>
@@ -622,8 +631,9 @@
<input type="checkbox" name="custom_is_active_{{ item.id }}" {% if item.is_active %}checked{% endif %} />
<span>{% trans "Aktiv" %}</span>
</label>
</div>
</div>
<button class="btn btn-secondary" type="submit" name="delete_custom_field_id" value="{{ item.id }}" data-confirm="{% trans 'Eigenes Feld wirklich löschen?' %}">{% trans "Löschen" %}</button>
</div>
<div class="builder-entity-grid">
<label class="builder-entity-control">
<span>{% trans "Abschnitt" %}</span>
@@ -670,9 +680,6 @@
<textarea name="custom_select_options_en_{{ item.id }}" rows="2">{{ item.select_options_en }}</textarea>
</label>
</div>
<div class="builder-entity-card-actions">
<button class="btn btn-secondary" type="submit" name="delete_custom_field_id" value="{{ item.id }}" data-confirm="{% trans 'Eigenes Feld wirklich löschen?' %}">{% trans "Löschen" %}</button>
</div>
</article>
{% empty %}
<div class="builder-empty-state">{% trans "Keine eigenen Felder vorhanden." %}</div>

View File

@@ -50,8 +50,19 @@
<section class="page {% if forloop.first %}active{% endif %}" data-step="{{ forloop.counter }}">
<div class="section-card section-{{ section.key }}">
<div class="section-head">
<h2>{{ section.title }}</h2>
<p>{{ section.subtitle }}</p>
<div>
<h2>{{ section.title }}</h2>
<p>{{ section.subtitle }}</p>
</div>
{% if section.has_custom_checkbox_fields %}
<button
type="button"
class="checklist-toggle-btn section-toggle-btn"
data-section-checkbox-toggle
data-label-select="{% trans 'Alle auswählen' %}"
data-label-clear="{% trans 'Auswahl aufheben' %}"
>{% trans "Alle auswählen" %}</button>
{% endif %}
</div>
<div class="grid-2">
{% for block in section.blocks %}
@@ -78,7 +89,7 @@
</div>
</div>
{% elif field.name in onboarding_inline_checks or field.field.widget.input_type == 'checkbox' %}
<div class="field inline-check field-full {% if section.key == 'abschluss' %}finish-check{% endif %}">
<div class="field inline-check field-full {% if section.key == 'abschluss' %}finish-check{% endif %} {% if field.name|slice:':8' == 'custom__' and field.field.widget.input_type == 'checkbox' %}custom-section-checkbox{% endif %}">
{{ field }} {{ field.label_tag }}
{% if field.help_text %}<div class="hint">{{ field.help_text }}</div>{% endif %}
{{ field.errors }}
@@ -121,7 +132,7 @@
</div>
</div>
{% elif field.name in onboarding_inline_checks or field.field.widget.input_type == 'checkbox' %}
<div class="field inline-check field-full {% if section.key == 'abschluss' %}finish-check{% endif %}">
<div class="field inline-check field-full {% if section.key == 'abschluss' %}finish-check{% endif %} {% if field.name|slice:':8' == 'custom__' and field.field.widget.input_type == 'checkbox' %}custom-section-checkbox{% endif %}">
{{ field }} {{ field.label_tag }}
{% if field.help_text %}<div class="hint">{{ field.help_text }}</div>{% endif %}
{{ field.errors }}