Skip to content

Commit

Permalink
Update Hero UI Element
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Aug 10, 2024
1 parent 54476ec commit e026fd9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
7 changes: 1 addition & 6 deletions src/Form/Type/UiElement/HeroUiElementType.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
description: 'monsieurbiz_ui_elements.ui_element.hero_ui_element.description',
templates: new TemplatesUiElement(
adminRender: '@MonsieurBizSyliusUiElementsPlugin/Admin/UiElement/hero_ui_element.html.twig',
frontRender: '@MonsieurBizSyliusUiElementsPlugin/Front/UiElement/hero_ui_element.html.twig',
frontRender: '@MonsieurBizSyliusUiElementsPlugin/Shop/UiElement/hero_ui_element.html.twig',
),
tags: [],
wireframe: 'hero',
Expand All @@ -46,18 +46,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'editor_toolbar_type' => EditorInterface::TOOLBAR_TYPE_CUSTOM,
'editor_toolbar_buttons' => [
['undo', 'redo'],
['fontSize', 'formatBlock'],
['bold', 'underline', 'italic', 'strike'],
['fontColor', 'hiliteColor'],
['removeFormat'],
['link'],
['showBlocks', 'codeView'],
],
])
->add('subtitle', TextType::class, [
'label' => 'monsieurbiz_ui_elements.common.fields.subtitle',
'required' => false,
])
->add('description', TextType::class, [
'label' => 'monsieurbiz_ui_elements.common.fields.description',
'required' => false,
Expand Down
15 changes: 5 additions & 10 deletions src/Resources/views/Admin/UiElement/hero_ui_element.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ UI Element template
type: hero_ui_element
element fields:
- title
- subtitle
- description
#}

<div>
<p>
{% if element.title|default('') is not empty %}
<span class="ui huge header">{{ element.title|raw }}</span>
{% endif %}
{% if element.subtitle|default('') is not empty %}
<span class="ui medium header">{{ element.subtitle }}</span>
{% endif %}
</p>
{% if element.title|default('') is not empty %}
<div class="ui huge header">{{ element.title|raw }}</div>
{% endif %}
{% if element.description|default('') is not empty %}
<p>{{ element.description }}</p>
<div>{{ element.description }}</div>
{% endif %}
</div>

14 changes: 4 additions & 10 deletions src/Resources/views/Shop/UiElement/hero_ui_element.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ UI Element template
type: hero_ui_element
element fields:
- title
- subtitle
- description
#}

<div>
<p>
{% if element.title|default('') is not empty %}
<span class="ui huge header">{{ element.title|raw }}</span>
{% endif %}
{% if element.subtitle|default('') is not empty %}
<span class="ui medium header">{{ element.subtitle }}</span>
{% endif %}
</p>
{% if element.title|default('') is not empty %}
<div class="ui huge header">{{ element.title|raw }}</div>
{% endif %}
{% if element.description|default('') is not empty %}
<p>{{ element.description }}</p>
<div>{{ element.description }}</div>
{% endif %}
</div>

0 comments on commit e026fd9

Please sign in to comment.