From aed1c4dc0917377eee781e73363bb0477d2eab9a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 11:34:39 +0000 Subject: [PATCH 1/7] Initial plan From 276977287764960ede33212e28d1accbb506321c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 11:47:34 +0000 Subject: [PATCH 2/7] Make form column layout configurable with global Twig variables Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- config/packages/twig.yaml | 4 ++++ templates/admin/_delete_form.html.twig | 2 +- templates/admin/_export_form.html.twig | 2 +- templates/admin/base_admin.html.twig | 4 ++-- templates/admin/category_admin.html.twig | 6 +++--- templates/admin/footprint_admin.html.twig | 2 +- templates/admin/label_profile_admin.html.twig | 2 +- templates/admin/project_admin.html.twig | 4 ++-- templates/admin/storelocation_admin.html.twig | 2 +- templates/attachment_list.html.twig | 2 +- .../form/collection_types_layout.html.twig | 4 ++-- .../form/extended_bootstrap_layout.html.twig | 4 ++-- .../search/part_search.html.twig | 2 +- .../settings/provider_settings.html.twig | 4 ++-- templates/label_system/dialog.html.twig | 14 +++++++------- .../label_system/scanner/scanner.html.twig | 2 +- templates/log_system/log_list.html.twig | 2 +- templates/parts/edit/_eda.html.twig | 4 ++-- templates/parts/edit/_main.html.twig | 2 +- .../parts/edit/edit_form_styles.html.twig | 4 ++-- templates/parts/edit/edit_part_info.html.twig | 2 +- templates/parts/import/parts_import.html.twig | 2 +- .../parts/info/_stocktake_modal.html.twig | 16 ++++++++-------- templates/parts/info/_withdraw_modal.html.twig | 18 +++++++++--------- templates/parts/lists/_filter.html.twig | 2 +- templates/settings/settings.html.twig | 2 +- templates/users/_2fa_settings.html.twig | 18 +++++++++--------- templates/users/user_settings.html.twig | 2 +- 28 files changed, 69 insertions(+), 65 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 95ae4f3b1..182f12ec6 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -17,6 +17,10 @@ twig: available_themes: '%partdb.available_themes%' saml_enabled: '%partdb.saml.enabled%' part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator' + # Bootstrap grid classes used for horizontal form layouts + form_label_col_class: 'col-sm-3 col-lg-2' + form_input_col_class: 'col-sm-9 col-lg-10' + form_offset_col_class: 'offset-sm-3 offset-lg-2' when@test: twig: diff --git a/templates/admin/_delete_form.html.twig b/templates/admin/_delete_form.html.twig index fd6532564..86778f7ad 100644 --- a/templates/admin/_delete_form.html.twig +++ b/templates/admin/_delete_form.html.twig @@ -5,7 +5,7 @@
-
+
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) or entity == app.user %}
diff --git a/templates/admin/_export_form.html.twig b/templates/admin/_export_form.html.twig index 07b00d43c..20b4505e5 100644 --- a/templates/admin/_export_form.html.twig +++ b/templates/admin/_export_form.html.twig @@ -35,7 +35,7 @@
-
+
diff --git a/templates/admin/base_admin.html.twig b/templates/admin/base_admin.html.twig index f710981d4..b1298a503 100644 --- a/templates/admin/base_admin.html.twig +++ b/templates/admin/base_admin.html.twig @@ -129,7 +129,7 @@
-
+
{{ form_widget(form.save) }}
diff --git a/templates/form/collection_types_layout.html.twig b/templates/form/collection_types_layout.html.twig index 96b71bf0f..d245df5c2 100644 --- a/templates/form/collection_types_layout.html.twig +++ b/templates/form/collection_types_layout.html.twig @@ -63,8 +63,8 @@
{{ form_row(form.mountnames) }}
- -
+ +
{{ form_widget(form.price) }} {{ form_widget(form.priceCurrency) }} diff --git a/templates/form/extended_bootstrap_layout.html.twig b/templates/form/extended_bootstrap_layout.html.twig index 1227750cf..bc16b437f 100644 --- a/templates/form/extended_bootstrap_layout.html.twig +++ b/templates/form/extended_bootstrap_layout.html.twig @@ -17,11 +17,11 @@ {% block form_label_class -%} - col-sm-3 + {{ form_label_col_class }} {%- endblock form_label_class %} {% block form_group_class -%} - col-sm-9 + {{ form_input_col_class }} {%- endblock form_group_class %} {% block si_unit_widget %} diff --git a/templates/info_providers/search/part_search.html.twig b/templates/info_providers/search/part_search.html.twig index a56026184..0943716d8 100644 --- a/templates/info_providers/search/part_search.html.twig +++ b/templates/info_providers/search/part_search.html.twig @@ -28,7 +28,7 @@ {{ form_row(form.providers) }}
- diff --git a/templates/info_providers/settings/provider_settings.html.twig b/templates/info_providers/settings/provider_settings.html.twig index 86e5bc9b4..b5ba1bf96 100644 --- a/templates/info_providers/settings/provider_settings.html.twig +++ b/templates/info_providers/settings/provider_settings.html.twig @@ -8,7 +8,7 @@ {% block card_title %} {% trans %}info_providers.settings.title{% endtrans %}: {{ info_provider_info.name }}{% endblock %} {% block card_content %} -
+

