Skip to content

Commit

Permalink
Merge pull request #361 from Victoire/improve/style-type
Browse files Browse the repository at this point in the history
💄 improve widget style type
  • Loading branch information
Leny BERNARD committed Mar 16, 2016
2 parents 74f1502 + fa337ca commit 904db41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Bundle/WidgetBundle/Form/WidgetStyleType.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('containerTag', ChoiceType::class, [
'label' => 'widget_layout.form.containerTag.label',
'vic_help_block' => 'widget_layout.form.containerTag.help_block',
'choices' => Widget::$tags,
'choices_as_values' => true,
'choices' => array_combine(Widget::$tags, Widget::$tags),
])
->add('containerClass', null, [
'label' => 'widget_layout.form.containerClass.label',
Expand Down Expand Up @@ -101,21 +100,25 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'attr' => ['placeholder' => 'widget_layout.form.containerWidth.placeholder'],
])
->add('textAlign'.$key, ChoiceType::class, [
'label' => 'widget_layout.form.textAlign'.$key.'.label',
'choices' => [
'label' => 'widget_layout.form.textAlign'.$key.'.label',
'required' => false,
'choices' => [
'widget_layout.form.textAlign.choices.left.label' => 'left',
'widget_layout.form.textAlign.choices.center.label' => 'center',
'widget_layout.form.textAlign.choices.right.label' => 'right',
'widget_layout.form.textAlign.choices.justify.label' => 'justify',
],
'placeholder' => 'widget_layout.form.textAlign.choices.placeholder',
'choices_as_values' => true,
])
->add('containerBackgroundType'.$key, ChoiceType::class, [
'label' => 'widget_layout.form.containerBackgroundType'.$key.'.label',
'choices' => [
'label' => 'widget_layout.form.containerBackgroundType'.$key.'.label',
'required' => false,
'choices' => [
'widget_layout.form.containerBackgroundType.choices.color.label' => 'color',
'widget_layout.form.containerBackgroundType.choices.image.label' => 'image',
],
'placeholder' => 'widget_layout.form.containerBackgroundType.choices.placeholder',
'choices_as_values' => true,
'attr' => [
'data-refreshOnChange' => 'true',
Expand Down
9 changes: 9 additions & 0 deletions Bundle/WidgetBundle/Resources/translations/victoire.fr.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,15 @@
<source>widget_layout.form.containerBackground.help_block</source>
<target>Ce champs est déprécié, et sera supprimé prochainement. Merci de ne plus l'utiliser.</target>
</trans-unit>
<trans-unit id="101" resname="widget_layout.form.containerBackgroundType.choices.placeholder">
<source>widget_layout.form.containerBackgroundType.choices.placeholder</source>
<target>Aucun</target>
</trans-unit>
<trans-unit id="102" resname="widget_layout.form.textAlign.choices.placeholder">
<source>widget_layout.form.textAlign.choices.placeholder</source>
<target>Par défaut</target>
</trans-unit>

</body>
</file>
</xliff>

0 comments on commit 904db41

Please sign in to comment.