From 855eb8e02f94ebf5eac7edb83dea7ab22efd93b9 Mon Sep 17 00:00:00 2001 From: Md Bayazid Bostame Date: Fri, 27 Mar 2026 21:18:03 +0100 Subject: [PATCH] snapshot: preserve builder section-rules layout refinement --- .../static/workflows/css/form_builder.css | 43 +++++++++++-------- .../templates/workflows/form_builder.html | 15 +------ backend/workflows/views.py | 6 ++- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/backend/workflows/static/workflows/css/form_builder.css b/backend/workflows/static/workflows/css/form_builder.css index dc9b3e4..e5a3afc 100644 --- a/backend/workflows/static/workflows/css/form_builder.css +++ b/backend/workflows/static/workflows/css/form_builder.css @@ -1582,20 +1582,23 @@ body { .section-rule-grid { display: flex; flex-direction: column; - gap: 10px; + gap: 8px; + min-width: 0; } .section-rule-card { display: grid; - grid-template-columns: auto auto minmax(0, 1fr) auto; + grid-template-columns: 30px auto minmax(0, 1fr) auto; align-items: center; - gap: 12px; - padding: 14px 16px; + gap: 10px; + padding: 12px 14px; border: 1px solid #d6e0ec; - border-radius: 16px; + border-radius: 14px; background: linear-gradient(180deg, #fbfdff, #ffffff); transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; width: 100%; + box-sizing: border-box; + max-width: 100%; } .section-rule-card:hover { @@ -1608,6 +1611,13 @@ body { background: linear-gradient(180deg, #f5f8fc, #fbfdff); } +.section-rule-actions { + display: inline-flex; + align-items: center; + gap: 5px; + padding-right: 0; +} + .section-rule-order { display: inline-flex; align-items: center; @@ -1622,21 +1632,14 @@ body { 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 { - width: 34px; - height: 34px; + width: 32px; + height: 32px; border: 1px solid #cdd9e8; - border-radius: 11px; + border-radius: 10px; background: linear-gradient(180deg, #ffffff, #f5f9ff); color: #274264; - font-size: 15px; + font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; @@ -1659,13 +1662,13 @@ body { .section-rule-copy { display: grid; - gap: 4px; + gap: 3px; min-width: 0; } .section-rule-copy strong { color: #0f172a; - font-size: 15px; + font-size: 14px; font-weight: 700; overflow-wrap: anywhere; } @@ -1681,6 +1684,10 @@ body { display: inline-flex; align-items: center; gap: 8px; + min-width: 0; + justify-self: end; + justify-content: flex-end; + white-space: nowrap; } .section-rule-checkbox { diff --git a/backend/workflows/templates/workflows/form_builder.html b/backend/workflows/templates/workflows/form_builder.html index 576a138..01c788e 100644 --- a/backend/workflows/templates/workflows/form_builder.html +++ b/backend/workflows/templates/workflows/form_builder.html @@ -197,20 +197,8 @@
{% csrf_token %} - -
{% for section in section_rule_items %} - {% if active_section_rules_section == section.key %}
- {{ section.title }} + {{ section.display_title }} {% blocktrans trimmed with count=section.field_count %}{{ count }} Feld/Felder in diesem Abschnitt.{% endblocktrans %}
@@ -245,7 +233,6 @@
- {% endif %} {% endfor %}
diff --git a/backend/workflows/views.py b/backend/workflows/views.py index 4aa33ba..6416bee 100644 --- a/backend/workflows/views.py +++ b/backend/workflows/views.py @@ -1,4 +1,5 @@ from pathlib import Path +import re from datetime import timedelta from tempfile import NamedTemporaryFile import json @@ -2746,10 +2747,13 @@ def form_builder_page(request): cfg = section_configs.get(key) custom_cfg = custom_section_map.get(key) 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( { '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), 'locked': False if is_custom else (key in locked_sections and not can_override_locked_builder_rules), 'is_custom': is_custom,