{% if info_provider_info.url is defined %} {{ info_provider_info.name }} @@ -23,7 +23,7 @@ {{ form_start(form) }}
-
+
{{ form_help(form) }}
diff --git a/templates/label_system/dialog.html.twig b/templates/label_system/dialog.html.twig index 11877a4c5..38c429602 100644 --- a/templates/label_system/dialog.html.twig +++ b/templates/label_system/dialog.html.twig @@ -36,7 +36,7 @@ {{ form_row(form.options.supported_element) }}
{{ form_label(form.options.width) }} -
+
{{ form_widget(form.options.width) }} @@ -59,8 +59,8 @@
- -
+ +
{{ profile.name ?? '-' }} {% if profile and is_granted("edit", profile) %}
-
+
diff --git a/templates/parts/edit/_eda.html.twig b/templates/parts/edit/_eda.html.twig index 1383871e7..26bbf5442 100644 --- a/templates/parts/edit/_eda.html.twig +++ b/templates/parts/edit/_eda.html.twig @@ -4,7 +4,7 @@ {{ form_row(form.eda_info.visibility) }}
-
+
{{ form_widget(form.eda_info.exclude_from_bom) }} {{ form_widget(form.eda_info.exclude_from_board) }} {{ form_widget(form.eda_info.exclude_from_sim) }} @@ -12,7 +12,7 @@
-
+
{% trans %}eda_info.kicad_section.title{% endtrans %}:
diff --git a/templates/parts/edit/_main.html.twig b/templates/parts/edit/_main.html.twig index f153d878a..6a17bf30d 100644 --- a/templates/parts/edit/_main.html.twig +++ b/templates/parts/edit/_main.html.twig @@ -1,7 +1,7 @@ {{ form_row(form.name) }} {% if part.category is not null and part.category.partnameHint is not empty %}
-
+

{% trans %}part.edit.name.category_hint{% endtrans %}: {{ part.category.partnameHint }}

diff --git a/templates/parts/edit/edit_form_styles.html.twig b/templates/parts/edit/edit_form_styles.html.twig index 9e989c92d..8a1b73740 100644 --- a/templates/parts/edit/edit_form_styles.html.twig +++ b/templates/parts/edit/edit_form_styles.html.twig @@ -107,7 +107,7 @@ {% set id = 'collapse_' ~ random() %} -
@@ -142,7 +142,7 @@
{{ form_label(form.file) }} -
+
{{ form_widget(form.file) }} {{ form_errors(form.file) }} {% trans %}attachment.max_file_size{% endtrans %}: {{ max_upload_size | format_bytes }} diff --git a/templates/parts/edit/edit_part_info.html.twig b/templates/parts/edit/edit_part_info.html.twig index 28a88132a..588e67da1 100644 --- a/templates/parts/edit/edit_part_info.html.twig +++ b/templates/parts/edit/edit_part_info.html.twig @@ -140,7 +140,7 @@
-
+
{{ form_widget(form.save) }}
diff --git a/templates/settings/settings.html.twig b/templates/settings/settings.html.twig index 96e0f2098..050f55fb3 100644 --- a/templates/settings/settings.html.twig +++ b/templates/settings/settings.html.twig @@ -43,7 +43,7 @@ {{ (section_widget.vars.label ?? section_widget.vars.name|humanize)|trans }}
-
+
{{ form_help(section_widget) }} {{ form_errors(section_widget) }}
diff --git a/templates/users/_2fa_settings.html.twig b/templates/users/_2fa_settings.html.twig index 80392c175..0716b06d8 100644 --- a/templates/users/_2fa_settings.html.twig +++ b/templates/users/_2fa_settings.html.twig @@ -37,11 +37,11 @@ {{ form_start(google_form, { 'attr': google_form_attr}) }} {% if not tfa_google.enabled %} -
+
{% trans %}tfa_google.disabled_message{% endtrans %}
-
+
{{ tfa_google.qrContent }}
@@ -55,7 +55,7 @@
-
+
@@ -72,7 +72,7 @@ {{ form_row(google_form.google_confirmation) }} {% else %} -
+
{% trans %}tfa_google.enabled_message{% endtrans %}
{% endif %} @@ -81,7 +81,7 @@
{% if user.backupCodes is empty %} -
+
{% trans %}tfa_backup.disabled{% endtrans %}
{% trans %}tfa_backup.explanation{% endtrans %}
@@ -89,19 +89,19 @@ {% set backup_form_attr = { 'data-delete-form': true, 'data-controller': 'elements--delete-btn', 'data-action': 'submit->elements--delete-btn#submit', 'data-delete-title': 'tfa_backup.reset_codes.confirm_title' | trans, 'data-delete-message': 'tfa_backup.reset_codes.confirm_message' | trans} %} {{ form_start(backup_form, { 'attr': backup_form_attr}) }} -
+
{% trans %}tfa_backup.enabled{% endtrans %}
{% trans %}tfa_backup.explanation{% endtrans %}
-
+

{% trans %}tfa_backup.remaining_tokens{% endtrans %}: {{ user.backupCodes | length }}

{% trans %}tfa_backup.generation_date{% endtrans %}: {{ user.backupCodesGenerationDate | format_datetime }}

