diff --git a/lib/RoadizCoreBundle/src/Model/AttributeTrait.php b/lib/RoadizCoreBundle/src/Model/AttributeTrait.php index 17e62954..bb52d5e3 100644 --- a/lib/RoadizCoreBundle/src/Model/AttributeTrait.php +++ b/lib/RoadizCoreBundle/src/Model/AttributeTrait.php @@ -365,4 +365,9 @@ public function getTypeLabel(): string default => 'attributes.form.type.string', }; } + + public function getAttributeValues(): Collection + { + return $this->attributeValues; + } } diff --git a/lib/RoadizRozierBundle/translations/attributes/messages.en.xlf b/lib/RoadizRozierBundle/translations/attributes/messages.en.xlf index 3a80ce2e..ed667d50 100644 --- a/lib/RoadizRozierBundle/translations/attributes/messages.en.xlf +++ b/lib/RoadizRozierBundle/translations/attributes/messages.en.xlf @@ -312,6 +312,11 @@ Attribute %attributeValueId% value does not exist + + attributes.usage + Usage count + + diff --git a/lib/RoadizRozierBundle/translations/attributes/messages.fr.xlf b/lib/RoadizRozierBundle/translations/attributes/messages.fr.xlf index da63fa3d..bcdb47a1 100644 --- a/lib/RoadizRozierBundle/translations/attributes/messages.fr.xlf +++ b/lib/RoadizRozierBundle/translations/attributes/messages.fr.xlf @@ -312,6 +312,11 @@ La valeur de l’attribut %attributeValueId% n’existe pas + + attributes.usage + Nombre d'utilisations + + diff --git a/lib/RoadizRozierBundle/translations/attributes/messages.xlf b/lib/RoadizRozierBundle/translations/attributes/messages.xlf index caea664c..48d36e3e 100644 --- a/lib/RoadizRozierBundle/translations/attributes/messages.xlf +++ b/lib/RoadizRozierBundle/translations/attributes/messages.xlf @@ -316,6 +316,11 @@ + + attributes.usage + + + diff --git a/lib/Rozier/src/Resources/views/attributes/attribute_row.html.twig b/lib/Rozier/src/Resources/views/attributes/attribute_row.html.twig index 1ee4ac11..c263d471 100644 --- a/lib/Rozier/src/Resources/views/attributes/attribute_row.html.twig +++ b/lib/Rozier/src/Resources/views/attributes/attribute_row.html.twig @@ -1,13 +1,26 @@ - {{ item.attributeTranslations.first.label|default(item.code) -}} + {{ item.code -}} +{{ item.attributeTranslations.first.label -}} {{- item.typeLabel|trans -}} -{%- if item.group -%} + + {%- if item.attributeValues|length > 0 -%} + + {{- item.attributeValues|length -}} + + {%- endif -%} + + + {%- if item.group -%} {{- item.group.name -}} - {%- endif -%} + {%- endif -%} + {% apply spaceless %} {% if hasBulkActions %} diff --git a/lib/Rozier/src/Resources/views/attributes/attribute_row_header.html.twig b/lib/Rozier/src/Resources/views/attributes/attribute_row_header.html.twig index a471f74e..09e5fcfb 100644 --- a/lib/Rozier/src/Resources/views/attributes/attribute_row_header.html.twig +++ b/lib/Rozier/src/Resources/views/attributes/attribute_row_header.html.twig @@ -1,4 +1,4 @@ - + {% trans %}attributes.code{% endtrans %} {% if not no_sort %} {% include '@RoadizRozier/includes/column_ordering.html.twig' with { @@ -8,7 +8,8 @@ {% endif %} {% trans %}attributes.form.type{% endtrans %} -{% trans %}attributes.group{% endtrans %} + +{% trans %}attributes.group{% endtrans %} {% if hasBulkActions %}