Skip to content

Commit ec9261f

Browse files
author
Leny BERNARD
committed
some form template improvments
1 parent 2f8414c commit ec9261f

7 files changed

Lines changed: 21 additions & 5 deletions

File tree

Entity/WidgetButton.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Victoire\Widget\ButtonBundle\Entity;
44

55
use Doctrine\ORM\Mapping as ORM;
6+
use Symfony\Component\Validator\Constraints as Assert;
67
use Victoire\Bundle\WidgetBundle\Entity\Widget;
78

89
/**
@@ -17,6 +18,7 @@ class WidgetButton extends Widget
1718

1819
/**
1920
* @var string
21+
* @Assert\NotBlank()
2022
*
2123
* @ORM\Column(name="title", type="string", length=255)
2224
*/

Form/WidgetButtonType.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
6464
->add('tooltipable', null, [
6565
'label' => 'widget.button.form.label.tooltipable',
6666
])
67-
->add('icon', FontAwesomePickerType::class);
67+
->add('icon', FontAwesomePickerType::class, [
68+
'label' => 'widget.button.form.label.icon',
69+
'required' => false,
70+
]);
6871

6972
parent::buildForm($builder, $options);
7073
}

Resources/config/services.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
services:
22
victoire_core.widget_button_content_resolver:
3-
parent: victoire_widget.base_widget_content_resolver
43
class: Victoire\Widget\ButtonBundle\Resolver\WidgetButtonContentResolver
54
tags:
65
- { name: victoire_widget.widget_content_resolver, alias: Button }

Resources/translations/victoire.en.xliff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
<source>widget.button.form.label.tooltipable</source>
8787
<target>Active title as a tooltip ?</target>
8888
</trans-unit>
89+
<trans-unit resname="widget.button.form.label.icon">
90+
<source>widget.button.form.label.icon</source>
91+
<target>Icon</target>
92+
</trans-unit>
8993
</body>
9094
</file>
9195
</xliff>

Resources/translations/victoire.es.xliff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
<source>widget.button.form.label.tooltipable</source>
8787
<target>¿ Título activo como una tooltip ?</target>
8888
</trans-unit>
89+
<trans-unit resname="widget.button.form.label.icon">
90+
<source>widget.button.form.label.icon</source>
91+
<target>Icon</target>
92+
</trans-unit>
8993
</body>
9094
</file>
9195
</xliff>

Resources/translations/victoire.fr.xliff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
<source>widget.button.form.label.tooltipable</source>
8383
<target>Activer le titre en tooltip ?</target>
8484
</trans-unit>
85+
<trans-unit resname="widget.button.form.label.icon">
86+
<source>widget.button.form.label.icon</source>
87+
<target>Icône</target>
88+
</trans-unit>
8589
</body>
8690
</file>
8791
</xliff>

Resources/views/new.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
{{ form_row(form.style) }}
1919

2020
<div class="vic-clearfix">
21-
{{ form_row(form.isBlock) }}
21+
{{ form_widget(form.isBlock) }}
2222
</div>
2323

2424
<div class="vic-clearfix">
25-
{{ form_row(form.isCallToAction) }}
25+
{{ form_widget(form.isCallToAction) }}
2626
</div>
2727

2828
<div class="vic-clearfix">
29-
{{ form_row(form.tooltipable) }}
29+
{{ form_widget(form.tooltipable) }}
3030
</div>
3131
</div>
3232

0 commit comments

Comments
 (0)