refine form builder workspace interactions
This commit is contained in:
@@ -10,10 +10,51 @@
|
||||
{% block shell_body %}
|
||||
{% include 'workflows/includes/app_header.html' with header_show_home=1 header_inside_shell=1 %}
|
||||
|
||||
<div class="builder-workspace">
|
||||
<aside class="builder-sidebar">
|
||||
<div class="builder-sidebar-card">
|
||||
<span class="builder-sidebar-eyebrow">{% trans "Arbeitsbereich" %}</span>
|
||||
<h2>{% trans "Formularsteuerung" %}</h2>
|
||||
<p>{% trans "Arbeiten Sie blockweise: zuerst Struktur, dann Regeln, danach Inhalte und Erweiterungen." %}</p>
|
||||
</div>
|
||||
|
||||
<nav class="builder-side-nav" aria-label="{% trans 'Builder Navigation' %}">
|
||||
<a class="builder-side-link{% if active_module == 'structure' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=structure">
|
||||
<span class="builder-side-link-title">{% trans "Struktur & Reihenfolge" %}</span>
|
||||
<span class="builder-side-link-meta">{{ columns|length }} {% trans "Abschnitte" %}</span>
|
||||
</a>
|
||||
<a class="builder-side-link{% if active_module == 'section-rules' or active_module == 'field-rules' or active_module == 'conditional-rules' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=field-rules">
|
||||
<span class="builder-side-link-title">{% trans "Sichtbarkeit & Regeln" %}</span>
|
||||
<span class="builder-side-link-meta">{{ builder_summary.hidden_field_count }} {% trans "ausgeblendet" %}</span>
|
||||
</a>
|
||||
<a class="builder-side-link{% if active_module == 'options' or active_module == 'field-texts' or active_module == 'custom-sections' or active_module == 'custom-fields' or active_module == 'preview' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=options">
|
||||
<span class="builder-side-link-title">{% trans "Optionen & Texte" %}</span>
|
||||
<span class="builder-side-link-meta">{{ builder_summary.custom_field_count }} {% trans "eigene Felder" %}</span>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<div class="builder-sidebar-card builder-sidebar-stats">
|
||||
<div class="builder-side-stat">
|
||||
<strong>{{ builder_summary.configurable_field_count }}</strong>
|
||||
<span>{% trans "konfigurierbare Felder" %}</span>
|
||||
</div>
|
||||
<div class="builder-side-stat">
|
||||
<strong>{{ builder_summary.custom_section_count }}</strong>
|
||||
<span>{% trans "eigene Abschnitte" %}</span>
|
||||
</div>
|
||||
<div class="builder-side-stat">
|
||||
<strong>{{ builder_summary.custom_field_count }}</strong>
|
||||
<span>{% trans "eigene Felder" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="builder-main">
|
||||
<section class="builder-hero">
|
||||
<div class="builder-hero-copy">
|
||||
<span class="builder-eyebrow">{% trans "Deployment Configuration" %}</span>
|
||||
<h1>{% trans "Form Builder" %}</h1>
|
||||
<p class="builder-hero-sub">{% trans "Steuern Sie Struktur, Regeln und Inhalte Ihrer Standard-Workflows an einem Ort." %}</p>
|
||||
</div>
|
||||
<div class="builder-hero-actions">
|
||||
{% for key, label in form_types %}
|
||||
@@ -32,75 +73,150 @@
|
||||
|
||||
<div id="status-message" class="status" aria-live="polite"></div>
|
||||
|
||||
<details class="builder-panel builder-accordion js-single-accordion" data-accordion-group="builder-panels" id="builder-structure" {% if active_panel == 'builder-structure' %}open{% endif %}>
|
||||
<summary class="builder-panel-summary">
|
||||
<section class="builder-panel builder-module-surface{% if active_module != 'structure' %} builder-module-hidden{% endif %}" id="builder-structure">
|
||||
<div class="builder-panel-body builder-panel-body-static">
|
||||
<div class="builder-panel-head">
|
||||
<div>
|
||||
<div class="builder-panel-copy">
|
||||
<h2>{% trans "Struktur & Reihenfolge" %}</h2>
|
||||
<p class="builder-panel-sub">{% trans "Ordnen Sie Abschnitte und Felder in der Reihenfolge, in der sie im Formular erscheinen sollen." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ columns|length }} {% trans "Abschnitte" %}</span>
|
||||
<span class="builder-panel-count">{{ builder_summary.configurable_field_count }} {% trans "konfigurierbare Felder" %}</span>
|
||||
</div>
|
||||
<span class="builder-panel-toggle">{% trans "Geöffnet" %}</span>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="builder-panel-body">
|
||||
|
||||
<div class="columns {% if columns|length == 1 %}single{% endif %}" id="builder-columns" data-form-type="{{ form_type }}">
|
||||
{% for column in columns %}
|
||||
<section class="column" data-column-key="{{ column.key }}">
|
||||
<div class="column-head">
|
||||
<h3>{{ column.title }}</h3>
|
||||
<span class="column-count">{% blocktrans trimmed with count=column.items|length %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</div>
|
||||
<div class="dropzone" data-column-key="{{ column.key }}">
|
||||
{% for item in column.items %}
|
||||
<article class="field-card" draggable="true" data-field-name="{{ item.field_name }}">
|
||||
<div class="field-main">
|
||||
<div class="field-label">{{ item.label }}</div>
|
||||
<div class="field-name">{{ item.field_name }}</div>
|
||||
</div>
|
||||
<div class="badges">
|
||||
{% if item.is_custom %}<span class="badge">{% trans "Eigen" %}</span>{% endif %}
|
||||
{% if item.locked %}<span class="badge locked">{% trans "Fix" %}</span>{% endif %}
|
||||
{% if not item.is_visible %}<span class="badge hidden">{% trans "Ausgeblendet" %}</span>{% endif %}
|
||||
{% if item.is_required %}<span class="badge required">{% trans "Pflicht" %}</span>{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
<div class="structure-workspace">
|
||||
<aside class="structure-sidebar">
|
||||
<section class="structure-card">
|
||||
<span class="structure-card-eyebrow">{% trans "Arbeitsmodus" %}</span>
|
||||
<h3>{% trans "Direkte Anordnung" %}</h3>
|
||||
<p>{% trans "Verschieben Sie Felder direkt zwischen Abschnitten. Die Reihenfolge wird erst mit dem globalen Speichern oben übernommen." %}</p>
|
||||
</section>
|
||||
|
||||
<details class="builder-panel builder-accordion js-single-accordion" data-accordion-group="builder-panels" id="builder-rules" {% if active_panel == 'builder-rules' %}open{% endif %}>
|
||||
<summary class="builder-panel-summary">
|
||||
<section class="structure-card structure-card-muted">
|
||||
<div class="structure-stat">
|
||||
<strong>{{ columns|length }}</strong>
|
||||
<span>{% trans "aktive Abschnitte" %}</span>
|
||||
</div>
|
||||
<div class="structure-stat">
|
||||
<strong>{{ builder_summary.custom_field_count }}</strong>
|
||||
<span>{% trans "eigene Felder" %}</span>
|
||||
</div>
|
||||
<div class="structure-stat">
|
||||
<strong>{{ builder_summary.hidden_field_count }}</strong>
|
||||
<span>{% trans "ausgeblendete Felder" %}</span>
|
||||
</div>
|
||||
</section>
|
||||
</aside>
|
||||
|
||||
<div class="structure-canvas">
|
||||
<nav class="structure-section-nav" aria-label="{% trans 'Abschnitte' %}">
|
||||
{% for column in columns %}
|
||||
<a class="structure-section-pill{% if active_structure_section == column.key %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=structure&structure_section={{ column.key }}">
|
||||
<span class="structure-section-pill-index">{{ forloop.counter }}</span>
|
||||
<span class="structure-section-pill-copy">
|
||||
<strong>{{ column.title }}</strong>
|
||||
<span>{% blocktrans trimmed with count=column.items|length %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
|
||||
<div class="columns structure-columns-single" id="builder-columns" data-form-type="{{ form_type }}">
|
||||
{% for column in columns %}
|
||||
{% if active_structure_section == column.key %}
|
||||
<section class="column is-active" data-column-key="{{ column.key }}">
|
||||
<div class="column-head">
|
||||
<div>
|
||||
<h3>{{ column.title }}</h3>
|
||||
<span class="column-count">{% blocktrans trimmed with count=column.items|length %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</div>
|
||||
<span class="builder-panel-count">{% trans "Geöffnet" %}</span>
|
||||
</div>
|
||||
<div class="dropzone" data-column-key="{{ column.key }}">
|
||||
{% for item in column.items %}
|
||||
<article class="field-card" draggable="true" data-field-name="{{ item.field_name }}">
|
||||
<div class="field-main">
|
||||
<div class="field-label">{{ item.label }}</div>
|
||||
<div class="field-name">{{ item.field_name }}</div>
|
||||
</div>
|
||||
<div class="badges">
|
||||
{% if item.is_custom %}<span class="badge">{% trans "Eigen" %}</span>{% endif %}
|
||||
{% if item.locked %}<span class="badge locked">{% trans "Fix" %}</span>{% endif %}
|
||||
{% if not item.is_visible %}<span class="badge hidden">{% trans "Ausgeblendet" %}</span>{% endif %}
|
||||
{% if item.is_required %}<span class="badge required">{% trans "Pflicht" %}</span>{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% empty %}
|
||||
<div class="structure-empty">{% trans "Noch keine Felder in diesem Abschnitt." %}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="builder-panel builder-module-surface{% if active_module != 'section-rules' and active_module != 'field-rules' and active_module != 'conditional-rules' %} builder-module-hidden{% endif %}" id="builder-rules">
|
||||
<div class="builder-panel-body builder-panel-body-static">
|
||||
<div class="builder-panel-head">
|
||||
<div>
|
||||
<div class="builder-panel-copy">
|
||||
<h2>{% trans "Sichtbarkeit & Regeln" %}</h2>
|
||||
<p class="builder-panel-sub">{% trans "Legen Sie fest, welche Teile sichtbar, erforderlich oder regelgesteuert sein sollen." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ builder_summary.hidden_field_count }} {% trans "ausgeblendet" %}</span>
|
||||
<span class="builder-panel-count">{{ builder_summary.hidden_section_count }} {% trans "versteckte Abschnitte" %}</span>
|
||||
</div>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="builder-panel-body">
|
||||
|
||||
<nav class="builder-module-nav" aria-label="{% trans 'Regelmodule' %}">
|
||||
<a class="builder-module-link{% if active_module == 'section-rules' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=section-rules">{% trans "Abschnitte" %}</a>
|
||||
<a class="builder-module-link{% if active_module == 'field-rules' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=field-rules">{% trans "Feldregeln" %}</a>
|
||||
{% if form_type == 'onboarding' %}
|
||||
<a class="builder-module-link{% if active_module == 'conditional-rules' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=conditional-rules">{% trans "Bedingte Logik" %}</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
<div class="builder-stack-layout">
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-rules-subpanels" {% if active_rules_panel == 'section-rules' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
{% if active_module == 'section-rules' %}
|
||||
<section class="options-panel builder-module-card custom-fields-surface">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Abschnitte steuern" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Abschnitte steuern" %}</h2>
|
||||
<p class="options-sub">{% trans "Reihenfolge und Sichtbarkeit der Formularabschnitte." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ section_rule_items|length }} {% trans "Abschnitte" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="section_rules_section" value="{{ active_section_rules_section }}" />
|
||||
<nav class="structure-section-nav" aria-label="{% trans 'Abschnittsregeln' %}">
|
||||
{% for section in section_rule_items %}
|
||||
<a class="structure-section-pill{% if active_section_rules_section == section.key %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=section-rules§ion_rules_section={{ section.key }}">
|
||||
<span class="structure-section-pill-copy">
|
||||
<strong>{{ section.title }}</strong>
|
||||
<span>{% blocktrans trimmed with count=section.field_count %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
<div class="section-rule-grid" id="section-rule-grid">
|
||||
{% for section in section_rule_items %}
|
||||
{% if active_section_rules_section == section.key %}
|
||||
<article
|
||||
class="section-rule-card{% if section.locked %} is-locked{% endif %}"
|
||||
data-section-key="{{ section.key }}"
|
||||
>
|
||||
<input type="hidden" name="section_order" value="{{ section.key }}" />
|
||||
<div class="section-rule-order">{{ forloop.counter }}</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>
|
||||
@@ -129,27 +245,44 @@
|
||||
</span>
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_section_rules">{% trans "Abschnittsregeln speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% elif active_module == 'field-rules' %}
|
||||
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-rules-subpanels" {% if active_rules_panel == 'field-rules' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Feldregeln verwalten" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Feldregeln verwalten" %}</h2>
|
||||
<p class="options-sub">{% trans "Steuern Sie Sichtbarkeit und Pflichtstatus für einzelne Felder." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ builder_summary.configurable_field_count }} {% trans "konfigurierbar" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="field_rules_section" value="{{ active_field_rules_section }}" />
|
||||
<nav class="structure-section-nav" aria-label="{% trans 'Feldregel-Abschnitte' %}">
|
||||
{% for group in field_rule_groups %}
|
||||
<a class="structure-section-pill{% if active_field_rules_section == group.key %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=field-rules&field_rules_section={{ group.key }}">
|
||||
<span class="structure-section-pill-copy">
|
||||
<strong>{{ group.title }}</strong>
|
||||
<span>{% blocktrans trimmed with count=group.items|length %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
<div class="field-rule-groups">
|
||||
{% for group in field_rule_groups %}
|
||||
{% if active_field_rules_section == group.key %}
|
||||
<section class="field-rule-group">
|
||||
<div class="field-rule-group-head">
|
||||
<h3>{{ group.title }}</h3>
|
||||
@@ -161,30 +294,34 @@
|
||||
<div class="field-rule-main">
|
||||
<input type="hidden" name="field_rule_ids" value="{{ item.id }}" />
|
||||
<strong>{{ item.label }}</strong>
|
||||
<div class="mini">{{ item.field_name }}</div>
|
||||
<div class="field-rule-meta">
|
||||
<span class="entity-meta">{{ item.field_name }}</span>
|
||||
<div class="field-rule-status field-rule-status-inline">
|
||||
{% if item.locked %}
|
||||
<span class="badge locked">{% trans "Fix" %}</span>
|
||||
{% elif not item.is_visible %}
|
||||
<span class="badge hidden">{% trans "Ausgeblendet" %}</span>
|
||||
{% elif item.is_required %}
|
||||
<span class="badge required">{% trans "Pflicht" %}</span>
|
||||
{% else %}
|
||||
<span class="badge">{% trans "Flexibel" %}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label class="field-rule-control">
|
||||
<span>{% trans "Sichtbar" %}</span>
|
||||
<input type="checkbox" name="is_visible_{{ item.id }}" {% if item.is_visible %}checked{% endif %} {% if item.locked %}disabled{% endif %}/>
|
||||
</label>
|
||||
<label class="field-rule-control">
|
||||
<span>{% trans "Pflicht" %}</span>
|
||||
<select name="is_required_{{ item.id }}" {% if item.locked %}disabled{% endif %}>
|
||||
<option value="" {% if item.is_required is None %}selected{% endif %}>{% trans "Standard" %}</option>
|
||||
<option value="required" {% if item.is_required is True %}selected{% endif %}>{% trans "Pflicht" %}</option>
|
||||
<option value="optional" {% if item.is_required is False %}selected{% endif %}>{% trans "Optional" %}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="field-rule-status">
|
||||
{% if item.locked %}
|
||||
<span class="badge locked">{% trans "Fix" %}</span>
|
||||
{% elif not item.is_visible %}
|
||||
<span class="badge hidden">{% trans "Ausgeblendet" %}</span>
|
||||
{% elif item.is_required %}
|
||||
<span class="badge required">{% trans "Pflicht" %}</span>
|
||||
{% else %}
|
||||
<span class="badge">{% trans "Flexibel" %}</span>
|
||||
{% endif %}
|
||||
<div class="field-rule-settings">
|
||||
<label class="field-rule-control field-rule-control-compact">
|
||||
<span>{% trans "Sichtbar" %}</span>
|
||||
<input type="checkbox" name="is_visible_{{ item.id }}" {% if item.is_visible %}checked{% endif %} {% if item.locked %}disabled{% endif %}/>
|
||||
</label>
|
||||
<label class="field-rule-control field-rule-control-compact">
|
||||
<span>{% trans "Pflicht" %}</span>
|
||||
<select name="is_required_{{ item.id }}" {% if item.locked %}disabled{% endif %}>
|
||||
<option value="" {% if item.is_required is None %}selected{% endif %}>{% trans "Standard" %}</option>
|
||||
<option value="required" {% if item.is_required is True %}selected{% endif %}>{% trans "Pflicht" %}</option>
|
||||
<option value="optional" {% if item.is_required is False %}selected{% endif %}>{% trans "Optional" %}</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
@@ -192,28 +329,44 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_field_rules">{% trans "Feldregeln speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% elif form_type == 'onboarding' and active_module == 'conditional-rules' %}
|
||||
|
||||
{% if form_type == 'onboarding' %}
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-rules-subpanels" {% if active_rules_panel == 'conditional-rules' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Bedingte Logik" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Bedingte Logik" %}</h2>
|
||||
<p class="options-sub">{% trans "Lassen Sie Felder abhängig von anderen Antworten ein- oder ausblenden." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ conditional_rule_items|length }} {% trans "Regeln" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="conditional_target" value="{{ active_conditional_target }}" />
|
||||
<nav class="structure-section-nav" aria-label="{% trans 'Bedingte Regeln' %}">
|
||||
{% for item in conditional_rule_items %}
|
||||
<a class="structure-section-pill{% if active_conditional_target == item.target_key %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=conditional-rules&conditional_target={{ item.target_key }}">
|
||||
<span class="structure-section-pill-copy">
|
||||
<strong>{{ item.title }}</strong>
|
||||
<span>{% blocktrans trimmed with count=item.target_fields|length %}{{ count }} Ziel-Feld/Felder{% endblocktrans %}</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
<div class="conditional-rule-grid">
|
||||
{% for item in conditional_rule_items %}
|
||||
{% if active_conditional_target == item.target_key %}
|
||||
<section class="conditional-rule-card">
|
||||
<div class="conditional-rule-head">
|
||||
<div class="conditional-rule-head-main">
|
||||
@@ -228,6 +381,26 @@
|
||||
<input type="checkbox" name="conditional_active_{{ item.target_key }}" {% if item.is_active %}checked{% endif %} />
|
||||
</label>
|
||||
</div>
|
||||
<div class="conditional-rule-summary">
|
||||
<span class="conditional-summary-prefix">{% trans "Sichtbar, wenn" %}</span>
|
||||
<div class="conditional-summary-chips">
|
||||
{% with first_clause=item.clauses.0 second_clause=item.clauses.1 %}
|
||||
{% if first_clause.field %}
|
||||
<span class="preview-chip">{{ first_clause.field }}</span>
|
||||
<span class="preview-chip">{{ first_clause.operator }}</span>
|
||||
{% if first_clause.value %}<span class="preview-chip">{{ first_clause.value }}</span>{% endif %}
|
||||
{% else %}
|
||||
<span class="preview-chip">{% trans "Keine Bedingung" %}</span>
|
||||
{% endif %}
|
||||
{% if second_clause.field %}
|
||||
<span class="preview-chip">{% trans "und" %}</span>
|
||||
<span class="preview-chip">{{ second_clause.field }}</span>
|
||||
<span class="preview-chip">{{ second_clause.operator }}</span>
|
||||
{% if second_clause.value %}<span class="preview-chip">{{ second_clause.value }}</span>{% endif %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="conditional-targets">
|
||||
<span class="conditional-target-label">{% trans "Steuert" %}</span>
|
||||
<div class="conditional-target-chips">
|
||||
@@ -238,105 +411,94 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="conditional-clause-list">
|
||||
<div class="conditional-sentence-builder">
|
||||
{% with first_clause=item.clauses.0 second_clause=item.clauses.1 %}
|
||||
<div class="conditional-clause-row">
|
||||
<div class="conditional-clause-index">
|
||||
{% trans "Wenn" %}
|
||||
</div>
|
||||
<label class="conditional-clause-control conditional-clause-field">
|
||||
<span>{% trans "Feld" %}</span>
|
||||
<select name="conditional_field_{{ item.target_key }}_0">
|
||||
<option value="">{% trans "Keine" %}</option>
|
||||
{% for value, label in item.field_choices %}
|
||||
<option value="{{ value }}" {% if first_clause.field == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="conditional-clause-control conditional-clause-operator">
|
||||
<span>{% trans "Operator" %}</span>
|
||||
<select name="conditional_operator_{{ item.target_key }}_0">
|
||||
{% for value, label in item.operator_choices %}
|
||||
<option value="{{ value }}" {% if first_clause.operator == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="conditional-clause-control conditional-clause-value">
|
||||
<span>{% trans "Wert" %}</span>
|
||||
<input type="text" name="conditional_value_{{ item.target_key }}_0" value="{{ first_clause.value }}" {% if first_clause.operator == 'checked' %}placeholder="{% trans 'wird ignoriert' %}"{% endif %} />
|
||||
</label>
|
||||
<div class="conditional-sentence-row">
|
||||
<span class="conditional-sentence-label">{% trans "Zeige dieses Element, wenn" %}</span>
|
||||
<select name="conditional_field_{{ item.target_key }}_0">
|
||||
<option value="">{% trans "Keine" %}</option>
|
||||
{% for value, label in item.field_choices %}
|
||||
<option value="{{ value }}" {% if first_clause.field == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select name="conditional_operator_{{ item.target_key }}_0">
|
||||
{% for value, label in item.operator_choices %}
|
||||
<option value="{{ value }}" {% if first_clause.operator == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="text" name="conditional_value_{{ item.target_key }}_0" value="{{ first_clause.value }}" placeholder="{% trans 'Wert' %}" />
|
||||
</div>
|
||||
<details class="conditional-extra-clause" {% if second_clause.field %}open{% endif %}>
|
||||
<summary>{% trans "Zusätzliche Bedingung" %}</summary>
|
||||
<div class="conditional-clause-row conditional-clause-row-secondary">
|
||||
<div class="conditional-clause-index">
|
||||
{% trans "Und" %}
|
||||
</div>
|
||||
<label class="conditional-clause-control conditional-clause-field">
|
||||
<span>{% trans "Feld" %}</span>
|
||||
<select name="conditional_field_{{ item.target_key }}_1">
|
||||
<option value="">{% trans "Keine" %}</option>
|
||||
{% for value, label in item.field_choices %}
|
||||
<option value="{{ value }}" {% if second_clause.field == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="conditional-clause-control conditional-clause-operator">
|
||||
<span>{% trans "Operator" %}</span>
|
||||
<select name="conditional_operator_{{ item.target_key }}_1">
|
||||
{% for value, label in item.operator_choices %}
|
||||
<option value="{{ value }}" {% if second_clause.operator == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label class="conditional-clause-control conditional-clause-value">
|
||||
<span>{% trans "Wert" %}</span>
|
||||
<input type="text" name="conditional_value_{{ item.target_key }}_1" value="{{ second_clause.value }}" {% if second_clause.operator == 'checked' %}placeholder="{% trans 'wird ignoriert' %}"{% endif %} />
|
||||
</label>
|
||||
<div class="conditional-sentence-row conditional-sentence-row-secondary">
|
||||
<span class="conditional-sentence-label">{% trans "Und zusätzlich" %}</span>
|
||||
<select name="conditional_field_{{ item.target_key }}_1">
|
||||
<option value="">{% trans "Keine" %}</option>
|
||||
{% for value, label in item.field_choices %}
|
||||
<option value="{{ value }}" {% if second_clause.field == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select name="conditional_operator_{{ item.target_key }}_1">
|
||||
{% for value, label in item.operator_choices %}
|
||||
<option value="{{ value }}" {% if second_clause.operator == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="text" name="conditional_value_{{ item.target_key }}_1" value="{{ second_clause.value }}" placeholder="{% trans 'Wert' %}" />
|
||||
</div>
|
||||
</details>
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="conditional-clause-list">
|
||||
<span class="mini">{% trans "Nutzen Sie die zusätzliche Bedingung nur, wenn ein zweites Kriterium wirklich nötig ist." %}</span>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_conditional_rules">{% trans "Bedingte Logik speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
|
||||
<details class="builder-panel builder-accordion js-single-accordion" data-accordion-group="builder-panels" id="builder-content" {% if active_panel == 'builder-content' %}open{% endif %}>
|
||||
<summary class="builder-panel-summary">
|
||||
<section class="builder-panel builder-module-surface{% if active_module != 'options' and active_module != 'field-texts' and active_module != 'custom-sections' and active_module != 'custom-fields' and active_module != 'preview' %} builder-module-hidden{% endif %}" id="builder-content">
|
||||
<div class="builder-panel-body builder-panel-body-static">
|
||||
<div class="builder-panel-head">
|
||||
<div>
|
||||
<div class="builder-panel-copy">
|
||||
<h2>{% trans "Optionen & Texte" %}</h2>
|
||||
<p class="builder-panel-sub">{% trans "Pflegen Sie Auswahlwerte, Feldtexte und benutzerdefinierte Erweiterungen." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ builder_summary.custom_field_count }} {% trans "eigene Felder" %}</span>
|
||||
{% if form_type == 'onboarding' %}
|
||||
<span class="builder-panel-count">{{ builder_summary.custom_section_count }} {% trans "eigene Abschnitte" %}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="builder-panel-body">
|
||||
|
||||
<nav class="builder-module-nav" aria-label="{% trans 'Inhaltsmodule' %}">
|
||||
<a class="builder-module-link{% if active_module == 'options' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=options">{% trans "Optionen" %}</a>
|
||||
<a class="builder-module-link{% if active_module == 'field-texts' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=field-texts">{% trans "Feldtexte" %}</a>
|
||||
{% if form_type == 'onboarding' %}
|
||||
<a class="builder-module-link{% if active_module == 'custom-sections' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=custom-sections">{% trans "Eigene Abschnitte" %}</a>
|
||||
{% endif %}
|
||||
<a class="builder-module-link{% if active_module == 'custom-fields' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=custom-fields">{% trans "Eigene Felder" %}</a>
|
||||
<a class="builder-module-link{% if active_module == 'preview' %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=preview">{% trans "Vorschau" %}</a>
|
||||
</nav>
|
||||
|
||||
<div class="builder-stack-layout">
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-content-subpanels" {% if active_subpanel == 'options' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Optionen verwalten" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
{% if active_module == 'options' %}
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head options-head-inline">
|
||||
<form class="category-switch" method="get" action="/admin-tools/form-builder/">
|
||||
<input type="hidden" name="form_type" value="{{ form_type }}" />
|
||||
<input type="hidden" name="anchor" value="builder-content" />
|
||||
<input type="hidden" name="panel" value="builder-content" />
|
||||
<input type="hidden" name="subpanel" value="options" />
|
||||
<input type="hidden" name="module" value="options" />
|
||||
<label for="option_category">{% trans "Kategorie" %}</label>
|
||||
<select id="option_category" name="option_category" onchange="this.form.submit()">
|
||||
{% for value, label in option_categories %}
|
||||
@@ -358,106 +520,130 @@
|
||||
|
||||
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<div class="option-table-wrap">
|
||||
<table class="option-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Sortierung" %}</th>
|
||||
<th>{% trans "Label (DE)" %}</th>
|
||||
<th>{% trans "Label (EN)" %}</th>
|
||||
<th>Value</th>
|
||||
<th>{% trans "Aktiv" %}</th>
|
||||
<th>{% trans "Löschen" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="option-table-body">
|
||||
{% for item in option_items %}
|
||||
<tr class="option-row" draggable="true" data-option-row="1">
|
||||
<td>
|
||||
<input type="hidden" name="option_ids" value="{{ item.id }}" />
|
||||
<span class="drag-handle" title="{% trans 'Ziehen zum Sortieren' %}">⋮⋮</span>
|
||||
</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><input type="text" name="value_{{ item.id }}" value="{{ item.value }}" /></td>
|
||||
<td><input type="checkbox" name="active_{{ item.id }}" {% if item.is_active %}checked{% endif %} /></td>
|
||||
<td>
|
||||
<button class="btn btn-secondary" type="submit" name="delete_option_id" value="{{ item.id }}" data-confirm="{% trans 'Option wirklich löschen?' %}">{% trans "Löschen" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6">{% trans "Keine Optionen in dieser Kategorie." %}</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="option-card-list" id="option-table-body">
|
||||
{% for item in option_items %}
|
||||
<article class="option-row option-card" draggable="true" data-option-row="1">
|
||||
<input type="hidden" name="option_ids" value="{{ item.id }}" />
|
||||
<div class="option-card-head">
|
||||
<div class="option-card-order">
|
||||
<span class="drag-handle" title="{% trans 'Ziehen zum Sortieren' %}">⋮⋮</span>
|
||||
<div class="option-card-title-block">
|
||||
<strong>{{ item.label }}</strong>
|
||||
<span class="option-card-meta">#{{ forloop.counter }}{% if item.value %} · {{ item.value }}{% endif %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="option-card-actions">
|
||||
<label class="option-card-toggle">
|
||||
<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_option_id" value="{{ item.id }}" data-confirm="{% trans 'Option wirklich löschen?' %}">{% trans "Löschen" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="option-card-grid">
|
||||
<label class="builder-entity-control">
|
||||
<span>{% trans "Label (DE)" %}</span>
|
||||
<input type="text" name="label_{{ item.id }}" value="{{ item.label }}" required />
|
||||
</label>
|
||||
<label class="builder-entity-control">
|
||||
<span>{% trans "Label (EN)" %}</span>
|
||||
<input type="text" name="label_en_{{ item.id }}" value="{{ item.label_en }}" />
|
||||
</label>
|
||||
<label class="builder-entity-control">
|
||||
<span>Value</span>
|
||||
<input type="text" name="value_{{ item.id }}" value="{{ item.value }}" />
|
||||
</label>
|
||||
</div>
|
||||
</article>
|
||||
{% empty %}
|
||||
<div class="option-empty-state">{% trans "Keine Optionen in dieser Kategorie." %}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_options">{% trans "Optionen speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% elif active_module == 'field-texts' %}
|
||||
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-content-subpanels" {% if active_subpanel == 'field-texts' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Feldtexte verwalten" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Feldtexte verwalten" %}</h2>
|
||||
<p class="options-sub">{% trans "Überschreiben Sie Labels und Hilfetexte pro Feld." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<div class="option-table-wrap">
|
||||
<table class="option-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Feld" %}</th>
|
||||
<th>{% trans "Label (DE)" %}</th>
|
||||
<th>{% trans "Label (EN)" %}</th>
|
||||
<th>{% trans "Hilfetext (DE)" %}</th>
|
||||
<th>{% trans "Hilfetext (EN)" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group in field_text_groups %}
|
||||
<tr class="option-table-group-row">
|
||||
<th colspan="5">{{ group.title }}</th>
|
||||
</tr>
|
||||
{% for item in group.items %}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" name="field_ids" value="{{ item.id }}" />
|
||||
<strong>{{ item.field_name }}</strong>
|
||||
</td>
|
||||
<td><input type="text" name="label_override_{{ item.id }}" value="{{ item.label_override }}" placeholder="{% trans 'Fallback: Standardlabel' %}" /></td>
|
||||
<td><input type="text" name="label_override_en_{{ item.id }}" value="{{ item.label_override_en }}" placeholder="{% trans 'English label' %}" /></td>
|
||||
<td><input type="text" name="help_text_override_{{ item.id }}" value="{{ item.help_text_override }}" placeholder="{% trans 'Optionaler Hilfetext' %}" /></td>
|
||||
<td><input type="text" name="help_text_override_en_{{ item.id }}" value="{{ item.help_text_override_en }}" placeholder="{% trans 'Optional English help text' %}" /></td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="5">{% trans "Keine Feldkonfigurationen verfügbar." %}</td></tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="field_texts_section" value="{{ active_field_texts_section }}" />
|
||||
<nav class="structure-section-nav" aria-label="{% trans 'Feldtext-Abschnitte' %}">
|
||||
{% for group in field_text_groups %}
|
||||
<a class="structure-section-pill{% if active_field_texts_section == group.key %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=field-texts&field_texts_section={{ group.key }}">
|
||||
<span class="structure-section-pill-copy">
|
||||
<strong>{{ group.title }}</strong>
|
||||
<span>{% blocktrans trimmed with count=group.items|length %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
<div class="field-text-card-list">
|
||||
{% for group in field_text_groups %}
|
||||
{% if active_field_texts_section == group.key %}
|
||||
{% for item in group.items %}
|
||||
<article class="field-text-card">
|
||||
<input type="hidden" name="field_ids" value="{{ item.id }}" />
|
||||
<div class="field-text-card-head">
|
||||
<div>
|
||||
<strong>{{ item.label_override|default:item.field_name }}</strong>
|
||||
<div class="entity-meta">{{ item.field_name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-text-card-grid">
|
||||
<label class="builder-entity-control">
|
||||
<span>{% trans "Label (DE)" %}</span>
|
||||
<input type="text" name="label_override_{{ item.id }}" value="{{ item.label_override }}" placeholder="{% trans 'Fallback: Standardlabel' %}" />
|
||||
</label>
|
||||
<label class="builder-entity-control">
|
||||
<span>{% trans "Label (EN)" %}</span>
|
||||
<input type="text" name="label_override_en_{{ item.id }}" value="{{ item.label_override_en }}" placeholder="{% trans 'English label' %}" />
|
||||
</label>
|
||||
<label class="builder-entity-control">
|
||||
<span>{% trans "Hilfetext (DE)" %}</span>
|
||||
<input type="text" name="help_text_override_{{ item.id }}" value="{{ item.help_text_override }}" placeholder="{% trans 'Optionaler Hilfetext' %}" />
|
||||
</label>
|
||||
<label class="builder-entity-control">
|
||||
<span>{% trans "Hilfetext (EN)" %}</span>
|
||||
<input type="text" name="help_text_override_en_{{ item.id }}" value="{{ item.help_text_override_en }}" placeholder="{% trans 'Optional English help text' %}" />
|
||||
</label>
|
||||
</div>
|
||||
</article>
|
||||
{% empty %}
|
||||
<div class="builder-empty-state">{% trans "Keine Feldkonfigurationen verfügbar." %}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_field_texts">{% trans "Feldtexte speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% elif form_type == 'onboarding' and active_module == 'custom-sections' %}
|
||||
|
||||
{% if form_type == 'onboarding' %}
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-content-subpanels" {% if active_subpanel == 'custom-sections' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Eigene Abschnitte" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Eigene Abschnitte" %}</h2>
|
||||
<p class="options-sub">{% trans "Erweitern Sie den Workflow um eigene inhaltliche Blöcke." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ builder_summary.custom_section_count }} {% trans "eigene Abschnitte" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<form class="builder-entity-form" method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="builder_action" value="add_custom_section" />
|
||||
@@ -496,13 +682,16 @@
|
||||
<div>
|
||||
<strong>{{ item.title }}</strong>
|
||||
<div class="entity-meta">{{ item.section_key }}</div>
|
||||
<div class="builder-inline-meta">
|
||||
<span class="badge">{{ item.custom_field_count }} {% trans "Feld/Felder" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<button class="btn btn-secondary" type="submit" name="delete_custom_section_id" value="{{ item.id }}" data-confirm="{% blocktrans trimmed with count=item.custom_field_count %}Eigenen Abschnitt wirklich löschen? {{ count }} zugehörige eigene Felder werden ebenfalls entfernt.{% endblocktrans %}">{% trans "Löschen" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="builder-entity-grid">
|
||||
@@ -524,22 +713,25 @@
|
||||
<div class="builder-empty-state">{% trans "Keine eigenen Abschnitte vorhanden." %}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_custom_sections">{% trans "Abschnitte speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% elif active_module == 'custom-fields' %}
|
||||
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-content-subpanels" {% if active_subpanel == 'custom-fields' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Eigene Felder" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Eigene Felder" %}</h2>
|
||||
<p class="options-sub">{% trans "Erstellen Sie zusätzliche Eingaben innerhalb bestehender oder eigener Abschnitte." %}</p>
|
||||
</div>
|
||||
<div class="builder-panel-meta">
|
||||
<span class="builder-panel-count">{{ builder_summary.custom_field_count }} {% trans "eigene Felder" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<form class="builder-entity-form" method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="builder_action" value="add_custom_field" />
|
||||
@@ -606,8 +798,20 @@
|
||||
|
||||
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="custom_fields_section" value="{{ active_custom_fields_section }}" />
|
||||
<nav class="structure-section-nav" aria-label="{% trans 'Eigene Feld-Abschnitte' %}">
|
||||
{% for group in custom_field_groups %}
|
||||
<a class="structure-section-pill{% if active_custom_fields_section == group.key %} is-active{% endif %}" href="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}&module=custom-fields&custom_fields_section={{ group.key }}">
|
||||
<span class="structure-section-pill-copy">
|
||||
<strong>{{ group.title }}</strong>
|
||||
<span>{% blocktrans trimmed with count=group.items|length %}{{ count }} Feld/Felder{% endblocktrans %}</span>
|
||||
</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
<div class="builder-group-stack">
|
||||
{% for group in custom_field_groups %}
|
||||
{% if active_custom_fields_section == group.key %}
|
||||
<section class="builder-group-card">
|
||||
<div class="builder-group-head">
|
||||
<h3>{{ group.title }}</h3>
|
||||
@@ -686,23 +890,25 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="options-actions">
|
||||
<div class="options-actions options-actions-sticky">
|
||||
<button class="btn btn-primary" type="submit" name="builder_action" value="save_custom_fields">{% trans "Eigene Felder speichern" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% elif active_module == 'preview' %}
|
||||
|
||||
<details class="options-panel nested-accordion js-single-accordion" data-accordion-group="builder-content-subpanels" {% if active_subpanel == 'preview' %}open{% endif %}>
|
||||
<summary class="nested-accordion-summary">
|
||||
<section class="options-panel builder-module-card">
|
||||
<div class="module-card-body">
|
||||
<div class="options-head">
|
||||
<h2>{% trans "Live-Vorschau" %}</h2>
|
||||
<span class="builder-panel-toggle">{% trans "Öffnen" %}</span>
|
||||
<div class="options-copy">
|
||||
<h2>{% trans "Live-Vorschau" %}</h2>
|
||||
<p class="options-sub">{% trans "So wirkt die aktuelle Struktur für das aktive Formular." %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</summary>
|
||||
<div class="nested-accordion-body">
|
||||
<div class="preview-shell preview-shell-compact">
|
||||
{% for section in preview_sections %}
|
||||
<section class="preview-section">
|
||||
@@ -721,27 +927,16 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
<script src="{% static 'workflows/js/form_builder.js' %}"></script>
|
||||
<script>
|
||||
(() => {
|
||||
const accordions = document.querySelectorAll('.js-single-accordion[data-accordion-group]');
|
||||
accordions.forEach((accordion) => {
|
||||
accordion.addEventListener('toggle', () => {
|
||||
if (!accordion.open) return;
|
||||
const group = accordion.dataset.accordionGroup;
|
||||
document.querySelectorAll(`.js-single-accordion[data-accordion-group="${group}"]`).forEach((peer) => {
|
||||
if (peer !== accordion) peer.open = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user