-
+ -
+
{{ form_widget(backup_form.reset_codes) }}
{{ form_end(backup_form) }} diff --git a/templates/users/user_settings.html.twig b/templates/users/user_settings.html.twig index 0f218a1b7..35f6f9d90 100644 --- a/templates/users/user_settings.html.twig +++ b/templates/users/user_settings.html.twig @@ -28,7 +28,7 @@ {{ form_row(settings_form.showEmailOnProfile) }} {{ form_row(settings_form.avatar_file) }}
-
+
{% if user.masterPictureAttachment %} avatar {% endif %} From b508d5709455f789deaf8e63b55840c7b45ffec1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:11:16 +0000 Subject: [PATCH 3/7] Rename form column Twig globals to shorter names: label_col, input_col, offset_col Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- config/packages/twig.yaml | 6 +++--- templates/admin/_delete_form.html.twig | 2 +- templates/admin/_export_form.html.twig | 2 +- templates/admin/base_admin.html.twig | 4 ++-- templates/admin/category_admin.html.twig | 6 +++--- templates/admin/footprint_admin.html.twig | 2 +- templates/admin/label_profile_admin.html.twig | 2 +- templates/admin/project_admin.html.twig | 4 ++-- templates/admin/storelocation_admin.html.twig | 2 +- templates/attachment_list.html.twig | 2 +- .../form/collection_types_layout.html.twig | 4 ++-- .../form/extended_bootstrap_layout.html.twig | 4 ++-- .../search/part_search.html.twig | 2 +- .../settings/provider_settings.html.twig | 4 ++-- templates/label_system/dialog.html.twig | 14 +++++++------- .../label_system/scanner/scanner.html.twig | 2 +- templates/log_system/log_list.html.twig | 2 +- templates/parts/edit/_eda.html.twig | 4 ++-- templates/parts/edit/_main.html.twig | 2 +- .../parts/edit/edit_form_styles.html.twig | 4 ++-- templates/parts/edit/edit_part_info.html.twig | 2 +- templates/parts/import/parts_import.html.twig | 2 +- .../parts/info/_stocktake_modal.html.twig | 16 ++++++++-------- templates/parts/info/_withdraw_modal.html.twig | 18 +++++++++--------- templates/parts/lists/_filter.html.twig | 2 +- templates/settings/settings.html.twig | 2 +- templates/users/_2fa_settings.html.twig | 18 +++++++++--------- templates/users/user_settings.html.twig | 2 +- 28 files changed, 68 insertions(+), 68 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 182f12ec6..2e80b7e01 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -18,9 +18,9 @@ twig: saml_enabled: '%partdb.saml.enabled%' part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator' # Bootstrap grid classes used for horizontal form layouts - form_label_col_class: 'col-sm-3 col-lg-2' - form_input_col_class: 'col-sm-9 col-lg-10' - form_offset_col_class: 'offset-sm-3 offset-lg-2' + label_col: 'col-sm-3 col-lg-2' + input_col: 'col-sm-9 col-lg-10' + offset_col: 'offset-sm-3 offset-lg-2' when@test: twig: diff --git a/templates/admin/_delete_form.html.twig b/templates/admin/_delete_form.html.twig index 86778f7ad..4ea4e92af 100644 --- a/templates/admin/_delete_form.html.twig +++ b/templates/admin/_delete_form.html.twig @@ -5,7 +5,7 @@
-
+
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) or entity == app.user %}
diff --git a/templates/admin/_export_form.html.twig b/templates/admin/_export_form.html.twig index 20b4505e5..0a11fd1bc 100644 --- a/templates/admin/_export_form.html.twig +++ b/templates/admin/_export_form.html.twig @@ -35,7 +35,7 @@
-
+
diff --git a/templates/admin/base_admin.html.twig b/templates/admin/base_admin.html.twig index b1298a503..caec4d377 100644 --- a/templates/admin/base_admin.html.twig +++ b/templates/admin/base_admin.html.twig @@ -129,7 +129,7 @@
-
+
{{ form_widget(form.save) }}
diff --git a/templates/form/collection_types_layout.html.twig b/templates/form/collection_types_layout.html.twig index d245df5c2..b73f0fd24 100644 --- a/templates/form/collection_types_layout.html.twig +++ b/templates/form/collection_types_layout.html.twig @@ -63,8 +63,8 @@
{{ form_row(form.mountnames) }}
- -
+ +
{{ form_widget(form.price) }} {{ form_widget(form.priceCurrency) }} diff --git a/templates/form/extended_bootstrap_layout.html.twig b/templates/form/extended_bootstrap_layout.html.twig index bc16b437f..1a6e264ab 100644 --- a/templates/form/extended_bootstrap_layout.html.twig +++ b/templates/form/extended_bootstrap_layout.html.twig @@ -17,11 +17,11 @@ {% block form_label_class -%} - {{ form_label_col_class }} + {{ label_col }} {%- endblock form_label_class %} {% block form_group_class -%} - {{ form_input_col_class }} + {{ input_col }} {%- endblock form_group_class %} {% block si_unit_widget %} diff --git a/templates/info_providers/search/part_search.html.twig b/templates/info_providers/search/part_search.html.twig index 0943716d8..c982cb8f8 100644 --- a/templates/info_providers/search/part_search.html.twig +++ b/templates/info_providers/search/part_search.html.twig @@ -28,7 +28,7 @@ {{ form_row(form.providers) }}
- diff --git a/templates/info_providers/settings/provider_settings.html.twig b/templates/info_providers/settings/provider_settings.html.twig index b5ba1bf96..609a70087 100644 --- a/templates/info_providers/settings/provider_settings.html.twig +++ b/templates/info_providers/settings/provider_settings.html.twig @@ -8,7 +8,7 @@ {% block card_title %} {% trans %}info_providers.settings.title{% endtrans %}: {{ info_provider_info.name }}{% endblock %} {% block card_content %} -
+

