diff --git a/src/Resources/views/bootstrap_3_layout.html.twig b/src/Resources/views/bootstrap_3_layout.html.twig new file mode 100644 index 0000000..27af08d --- /dev/null +++ b/src/Resources/views/bootstrap_3_layout.html.twig @@ -0,0 +1,34 @@ +{% block a2lix_translations_widget %} + {{ form_errors(form) }} + +
+ + +
+ {% for translationsFields in form %} + {% set locale = translationsFields.vars.name %} + +
+ {{ form_errors(translationsFields) }} + {{ form_widget(translationsFields) }} +
+ {% endfor %} +
+
+{% endblock %} + +{% block a2lix_translationsForms_widget %} + {{ block('a2lix_translations_widget') }} +{% endblock %} diff --git a/src/Resources/views/macros_bootstrap_3.html.twig b/src/Resources/views/macros_bootstrap_3.html.twig new file mode 100644 index 0000000..6da73d8 --- /dev/null +++ b/src/Resources/views/macros_bootstrap_3.html.twig @@ -0,0 +1,38 @@ +{# +Example: +{% import "@A2lixTranslationForm/macros_bootstrap_3.html.twig" as a2lixTranslations %} +{{ a2lixTranslations.partialTranslations(editForm.translations, ['title','description']) }} +{{ a2lixTranslations.partialTranslations(editForm.translations, ['url']) }} +#} + +{% macro partialTranslations(form, fieldsNames) %} + {{ form_errors(form) }} + +
+ + +
+ {% for translationsFields in form %} + {% set locale = translationsFields.vars.name %} + +
+ {% for translationsField in translationsFields|filter(translationsField => translationsField.vars.name in fieldsNames) %} + {{ form_row(translationsField) }} + {% endfor %} +
+ {% endfor %} +
+
+{% endmacro %}