diff --git a/composer.json b/composer.json index 04ad75b..207be90 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,7 @@ "symfony/web-link": "7.4.*", "symfony/yaml": "7.4.*", "twig/extra-bundle": "^2.12|^3.0", + "twig/intl-extra": "^3.26", "twig/twig": "^2.12|^3.0" }, "config": { diff --git a/composer.lock b/composer.lock index 796d440..bd14e33 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef19a7def0151d8b452378a05ec4c324", + "content-hash": "3e68f01587473077081d93ce2360e229", "packages": [ { "name": "composer/semver", @@ -7888,6 +7888,70 @@ ], "time": "2026-02-07T08:07:38+00:00" }, + { + "name": "twig/intl-extra", + "version": "v3.26.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/intl-extra.git", + "reference": "98f5ad5bff13230fcd2d834d9e79b50adf3ccda9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/98f5ad5bff13230fcd2d834d9e79b50adf3ccda9", + "reference": "98f5ad5bff13230fcd2d834d9e79b50adf3ccda9", + "shasum": "" + }, + "require": { + "php": ">=8.1.0", + "symfony/intl": "^5.4|^6.4|^7.0|^8.0", + "twig/twig": "^3.13|^4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Twig\\Extra\\Intl\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + } + ], + "description": "A Twig extension for Intl", + "homepage": "https://twig.symfony.com", + "keywords": [ + "intl", + "twig" + ], + "support": { + "source": "https://github.com/twigphp/intl-extra/tree/v3.26.0" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2026-05-19T20:44:48+00:00" + }, { "name": "twig/twig", "version": "v3.28.0", diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index 490bfc2..32a78fc 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -1,5 +1,5 @@ framework: - default_locale: en + default_locale: de translator: default_path: '%kernel.project_dir%/translations' providers: diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 3f795d9..c74c19c 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -1,5 +1,7 @@ twig: file_name_pattern: '*.twig' + # One theme for the whole app, so it is registered globally rather than per-template. + form_themes: ['forms.html.twig'] when@test: twig: diff --git a/config/reference.php b/config/reference.php index 052ac9b..5f78136 100644 --- a/config/reference.php +++ b/config/reference.php @@ -968,7 +968,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * enabled?: bool|Param, // Default: false * }, * intl?: bool|array{ - * enabled?: bool|Param, // Default: false + * enabled?: bool|Param, // Default: true * }, * cssinliner?: bool|array{ * enabled?: bool|Param, // Default: false diff --git a/templates/forms.html.twig b/templates/forms.html.twig new file mode 100644 index 0000000..d3d52c3 --- /dev/null +++ b/templates/forms.html.twig @@ -0,0 +1,102 @@ +{# + Ported from myep's forms_admin.html.twig, trimmed to the blocks this app actually has. + Registered globally in config/packages/twig.yaml rather than per-template: myep applies it + with {% form_theme %} because it carries two themes, we only have one. + + Deliberately not ported: datepicker_widget, autocomplete_widget, multiselect_widget, + money_widget, birthday_widget, abbreviated_date_widget -- all back myep-specific form types + and Stimulus controllers that do not exist here. +#} +{% use 'form_div_layout.html.twig' %} + +{%- block form_row -%} + {%- set widget_attr = {} -%} + {%- if help is not empty -%} + {%- set widget_attr = {attr: {'aria-describedby': id ~ "_help"}} -%} + {%- endif -%} +