{% if info_provider_info.url is defined %} {{ info_provider_info.name }} @@ -23,7 +23,7 @@ {{ form_start(form) }}
-
+
{{ form_help(form) }}
diff --git a/templates/label_system/dialog.html.twig b/templates/label_system/dialog.html.twig index 38c429602..cea433f0c 100644 --- a/templates/label_system/dialog.html.twig +++ b/templates/label_system/dialog.html.twig @@ -36,7 +36,7 @@ {{ form_row(form.options.supported_element) }}
{{ form_label(form.options.width) }} -
+
{{ form_widget(form.options.width) }} @@ -59,8 +59,8 @@
- -
+ +
{{ profile.name ?? '-' }} {% if profile and is_granted("edit", profile) %}
-
+
diff --git a/templates/parts/edit/_eda.html.twig b/templates/parts/edit/_eda.html.twig index 26bbf5442..fd8267556 100644 --- a/templates/parts/edit/_eda.html.twig +++ b/templates/parts/edit/_eda.html.twig @@ -4,7 +4,7 @@ {{ form_row(form.eda_info.visibility) }}
-
+
{{ form_widget(form.eda_info.exclude_from_bom) }} {{ form_widget(form.eda_info.exclude_from_board) }} {{ form_widget(form.eda_info.exclude_from_sim) }} @@ -12,7 +12,7 @@
-
+
{% trans %}eda_info.kicad_section.title{% endtrans %}:
diff --git a/templates/parts/edit/_main.html.twig b/templates/parts/edit/_main.html.twig index 6a17bf30d..4009dd63c 100644 --- a/templates/parts/edit/_main.html.twig +++ b/templates/parts/edit/_main.html.twig @@ -1,7 +1,7 @@ {{ form_row(form.name) }} {% if part.category is not null and part.category.partnameHint is not empty %}
-
+

{% trans %}part.edit.name.category_hint{% endtrans %}: {{ part.category.partnameHint }}

diff --git a/templates/parts/edit/edit_form_styles.html.twig b/templates/parts/edit/edit_form_styles.html.twig index 8a1b73740..7f055591a 100644 --- a/templates/parts/edit/edit_form_styles.html.twig +++ b/templates/parts/edit/edit_form_styles.html.twig @@ -107,7 +107,7 @@ {% set id = 'collapse_' ~ random() %} -
@@ -142,7 +142,7 @@
{{ form_label(form.file) }} -
+
{{ form_widget(form.file) }} {{ form_errors(form.file) }} {% trans %}attachment.max_file_size{% endtrans %}: {{ max_upload_size | format_bytes }} diff --git a/templates/parts/edit/edit_part_info.html.twig b/templates/parts/edit/edit_part_info.html.twig index 588e67da1..dea37b8e3 100644 --- a/templates/parts/edit/edit_part_info.html.twig +++ b/templates/parts/edit/edit_part_info.html.twig @@ -140,7 +140,7 @@
-
+
{{ form_widget(form.save) }}
diff --git a/templates/settings/settings.html.twig b/templates/settings/settings.html.twig index 050f55fb3..80f3671aa 100644 --- a/templates/settings/settings.html.twig +++ b/templates/settings/settings.html.twig @@ -43,7 +43,7 @@ {{ (section_widget.vars.label ?? section_widget.vars.name|humanize)|trans }}
-
+
{{ form_help(section_widget) }} {{ form_errors(section_widget) }}
diff --git a/templates/users/_2fa_settings.html.twig b/templates/users/_2fa_settings.html.twig index 0716b06d8..0f7feecc9 100644 --- a/templates/users/_2fa_settings.html.twig +++ b/templates/users/_2fa_settings.html.twig @@ -37,11 +37,11 @@ {{ form_start(google_form, { 'attr': google_form_attr}) }} {% if not tfa_google.enabled %} -
+
{% trans %}tfa_google.disabled_message{% endtrans %}
-
+
{{ tfa_google.qrContent }}
@@ -55,7 +55,7 @@
-
+
@@ -72,7 +72,7 @@ {{ form_row(google_form.google_confirmation) }} {% else %} -
+
{% trans %}tfa_google.enabled_message{% endtrans %}
{% endif %} @@ -81,7 +81,7 @@
{% if user.backupCodes is empty %} -
+
{% trans %}tfa_backup.disabled{% endtrans %}
{% trans %}tfa_backup.explanation{% endtrans %}
@@ -89,19 +89,19 @@ {% set backup_form_attr = { 'data-delete-form': true, 'data-controller': 'elements--delete-btn', 'data-action': 'submit->elements--delete-btn#submit', 'data-delete-title': 'tfa_backup.reset_codes.confirm_title' | trans, 'data-delete-message': 'tfa_backup.reset_codes.confirm_message' | trans} %} {{ form_start(backup_form, { 'attr': backup_form_attr}) }} -
+
{% trans %}tfa_backup.enabled{% endtrans %}
{% trans %}tfa_backup.explanation{% endtrans %}
-
+

