snapshot: preserve builder section-rules layout refinement

This commit is contained in:
Md Bayazid Bostame
2026-03-27 21:18:03 +01:00
parent 61e3fae18d
commit 855eb8e02f
3 changed files with 31 additions and 33 deletions

View File

@@ -1582,20 +1582,23 @@ body {
.section-rule-grid { .section-rule-grid {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 10px; gap: 8px;
min-width: 0;
} }
.section-rule-card { .section-rule-card {
display: grid; display: grid;
grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-columns: 30px auto minmax(0, 1fr) auto;
align-items: center; align-items: center;
gap: 12px; gap: 10px;
padding: 14px 16px; padding: 12px 14px;
border: 1px solid #d6e0ec; border: 1px solid #d6e0ec;
border-radius: 16px; border-radius: 14px;
background: linear-gradient(180deg, #fbfdff, #ffffff); background: linear-gradient(180deg, #fbfdff, #ffffff);
transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
width: 100%; width: 100%;
box-sizing: border-box;
max-width: 100%;
} }
.section-rule-card:hover { .section-rule-card:hover {
@@ -1608,6 +1611,13 @@ body {
background: linear-gradient(180deg, #f5f8fc, #fbfdff); background: linear-gradient(180deg, #f5f8fc, #fbfdff);
} }
.section-rule-actions {
display: inline-flex;
align-items: center;
gap: 5px;
padding-right: 0;
}
.section-rule-order { .section-rule-order {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -1622,21 +1632,14 @@ body {
box-shadow: inset 0 0 0 1px #cdddff; box-shadow: inset 0 0 0 1px #cdddff;
} }
.section-rule-actions {
display: inline-flex;
align-items: center;
gap: 6px;
padding-right: 2px;
}
.section-move-btn { .section-move-btn {
width: 34px; width: 32px;
height: 34px; height: 32px;
border: 1px solid #cdd9e8; border: 1px solid #cdd9e8;
border-radius: 11px; border-radius: 10px;
background: linear-gradient(180deg, #ffffff, #f5f9ff); background: linear-gradient(180deg, #ffffff, #f5f9ff);
color: #274264; color: #274264;
font-size: 15px; font-size: 14px;
font-weight: 700; font-weight: 700;
line-height: 1; line-height: 1;
cursor: pointer; cursor: pointer;
@@ -1659,13 +1662,13 @@ body {
.section-rule-copy { .section-rule-copy {
display: grid; display: grid;
gap: 4px; gap: 3px;
min-width: 0; min-width: 0;
} }
.section-rule-copy strong { .section-rule-copy strong {
color: #0f172a; color: #0f172a;
font-size: 15px; font-size: 14px;
font-weight: 700; font-weight: 700;
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
@@ -1681,6 +1684,10 @@ body {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
min-width: 0;
justify-self: end;
justify-content: flex-end;
white-space: nowrap;
} }
.section-rule-checkbox { .section-rule-checkbox {

View File

@@ -197,20 +197,8 @@
</div> </div>
<form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}"> <form method="post" action="/admin-tools/form-builder/?form_type={{ form_type }}&option_category={{ selected_option_category }}">
{% csrf_token %} {% 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&section_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"> <div class="section-rule-grid" id="section-rule-grid">
{% for section in section_rule_items %} {% for section in section_rule_items %}
{% if active_section_rules_section == section.key %}
<article <article
class="section-rule-card{% if section.locked %} is-locked{% endif %}" class="section-rule-card{% if section.locked %} is-locked{% endif %}"
data-section-key="{{ section.key }}" data-section-key="{{ section.key }}"
@@ -226,7 +214,7 @@
</button> </button>
</div> </div>
<div class="section-rule-copy"> <div class="section-rule-copy">
<strong>{{ section.title }}</strong> <strong>{{ section.display_title }}</strong>
<span>{% blocktrans trimmed with count=section.field_count %}{{ count }} Feld/Felder in diesem Abschnitt.{% endblocktrans %}</span> <span>{% blocktrans trimmed with count=section.field_count %}{{ count }} Feld/Felder in diesem Abschnitt.{% endblocktrans %}</span>
</div> </div>
<div class="section-rule-toggle"> <div class="section-rule-toggle">
@@ -245,7 +233,6 @@
</span> </span>
</div> </div>
</article> </article>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
<div class="options-actions options-actions-sticky"> <div class="options-actions options-actions-sticky">

View File

@@ -1,4 +1,5 @@
from pathlib import Path from pathlib import Path
import re
from datetime import timedelta from datetime import timedelta
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
import json import json
@@ -2746,10 +2747,13 @@ def form_builder_page(request):
cfg = section_configs.get(key) cfg = section_configs.get(key)
custom_cfg = custom_section_map.get(key) custom_cfg = custom_section_map.get(key)
is_custom = custom_cfg is not None is_custom = custom_cfg is not None
raw_title = section_labels.get(key, key)
display_title = re.sub(r'^\d+\.\s*', '', raw_title) if not is_custom else raw_title
section_rule_items.append( section_rule_items.append(
{ {
'key': key, 'key': key,
'title': section_labels.get(key, key), 'title': raw_title,
'display_title': display_title,
'is_visible': bool(custom_cfg.is_active) if is_custom else (True if not cfg else cfg.is_visible), 'is_visible': bool(custom_cfg.is_active) if is_custom else (True if not cfg else cfg.is_visible),
'locked': False if is_custom else (key in locked_sections and not can_override_locked_builder_rules), 'locked': False if is_custom else (key in locked_sections and not can_override_locked_builder_rules),
'is_custom': is_custom, 'is_custom': is_custom,