From 51e7eea73d934c0d7fb1066866c6a543f25db742 Mon Sep 17 00:00:00 2001 From: Marcel Diegelmann Date: Wed, 15 Oct 2025 16:10:59 +0200 Subject: [PATCH] =?UTF-8?q?Data-Source=20Synonyme:=20erg=C3=A4nze=20"assem?= =?UTF-8?q?bly"=20zu=20Datenquellen=20und=20Baumansichten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Services/Trees/TreeViewGenerator.php | 1 + templates/admin/assembly_admin.html.twig | 4 +++- templates/components/tree_macros.html.twig | 1 + templates/form/permission_layout.html.twig | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Services/Trees/TreeViewGenerator.php b/src/Services/Trees/TreeViewGenerator.php index 9f26b26a..47870e0d 100644 --- a/src/Services/Trees/TreeViewGenerator.php +++ b/src/Services/Trees/TreeViewGenerator.php @@ -237,6 +237,7 @@ class TreeViewGenerator Manufacturer::class => $this->getTranslatedOrSynonym('manufacturer', $locale), Supplier::class => $this->getTranslatedOrSynonym('supplier', $locale), Project::class => $this->getTranslatedOrSynonym('project', $locale), + Assembly::class => $this->getTranslatedOrSynonym('assembly', $locale), default => $this->translator->trans('tree.root_node.text'), }; } diff --git a/templates/admin/assembly_admin.html.twig b/templates/admin/assembly_admin.html.twig index b6bf6d09..2e68a3da 100644 --- a/templates/admin/assembly_admin.html.twig +++ b/templates/admin/assembly_admin.html.twig @@ -3,7 +3,9 @@ {# @var entity App\Entity\AssemblySystem\Assembly #} {% block card_title %} - {% trans %}assembly.caption{% endtrans %} + {% set dataSourceName = get_data_source_name('assembly', 'assembly.caption') %} + {% set translatedSource = 'assembly.caption'|trans %} + {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %} {% endblock %} {% block edit_title %} diff --git a/templates/components/tree_macros.html.twig b/templates/components/tree_macros.html.twig index e82cd3b4..210a0063 100644 --- a/templates/components/tree_macros.html.twig +++ b/templates/components/tree_macros.html.twig @@ -9,6 +9,7 @@ ['manufacturers', path('tree_manufacturer_root'), 'manufacturer.labelp', is_granted('@manufacturers.read') and is_granted('@parts.read'), 'manufacturer'], ['suppliers', path('tree_supplier_root'), 'supplier.labelp', is_granted('@suppliers.read') and is_granted('@parts.read'), 'supplier'], ['projects', path('tree_device_root'), 'project.labelp', is_granted('@projects.read'), 'project'], + ['assembly', path('tree_assembly_root'), 'assembly.labelp', is_granted('@assemblies.read'), 'assembly'], ['tools', path('tree_tools'), 'tools.label', true, 'tool'], ] %} diff --git a/templates/form/permission_layout.html.twig b/templates/form/permission_layout.html.twig index 3c7f799e..95353a1b 100644 --- a/templates/form/permission_layout.html.twig +++ b/templates/form/permission_layout.html.twig @@ -19,6 +19,8 @@ {% set dataSource = 'supplier' %} {% elseif (form.vars.label == 'perm.projects') %} {% set dataSource = 'project' %} + {% elseif (form.vars.label == 'perm.assemblies') %} + {% set dataSource = 'assembly' %} {% endif %} {% set dataSourceName = get_data_source_name(dataSource, form.vars.label) %}