{% trans %}tfa_backup.remaining_tokens{% endtrans %}: {{ user.backupCodes | length }}

{% trans %}tfa_backup.generation_date{% endtrans %}: {{ user.backupCodesGenerationDate | format_datetime }}

-
+ -
+
{{ form_widget(backup_form.reset_codes) }}
{{ form_end(backup_form) }} diff --git a/templates/users/user_settings.html.twig b/templates/users/user_settings.html.twig index 35f6f9d90..f41c370fb 100644 --- a/templates/users/user_settings.html.twig +++ b/templates/users/user_settings.html.twig @@ -28,7 +28,7 @@ {{ form_row(settings_form.showEmailOnProfile) }} {{ form_row(settings_form.avatar_file) }}
-
+
{% if user.masterPictureAttachment %} avatar {% endif %} From 3aa7480fe4e35b5e4f0eb5c719ad6069b0c5902d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 7 Mar 2026 15:54:56 +0100 Subject: [PATCH 4/7] Fixed remaining places where offsets where used --- templates/admin/_duplicate.html.twig | 4 ++-- templates/admin/_export_form.html.twig | 2 +- templates/admin/currency_admin.html.twig | 6 +++--- templates/admin/user_admin.html.twig | 4 ++-- templates/info_providers/from_url/from_url.html.twig | 2 +- templates/security/2fa_base_form.html.twig | 6 +++--- templates/security/login.html.twig | 4 ++-- templates/settings/settings.html.twig | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/templates/admin/_duplicate.html.twig b/templates/admin/_duplicate.html.twig index 1b18cd71f..5be76ec38 100644 --- a/templates/admin/_duplicate.html.twig +++ b/templates/admin/_duplicate.html.twig @@ -1,5 +1,5 @@
- \ No newline at end of file +
diff --git a/templates/admin/_export_form.html.twig b/templates/admin/_export_form.html.twig index 0a11fd1bc..49e435bd3 100644 --- a/templates/admin/_export_form.html.twig +++ b/templates/admin/_export_form.html.twig @@ -39,4 +39,4 @@
- \ No newline at end of file + diff --git a/templates/admin/currency_admin.html.twig b/templates/admin/currency_admin.html.twig index a5d599707..92cb5c74a 100644 --- a/templates/admin/currency_admin.html.twig +++ b/templates/admin/currency_admin.html.twig @@ -10,10 +10,10 @@ {{ form_row(form.iso_code) }} {% if entity.isoCode %}
- + {% trans %}currency.iso_code.caption{% endtrans %}: {{ entity.isoCode }} - + {% trans %}currency.symbol.caption{% endtrans %}: {{ entity.isoCode | currency_symbol }}
@@ -21,7 +21,7 @@ {{ form_row(form.exchange_rate) }} {% if entity.inverseExchangeRate %} -

+

{{ '1'|format_currency(vars.base_currency()) }} = {{ entity.inverseExchangeRate.tofloat | format_currency(entity.isoCode, {fraction_digit: 5}) }}
{{ '1'|format_currency(entity.isoCode) }} = {{ entity.exchangeRate.tofloat | format_currency(vars.base_currency(), {fraction_digit: 5}) }}

diff --git a/templates/admin/user_admin.html.twig b/templates/admin/user_admin.html.twig index 9b241e562..7fb465d75 100644 --- a/templates/admin/user_admin.html.twig +++ b/templates/admin/user_admin.html.twig @@ -50,7 +50,7 @@
{% if entity.samlUser %} -
+
{% trans %}user.saml_user{% endtrans %}
{% endif %} @@ -60,7 +60,7 @@ {{ form_row(form.disabled) }} {% if entity.id is not null %} -
+

{% trans %}user.edit.tfa.caption{% endtrans %}
diff --git a/templates/info_providers/from_url/from_url.html.twig b/templates/info_providers/from_url/from_url.html.twig index 5aad1a037..edf64ed6d 100644 --- a/templates/info_providers/from_url/from_url.html.twig +++ b/templates/info_providers/from_url/from_url.html.twig @@ -12,7 +12,7 @@ {% endblock %} {% block card_content %} -

{% trans %}info_providers.from_url.help{% endtrans %}

+

{% trans %}info_providers.from_url.help{% endtrans %}

