diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c562a9..1655671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +* [PR-23](https://github.com/itk-dev/itk-project-database/pull/23) + Introduce reusable Twig components (page header, card header, empty state, KPI) + to replace repeated markup. * [PR-22](https://github.com/itk-dev/itk-project-database/pull/22) Use the ITK logo in the nav and login, tidy the dashboard header, and refresh the login screen. diff --git a/composer.json b/composer.json index 21aa8f6..7f3eebb 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ "symfony/translation": "~8.1.0", "symfony/twig-bundle": "~8.1.0", "symfony/ux-turbo": "^3.2", + "symfony/ux-twig-component": "^3.2", "symfony/validator": "~8.1.0", "symfony/yaml": "~8.1.0", "twig/extra-bundle": "^2.12 || ^3.0", diff --git a/composer.lock b/composer.lock index e047caf..8d4a2e5 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": "12a9cfde9017aae91381d9a166055131", + "content-hash": "1690432fc2541ccfd5e69c603125ca0e", "packages": [ { "name": "composer/semver", @@ -6863,6 +6863,95 @@ ], "time": "2026-06-19T07:14:15+00:00" }, + { + "name": "symfony/ux-twig-component", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/ux-twig-component.git", + "reference": "a9b93b10fe2056a6f93ebc1f9e3509f7fafb5bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/ux-twig-component/zipball/a9b93b10fe2056a6f93ebc1f9e3509f7fafb5bf2", + "reference": "a9b93b10fe2056a6f93ebc1f9e3509f7fafb5bf2", + "shasum": "" + }, + "require": { + "php": ">=8.4", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.2|^3.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/property-access": "^7.4|^8.0", + "twig/twig": "^3.10.3" + }, + "conflict": { + "symfony/config": "<6.4" + }, + "require-dev": { + "phpunit/phpunit": "^11.1|^12.0", + "symfony/console": "^7.4|^8.0", + "symfony/css-selector": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/dom-crawler": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/stimulus-bundle": "^2.9.1|^3.0", + "symfony/twig-bundle": "^7.4|^8.0", + "twig/extra-bundle": "^3.10.3", + "twig/html-extra": "^3.10.3" + }, + "type": "symfony-bundle", + "extra": { + "thanks": { + "url": "https://github.com/symfony/ux", + "name": "symfony/ux" + } + }, + "autoload": { + "psr-4": { + "Symfony\\UX\\TwigComponent\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Twig components for Symfony", + "homepage": "https://symfony.com", + "keywords": [ + "components", + "symfony-ux", + "twig" + ], + "support": { + "source": "https://github.com/symfony/ux-twig-component/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-11T20:32:06+00:00" + }, { "name": "symfony/validator", "version": "v8.1.0", diff --git a/config/bundles.php b/config/bundles.php index 2d685b3..f4c7831 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -17,4 +17,5 @@ Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true], DH\AuditorBundle\DHAuditorBundle::class => ['all' => true], ITKDev\EntityBundle\ITKDevEntityBundle::class => ['all' => true], + Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], ]; diff --git a/config/packages/twig_component.yaml b/config/packages/twig_component.yaml new file mode 100644 index 0000000..1d7b9c4 --- /dev/null +++ b/config/packages/twig_component.yaml @@ -0,0 +1,5 @@ +twig_component: + anonymous_template_directory: 'components/' + defaults: + # Namespace & directory for components + App\Twig\Components\: 'components/' diff --git a/symfony.lock b/symfony.lock index 9cb14e8..d301674 100644 --- a/symfony.lock +++ b/symfony.lock @@ -310,6 +310,18 @@ "config/packages/ux_turbo.yaml" ] }, + "symfony/ux-twig-component": { + "version": "3.2", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.13", + "ref": "f367ae2a1faf01c503de2171f1ec22567febeead" + }, + "files": [ + "config/packages/twig_component.yaml" + ] + }, "symfony/validator": { "version": "8.1", "recipe": { diff --git a/templates/admin/areas/edit.html.twig b/templates/admin/areas/edit.html.twig index 4660e79..62c59aa 100644 --- a/templates/admin/areas/edit.html.twig +++ b/templates/admin/areas/edit.html.twig @@ -3,18 +3,15 @@ {% block title %}{{ 'area.edit.title'|trans }} · {{ 'app.name'|trans }}{% endblock %} {% block admin_content %} -
{{ 'area.index.subtitle'|trans }}
-{{ 'area.empty.hint'|trans }}
-