Skip to content

Commit

Permalink
fix feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gabiudrescu committed Aug 22, 2024
1 parent 0dc16dc commit d3aa044
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Form/Type/UiElement/ButtonLinkType.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
])
->add('target', ChoiceType::class, [
'choices' => [
'Open in the same frame as it was clicked (this is default)' => '_self',
'Open in a new window or tab' => '_blank',
'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.target_option.self' => '_self',
'monsieurbiz_richeditor_plugin.ui_element.monsieurbiz.button.field.target_option.blank' => '_blank',
],
])
->add('align', AlignmentType::class)
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/translations/messages.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ monsieurbiz_richeditor_plugin:
label: 'Label'
link: 'Link'
target: 'Target'
target_option:
self: 'Open in the same frame as it was clicked (this is default)'
blank: 'Open in a new window or tab'
monsieurbiz.youtube:
title: 'Youtube Element'
short_description: 'A Youtube element.'
Expand Down
4 changes: 3 additions & 1 deletion src/Resources/views/Admin/UiElement/button.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#}
{% set align = element.align is defined and element.align is not empty ? element.align : 'center' %}
{% set target = element.target is defined and element.target is not empty ? element.target : '_self' %}
{% set rel = element.target is defined and element.target == '_blank' ? 'rel="noopener noreferrer"' : '' }

<p style="text-align: {{align}};">
<a href="{{ element.link }}" target="{{ element.target }}" rel="noopener noreferrer" class="ui primary button massive">{{ element.label }}</a>
<a href="{{ element.link }}" target="{{ element.target }}" {{ rel }} class="ui primary button massive">{{ element.label }}</a>
</p>

0 comments on commit d3aa044

Please sign in to comment.