{{ form_start(form) }} {{ form_row(form.url) }} diff --git a/templates/security/2fa_base_form.html.twig b/templates/security/2fa_base_form.html.twig index 847048e49..100d4afd6 100644 --- a/templates/security/2fa_base_form.html.twig +++ b/templates/security/2fa_base_form.html.twig @@ -33,7 +33,7 @@ {% if displayTrustedOption %}
-
+
@@ -48,11 +48,11 @@ {% block submit_btn %}
-
+
{% trans %}user.logout{% endtrans %}
{% endblock %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/security/login.html.twig b/templates/security/login.html.twig index c09b36690..a5338074e 100644 --- a/templates/security/login.html.twig +++ b/templates/security/login.html.twig @@ -22,7 +22,7 @@ {% block card_content %} {% if saml_enabled %} -
+
{% trans %}login.sso_saml_login{% endtrans %}

{% trans %}login.local_login_hint{% endtrans %}

@@ -39,6 +39,6 @@ {{ form_end(form) }} {% if allow_email_pw_reset %} - {% trans %}pw_reset.password_forget{% endtrans %} + {% trans %}pw_reset.password_forget{% endtrans %} {% endif %} {% endblock %} diff --git a/templates/settings/settings.html.twig b/templates/settings/settings.html.twig index 80f3671aa..99623d15c 100644 --- a/templates/settings/settings.html.twig +++ b/templates/settings/settings.html.twig @@ -38,7 +38,7 @@ {% if section_widget.vars.embedded_settings_metadata is defined %} {# Check if we have nested embedded settings or not #}
- + {{ (section_widget.vars.label ?? section_widget.vars.name|humanize)|trans }} From 815b2b6c7d9f3960ba498b177209cd8f929a9f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 7 Mar 2026 15:57:38 +0100 Subject: [PATCH 5/7] Fixed margin of delete button on admin forms --- templates/admin/_delete_form.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/admin/_delete_form.html.twig b/templates/admin/_delete_form.html.twig index 4ea4e92af..acc5a13d6 100644 --- a/templates/admin/_delete_form.html.twig +++ b/templates/admin/_delete_form.html.twig @@ -5,7 +5,7 @@
-
+
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) or entity == app.user %}
@@ -20,7 +20,7 @@
{% if entity.parent is defined %} -
+
From 17e83a9da5ea69625ab4bb925fb57259391691fe Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 15:10:32 +0000 Subject: [PATCH 6/7] Rename Twig globals: col_label, col_input, offset_label Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- config/packages/twig.yaml | 6 +++--- templates/admin/_delete_form.html.twig | 2 +- templates/admin/_duplicate.html.twig | 2 +- templates/admin/_export_form.html.twig | 2 +- templates/admin/base_admin.html.twig | 4 ++-- templates/admin/category_admin.html.twig | 6 +++--- templates/admin/currency_admin.html.twig | 6 +++--- templates/admin/footprint_admin.html.twig | 2 +- templates/admin/label_profile_admin.html.twig | 2 +- templates/admin/project_admin.html.twig | 4 ++-- templates/admin/storelocation_admin.html.twig | 2 +- templates/admin/user_admin.html.twig | 4 ++-- templates/attachment_list.html.twig | 2 +- .../form/collection_types_layout.html.twig | 4 ++-- .../form/extended_bootstrap_layout.html.twig | 4 ++-- .../info_providers/from_url/from_url.html.twig | 2 +- .../search/part_search.html.twig | 2 +- .../settings/provider_settings.html.twig | 4 ++-- templates/label_system/dialog.html.twig | 14 +++++++------- .../label_system/scanner/scanner.html.twig | 2 +- templates/log_system/log_list.html.twig | 2 +- templates/parts/edit/_eda.html.twig | 4 ++-- templates/parts/edit/_main.html.twig | 2 +- .../parts/edit/edit_form_styles.html.twig | 4 ++-- templates/parts/edit/edit_part_info.html.twig | 2 +- templates/parts/import/parts_import.html.twig | 2 +- .../parts/info/_stocktake_modal.html.twig | 16 ++++++++-------- templates/parts/info/_withdraw_modal.html.twig | 18 +++++++++--------- templates/parts/lists/_filter.html.twig | 2 +- templates/security/2fa_base_form.html.twig | 4 ++-- templates/security/login.html.twig | 4 ++-- templates/settings/settings.html.twig | 4 ++-- templates/users/_2fa_settings.html.twig | 18 +++++++++--------- templates/users/user_settings.html.twig | 2 +- 34 files changed, 80 insertions(+), 80 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 2e80b7e01..065643490 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -18,9 +18,9 @@ twig: saml_enabled: '%partdb.saml.enabled%' part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator' # Bootstrap grid classes used for horizontal form layouts - label_col: 'col-sm-3 col-lg-2' - input_col: 'col-sm-9 col-lg-10' - offset_col: 'offset-sm-3 offset-lg-2' + col_label: 'col-sm-3 col-lg-2' + col_input: 'col-sm-9 col-lg-10' + offset_label: 'offset-sm-3 offset-lg-2' when@test: twig: diff --git a/templates/admin/_delete_form.html.twig b/templates/admin/_delete_form.html.twig index acc5a13d6..5a1d5a1ae 100644 --- a/templates/admin/_delete_form.html.twig +++ b/templates/admin/_delete_form.html.twig @@ -5,7 +5,7 @@
-
+
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) or entity == app.user %}
diff --git a/templates/admin/_duplicate.html.twig b/templates/admin/_duplicate.html.twig index 5be76ec38..cf6e8ccad 100644 --- a/templates/admin/_duplicate.html.twig +++ b/templates/admin/_duplicate.html.twig @@ -1,5 +1,5 @@
- diff --git a/templates/admin/_export_form.html.twig b/templates/admin/_export_form.html.twig index 49e435bd3..7ef2e2699 100644 --- a/templates/admin/_export_form.html.twig +++ b/templates/admin/_export_form.html.twig @@ -35,7 +35,7 @@
-
+
diff --git a/templates/admin/base_admin.html.twig b/templates/admin/base_admin.html.twig index caec4d377..f19f4c440 100644 --- a/templates/admin/base_admin.html.twig +++ b/templates/admin/base_admin.html.twig @@ -129,7 +129,7 @@
-
+
{{ form_widget(form.save) }}
diff --git a/templates/form/collection_types_layout.html.twig b/templates/form/collection_types_layout.html.twig index b73f0fd24..818f0a0fe 100644 --- a/templates/form/collection_types_layout.html.twig +++ b/templates/form/collection_types_layout.html.twig @@ -63,8 +63,8 @@
{{ form_row(form.mountnames) }}
- -
+ +
{{ form_widget(form.price) }} {{ form_widget(form.priceCurrency) }} diff --git a/templates/form/extended_bootstrap_layout.html.twig b/templates/form/extended_bootstrap_layout.html.twig index 1a6e264ab..01d308154 100644 --- a/templates/form/extended_bootstrap_layout.html.twig +++ b/templates/form/extended_bootstrap_layout.html.twig @@ -17,11 +17,11 @@ {% block form_label_class -%} - {{ label_col }} + {{ col_label }} {%- endblock form_label_class %} {% block form_group_class -%} - {{ input_col }} + {{ col_input }} {%- endblock form_group_class %} {% block si_unit_widget %} diff --git a/templates/info_providers/from_url/from_url.html.twig b/templates/info_providers/from_url/from_url.html.twig index edf64ed6d..3370a94ce 100644 --- a/templates/info_providers/from_url/from_url.html.twig +++ b/templates/info_providers/from_url/from_url.html.twig @@ -12,7 +12,7 @@ {% endblock %} {% block card_content %} -

