mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-17 23:59:33 +00:00
Data-Source Synonyme: ergänze "assembly" zu Datenquellen und Baumansichten
This commit is contained in:
parent
498f8bc6e5
commit
51e7eea73d
4 changed files with 7 additions and 1 deletions
|
|
@ -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'),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
{# @var entity App\Entity\AssemblySystem\Assembly #}
|
||||
|
||||
{% block card_title %}
|
||||
<i class="fas fa-archive fa-fw"></i> {% trans %}assembly.caption{% endtrans %}
|
||||
{% set dataSourceName = get_data_source_name('assembly', 'assembly.caption') %}
|
||||
{% set translatedSource = 'assembly.caption'|trans %}
|
||||
<i class="fas fa-archive fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block edit_title %}
|
||||
|
|
|
|||
|
|
@ -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'],
|
||||
] %}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue