diff --git a/src/Form/Type/FigureType.php b/src/Form/Type/KeyFactType.php similarity index 86% rename from src/Form/Type/FigureType.php rename to src/Form/Type/KeyFactType.php index 5e43aad..1c708cc 100644 --- a/src/Form/Type/FigureType.php +++ b/src/Form/Type/KeyFactType.php @@ -16,7 +16,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints as Assert; -class FigureType extends AbstractType +class KeyFactType extends AbstractType { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -24,9 +24,9 @@ class FigureType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('figure', TextType::class, [ + ->add('title', TextType::class, [ 'required' => true, - 'label' => 'monsieurbiz_ui_elements.ui_element.figures_ui_element.fields.figure', + 'label' => 'monsieurbiz_ui_elements.common.fields.title', 'constraints' => [ new Assert\NotBlank(), new Assert\Length(['max' => 255]), diff --git a/src/Form/Type/UiElement/FiguresUiElementType.php b/src/Form/Type/UiElement/KeyFactsUiElementType.php similarity index 63% rename from src/Form/Type/UiElement/FiguresUiElementType.php rename to src/Form/Type/UiElement/KeyFactsUiElementType.php index 93a8b52..0d5db54 100644 --- a/src/Form/Type/UiElement/FiguresUiElementType.php +++ b/src/Form/Type/UiElement/KeyFactsUiElementType.php @@ -13,37 +13,37 @@ use MonsieurBiz\SyliusRichEditorPlugin\Attribute\AsUiElement; use MonsieurBiz\SyliusRichEditorPlugin\Attribute\TemplatesUiElement; -use MonsieurBiz\SyliusUiElementsPlugin\Form\Type\FigureType; +use MonsieurBiz\SyliusUiElementsPlugin\Form\Type\KeyFactType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints as Assert; #[AsUiElement( - code: 'monsieurbiz_ui_elements.figures_ui_element', - icon: 'percent', - title: 'monsieurbiz_ui_elements.ui_element.figures_ui_element.title', - description: 'monsieurbiz_ui_elements.ui_element.figures_ui_element.description', + code: 'monsieurbiz_ui_elements.key_facts_ui_element', + icon: 'key', + title: 'monsieurbiz_ui_elements.ui_element.key_facts_ui_element.title', + description: 'monsieurbiz_ui_elements.ui_element.key_facts_ui_element.description', templates: new TemplatesUiElement( - adminRender: '@MonsieurBizSyliusUiElementsPlugin/Admin/UiElement/figures_ui_element.html.twig', - frontRender: '@MonsieurBizSyliusUiElementsPlugin/Shop/UiElement/figures_ui_element.html.twig', + adminRender: '@MonsieurBizSyliusUiElementsPlugin/Admin/UiElement/key_facts_ui_element.html.twig', + frontRender: '@MonsieurBizSyliusUiElementsPlugin/Shop/UiElement/key_facts_ui_element.html.twig', ), tags: [], - wireframe: 'figures', + wireframe: 'key-facts', )] -class FiguresUiElementType extends AbstractType +class KeyFactsUiElementType extends AbstractType { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function buildForm(FormBuilderInterface $builder, array $options): void { - $builder->add('figures', CollectionType::class, [ - 'label' => 'monsieurbiz_ui_elements.ui_element.figures_ui_element.fields.figures', - 'button_add_label' => 'monsieurbiz_ui_elements.ui_element.figures_ui_element.buttons.add_element', - 'button_delete_label' => 'monsieurbiz_ui_elements.ui_element.figures_ui_element.buttons.delete_element', - 'entry_type' => FigureType::class, - 'prototype_name' => '__figure__', + $builder->add('key_facts', CollectionType::class, [ + 'label' => 'monsieurbiz_ui_elements.ui_element.key_facts_ui_element.fields.key_facts', + 'button_add_label' => 'monsieurbiz_ui_elements.ui_element.key_facts_ui_element.buttons.add_element', + 'button_delete_label' => 'monsieurbiz_ui_elements.ui_element.key_facts_ui_element.buttons.delete_element', + 'entry_type' => KeyFactType::class, + 'prototype_name' => '__key_fact__', 'allow_add' => true, 'allow_delete' => true, 'constraints' => [new Assert\Valid()], diff --git a/src/Resources/translations/messages.en.yaml b/src/Resources/translations/messages.en.yaml index f0f78b4..3c78e0f 100644 --- a/src/Resources/translations/messages.en.yaml +++ b/src/Resources/translations/messages.en.yaml @@ -38,15 +38,14 @@ monsieurbiz_ui_elements: choices: internal: "Same window" external: "New window" - figures_ui_element: - title: "Key Figures Element" - description: "Collection of key figures" + key_facts_ui_element: + title: "Key Facts Element" + description: "Collection of key facts" fields: - figures: "Key figures" - figure: "Key figure" + key_facts: "Key facts" buttons: - add_element: "Add key figure" - delete_element: "Delete key figure" + add_element: "Add key fact" + delete_element: "Delete key fact" advanced_quote_ui_element: title: "Advanced Quote Element" description: "Quote with title and button with a link" diff --git a/src/Resources/translations/messages.fr.yaml b/src/Resources/translations/messages.fr.yaml index 3fdbba2..2c2639d 100644 --- a/src/Resources/translations/messages.fr.yaml +++ b/src/Resources/translations/messages.fr.yaml @@ -38,12 +38,11 @@ monsieurbiz_ui_elements: choices: internal: "Même fenêtre" external: "Nouvelle fenêtre" - figures_ui_element: - title: "Lame Chiffres clés" - description: "Ensemble de chiffres clés" + key_facts_ui_element: + title: "Lame éléments clés" + description: "Ensemble d'élement clés à mettre en avant" fields: - figures: "Chiffres clés" - figure: "Chiffre clé" + key_facts: "Éléments clés" buttons: add_element: "Ajouter un chiffre clé" delete_element: "Supprimer un chiffre clé" diff --git a/src/Resources/views/Admin/UiElement/badges_ui_element.html.twig b/src/Resources/views/Admin/UiElement/badges_ui_element.html.twig index 37ffb5e..a9591fb 100644 --- a/src/Resources/views/Admin/UiElement/badges_ui_element.html.twig +++ b/src/Resources/views/Admin/UiElement/badges_ui_element.html.twig @@ -1,6 +1,6 @@ {# UI Element template -type: figures_ui_element +type: badges_ui_element element fields: - badges - title diff --git a/src/Resources/views/Admin/UiElement/figures_ui_element.html.twig b/src/Resources/views/Admin/UiElement/key_facts_ui_element.html.twig similarity index 54% rename from src/Resources/views/Admin/UiElement/figures_ui_element.html.twig rename to src/Resources/views/Admin/UiElement/key_facts_ui_element.html.twig index b56a702..864ada7 100644 --- a/src/Resources/views/Admin/UiElement/figures_ui_element.html.twig +++ b/src/Resources/views/Admin/UiElement/key_facts_ui_element.html.twig @@ -1,33 +1,33 @@ {# UI Element template -type: figures_ui_element +type: key_facts_ui_element element fields: - - figures - - figure + - key_facts + - title - description #} {% set columns = 'five' %} -{% if element.figures|length == 4 %} +{% if element.key_facts|length == 4 %} {% set columns = 'four' %} {% endif %} -{% if element.figures|length == 3 %} +{% if element.key_facts|length == 3 %} {% set columns = 'three' %} {% endif %} -{% if element.figures|length == 2 %} +{% if element.key_facts|length == 2 %} {% set columns = 'two' %} {% endif %} -{% if element.figures|length == 1 %} +{% if element.key_facts|length == 1 %} {% set columns = 'one' %} {% endif %}
- {% for keyFigure in element.figures|default([]) %} + {% for keyFact in element.key_facts|default([]) %}
- {{ keyFigure.figure }} - {% if keyFigure.description|default('') is not empty %} -

{{ keyFigure.description }}

+ {{ keyFact.title }} + {% if keyFact.description|default('') is not empty %} +

{{ keyFact.description }}

{% endif %}
diff --git a/src/Resources/views/Shop/UiElement/badges_ui_element.html.twig b/src/Resources/views/Shop/UiElement/badges_ui_element.html.twig index 37ffb5e..a9591fb 100644 --- a/src/Resources/views/Shop/UiElement/badges_ui_element.html.twig +++ b/src/Resources/views/Shop/UiElement/badges_ui_element.html.twig @@ -1,6 +1,6 @@ {# UI Element template -type: figures_ui_element +type: badges_ui_element element fields: - badges - title diff --git a/src/Resources/views/Shop/UiElement/figures_ui_element.html.twig b/src/Resources/views/Shop/UiElement/key_facts_ui_element.html.twig similarity index 54% rename from src/Resources/views/Shop/UiElement/figures_ui_element.html.twig rename to src/Resources/views/Shop/UiElement/key_facts_ui_element.html.twig index b56a702..864ada7 100644 --- a/src/Resources/views/Shop/UiElement/figures_ui_element.html.twig +++ b/src/Resources/views/Shop/UiElement/key_facts_ui_element.html.twig @@ -1,33 +1,33 @@ {# UI Element template -type: figures_ui_element +type: key_facts_ui_element element fields: - - figures - - figure + - key_facts + - title - description #} {% set columns = 'five' %} -{% if element.figures|length == 4 %} +{% if element.key_facts|length == 4 %} {% set columns = 'four' %} {% endif %} -{% if element.figures|length == 3 %} +{% if element.key_facts|length == 3 %} {% set columns = 'three' %} {% endif %} -{% if element.figures|length == 2 %} +{% if element.key_facts|length == 2 %} {% set columns = 'two' %} {% endif %} -{% if element.figures|length == 1 %} +{% if element.key_facts|length == 1 %} {% set columns = 'one' %} {% endif %}
- {% for keyFigure in element.figures|default([]) %} + {% for keyFact in element.key_facts|default([]) %}
- {{ keyFigure.figure }} - {% if keyFigure.description|default('') is not empty %} -

{{ keyFigure.description }}

+ {{ keyFact.title }} + {% if keyFact.description|default('') is not empty %} +

{{ keyFact.description }}

{% endif %}
diff --git a/src/Resources/views/Wireframe/figures.svg.twig b/src/Resources/views/Wireframe/key-facts.svg.twig similarity index 100% rename from src/Resources/views/Wireframe/figures.svg.twig rename to src/Resources/views/Wireframe/key-facts.svg.twig