{% trans %}info_providers.from_url.help{% endtrans %}

+

{% trans %}info_providers.from_url.help{% endtrans %}

{{ form_start(form) }} {{ form_row(form.url) }} diff --git a/templates/info_providers/search/part_search.html.twig b/templates/info_providers/search/part_search.html.twig index c982cb8f8..eac3507d3 100644 --- a/templates/info_providers/search/part_search.html.twig +++ b/templates/info_providers/search/part_search.html.twig @@ -28,7 +28,7 @@ {{ form_row(form.providers) }}
- diff --git a/templates/info_providers/settings/provider_settings.html.twig b/templates/info_providers/settings/provider_settings.html.twig index 609a70087..db942f8a0 100644 --- a/templates/info_providers/settings/provider_settings.html.twig +++ b/templates/info_providers/settings/provider_settings.html.twig @@ -8,7 +8,7 @@ {% block card_title %} {% trans %}info_providers.settings.title{% endtrans %}: {{ info_provider_info.name }}{% endblock %} {% block card_content %} -
+

{% if info_provider_info.url is defined %} {{ info_provider_info.name }} @@ -23,7 +23,7 @@ {{ form_start(form) }}
-
+
{{ form_help(form) }}
diff --git a/templates/label_system/dialog.html.twig b/templates/label_system/dialog.html.twig index cea433f0c..532a4b63a 100644 --- a/templates/label_system/dialog.html.twig +++ b/templates/label_system/dialog.html.twig @@ -36,7 +36,7 @@ {{ form_row(form.options.supported_element) }}
{{ form_label(form.options.width) }} -
+
{{ form_widget(form.options.width) }} @@ -59,8 +59,8 @@
- -
+ +
{{ profile.name ?? '-' }} {% if profile and is_granted("edit", profile) %}
-
+
diff --git a/templates/parts/edit/_eda.html.twig b/templates/parts/edit/_eda.html.twig index fd8267556..12299add6 100644 --- a/templates/parts/edit/_eda.html.twig +++ b/templates/parts/edit/_eda.html.twig @@ -4,7 +4,7 @@ {{ form_row(form.eda_info.visibility) }}
-
+
{{ form_widget(form.eda_info.exclude_from_bom) }} {{ form_widget(form.eda_info.exclude_from_board) }} {{ form_widget(form.eda_info.exclude_from_sim) }} @@ -12,7 +12,7 @@
-
+
{% trans %}eda_info.kicad_section.title{% endtrans %}:
diff --git a/templates/parts/edit/_main.html.twig b/templates/parts/edit/_main.html.twig index 4009dd63c..06c711061 100644 --- a/templates/parts/edit/_main.html.twig +++ b/templates/parts/edit/_main.html.twig @@ -1,7 +1,7 @@ {{ form_row(form.name) }} {% if part.category is not null and part.category.partnameHint is not empty %}
-
+

{% trans %}part.edit.name.category_hint{% endtrans %}: {{ part.category.partnameHint }}

diff --git a/templates/parts/edit/edit_form_styles.html.twig b/templates/parts/edit/edit_form_styles.html.twig index 7f055591a..44c8d89ce 100644 --- a/templates/parts/edit/edit_form_styles.html.twig +++ b/templates/parts/edit/edit_form_styles.html.twig @@ -107,7 +107,7 @@ {% set id = 'collapse_' ~ random() %} -
@@ -142,7 +142,7 @@
{{ form_label(form.file) }} -
+
{{ form_widget(form.file) }} {{ form_errors(form.file) }} {% trans %}attachment.max_file_size{% endtrans %}: {{ max_upload_size | format_bytes }} diff --git a/templates/parts/edit/edit_part_info.html.twig b/templates/parts/edit/edit_part_info.html.twig index dea37b8e3..5b6d288a3 100644 --- a/templates/parts/edit/edit_part_info.html.twig +++ b/templates/parts/edit/edit_part_info.html.twig @@ -140,7 +140,7 @@
-
+
{{ form_widget(form.save) }}
diff --git a/templates/security/2fa_base_form.html.twig b/templates/security/2fa_base_form.html.twig index 100d4afd6..e6ec99bb5 100644 --- a/templates/security/2fa_base_form.html.twig +++ b/templates/security/2fa_base_form.html.twig @@ -33,7 +33,7 @@ {% if displayTrustedOption %}
-
+
@@ -48,7 +48,7 @@ {% block submit_btn %}
-
+
{% trans %}user.logout{% endtrans %}
diff --git a/templates/security/login.html.twig b/templates/security/login.html.twig index a5338074e..278f860bd 100644 --- a/templates/security/login.html.twig +++ b/templates/security/login.html.twig @@ -22,7 +22,7 @@ {% block card_content %} {% if saml_enabled %} -
+
{% trans %}login.sso_saml_login{% endtrans %}

{% trans %}login.local_login_hint{% endtrans %}

@@ -39,6 +39,6 @@ {{ form_end(form) }} {% if allow_email_pw_reset %} - {% trans %}pw_reset.password_forget{% endtrans %} + {% trans %}pw_reset.password_forget{% endtrans %} {% endif %} {% endblock %} diff --git a/templates/settings/settings.html.twig b/templates/settings/settings.html.twig index 99623d15c..a2c010850 100644 --- a/templates/settings/settings.html.twig +++ b/templates/settings/settings.html.twig @@ -38,12 +38,12 @@ {% if section_widget.vars.embedded_settings_metadata is defined %} {# Check if we have nested embedded settings or not #}
- + {{ (section_widget.vars.label ?? section_widget.vars.name|humanize)|trans }}
-
+
{{ form_help(section_widget) }} {{ form_errors(section_widget) }}
diff --git a/templates/users/_2fa_settings.html.twig b/templates/users/_2fa_settings.html.twig index 0f7feecc9..da0e61ff8 100644 --- a/templates/users/_2fa_settings.html.twig +++ b/templates/users/_2fa_settings.html.twig @@ -37,11 +37,11 @@ {{ form_start(google_form, { 'attr': google_form_attr}) }} {% if not tfa_google.enabled %} -
+
{% trans %}tfa_google.disabled_message{% endtrans %}
-
+
{{ tfa_google.qrContent }}
@@ -55,7 +55,7 @@
-
+
@@ -72,7 +72,7 @@ {{ form_row(google_form.google_confirmation) }} {% else %} -
+
{% trans %}tfa_google.enabled_message{% endtrans %}
{% endif %} @@ -81,7 +81,7 @@
{% if user.backupCodes is empty %} -
+
{% trans %}tfa_backup.disabled{% endtrans %}
{% trans %}tfa_backup.explanation{% endtrans %}
@@ -89,19 +89,19 @@ {% set backup_form_attr = { 'data-delete-form': true, 'data-controller': 'elements--delete-btn', 'data-action': 'submit->elements--delete-btn#submit', 'data-delete-title': 'tfa_backup.reset_codes.confirm_title' | trans, 'data-delete-message': 'tfa_backup.reset_codes.confirm_message' | trans} %} {{ form_start(backup_form, { 'attr': backup_form_attr}) }} -
+
{% trans %}tfa_backup.enabled{% endtrans %}
{% trans %}tfa_backup.explanation{% endtrans %}
-
+

{% trans %}tfa_backup.remaining_tokens{% endtrans %}: {{ user.backupCodes | length }}

{% trans %}tfa_backup.generation_date{% endtrans %}: {{ user.backupCodesGenerationDate | format_datetime }}

-
+ -
+
{{ form_widget(backup_form.reset_codes) }}
{{ form_end(backup_form) }} diff --git a/templates/users/user_settings.html.twig b/templates/users/user_settings.html.twig index f41c370fb..36cde643d 100644 --- a/templates/users/user_settings.html.twig +++ b/templates/users/user_settings.html.twig @@ -28,7 +28,7 @@ {{ form_row(settings_form.showEmailOnProfile) }} {{ form_row(settings_form.avatar_file) }}
-
+
{% if user.masterPictureAttachment %} avatar {% endif %} From ebcda8b75ade108ec6be71f07d4982c041749afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 7 Mar 2026 16:13:18 +0100 Subject: [PATCH 7/7] Added documentation to our twig class variables --- config/packages/twig.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 065643490..860cef428 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -17,10 +17,11 @@ twig: available_themes: '%partdb.available_themes%' saml_enabled: '%partdb.saml.enabled%' part_preview_generator: '@App\Services\Attachments\PartPreviewGenerator' + # Bootstrap grid classes used for horizontal form layouts - col_label: 'col-sm-3 col-lg-2' - col_input: 'col-sm-9 col-lg-10' - offset_label: 'offset-sm-3 offset-lg-2' + col_label: 'col-sm-3 col-lg-2' # The column classes for form labels + col_input: 'col-sm-9 col-lg-10' # The column classes for form input fields + offset_label: 'offset-sm-3 offset-lg-2' # Offset classes for elements that should be aligned with the input fields (e.g., submit buttons) when@test: twig: