diff --git a/composer.json b/composer.json index 9ef740a..e20a528 100644 --- a/composer.json +++ b/composer.json @@ -55,6 +55,7 @@ "symfony/translation": "6.4.*", "symfony/twig-bundle": "6.4.*", "symfony/uid": "6.4.*", + "symfony/ux-twig-component": "^2.16", "symfony/validator": "6.4.*", "symfony/web-link": "6.4.*", "symfony/webpack-encore-bundle": "^2.0", diff --git a/composer.lock b/composer.lock index 12da610..4ce4e51 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": "818236d2338d823f03df901faa47b1c5", + "content-hash": "18ff369a6df51ed294b3946625466f92", "packages": [ { "name": "beberlei/doctrineextensions", @@ -8130,6 +8130,90 @@ ], "time": "2024-01-23T14:51:35+00:00" }, + { + "name": "symfony/ux-twig-component", + "version": "v2.16.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/ux-twig-component.git", + "reference": "c789f33dd8800949293dd94bf8e7bf01c39559a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/ux-twig-component/zipball/c789f33dd8800949293dd94bf8e7bf01c39559a2", + "reference": "c789f33dd8800949293dd94bf8e7bf01c39559a2", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/deprecation-contracts": "^2.2|^3.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4|^6.0|^7.0", + "twig/twig": "~3.8.0" + }, + "conflict": { + "symfony/config": "<5.4.0" + }, + "require-dev": { + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/css-selector": "^5.4|^6.0|^7.0", + "symfony/dom-crawler": "^5.4|^6.0|^7.0", + "symfony/framework-bundle": "^5.4|^6.0|^7.0", + "symfony/phpunit-bridge": "^6.0|^7.0", + "symfony/stimulus-bundle": "^2.9.1", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/twig-bundle": "^5.4|^6.0|^7.0", + "symfony/webpack-encore-bundle": "^1.15" + }, + "type": "symfony-bundle", + "extra": { + "thanks": { + "name": "symfony/ux", + "url": "https://github.com/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/v2.16.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-02-29T16:20:59+00:00" + }, { "name": "symfony/validator", "version": "v6.4.3", diff --git a/config/bundles.php b/config/bundles.php index 22b4f0d..327b088 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -18,4 +18,5 @@ return [ Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true], Nelmio\SecurityBundle\NelmioSecurityBundle::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..fd17ac6 --- /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/src/Twig/Components/DropDown.php b/src/Twig/Components/DropDown.php new file mode 100644 index 0000000..b0b2f49 --- /dev/null +++ b/src/Twig/Components/DropDown.php @@ -0,0 +1,10 @@ + {% if assignment.pickup %} {% set pickup = assignment.destination.pickup(assignment.pickup) %} -
-
- Busbegleitung -
-
- ab {{ pickup.city }}, {{ pickup.street }} -
-
-
-
- Busabfahrt -
-
- {{ pickup.time }} Uhr -
-
+ {% if pickup is not null %} +
+
+ Busbegleitung +
+
+ ab {{ pickup.city }}, {{ pickup.street }} +
+
+
+
+ Busabfahrt +
+
+ {{ pickup.time }} Uhr +
+
+ {% endif %} {% endif %} {% if application is defined and application is not null and application.pickup is not null %}
diff --git a/templates/_partials/_description_list.html.twig b/templates/_partials/_description_list.html.twig deleted file mode 100644 index 64700b8..0000000 --- a/templates/_partials/_description_list.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -
- {% for item in items %} -
-
- {{ item.type }} -
-
- {{ item.description }} -
-
- {% endfor %} -
\ No newline at end of file diff --git a/templates/_partials/_errorbox.html.twig b/templates/_partials/_errorbox.html.twig deleted file mode 100644 index 034b426..0000000 --- a/templates/_partials/_errorbox.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -
- {{ icon('alert', 'w-6 h-6 shrink-0') }} - {{ message }} -
diff --git a/templates/_partials/_infobox.html.twig b/templates/_partials/_infobox.html.twig deleted file mode 100644 index 886633d..0000000 --- a/templates/_partials/_infobox.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -
- {{ icon('info', 'w-6 h-6 shrink-0') }} - {{ message }} -
diff --git a/templates/_partials/_rating_stars.html.twig b/templates/_partials/_rating_stars.html.twig deleted file mode 100644 index c01400f..0000000 --- a/templates/_partials/_rating_stars.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -{% set averageRating = teamer.averageRating %} -
- {% for grade in range(1, 5) %} - {{ icon('star', html_classes('w-4 h-4', { 'text-gray-200': averageRating < grade * 100, 'text-primary': averageRating >= grade * 100 })) }} - {% endfor %} -
\ No newline at end of file diff --git a/templates/administrative/assignment/detail.html.twig b/templates/administrative/assignment/detail.html.twig index 722d182..99cc314 100644 --- a/templates/administrative/assignment/detail.html.twig +++ b/templates/administrative/assignment/detail.html.twig @@ -47,7 +47,7 @@ {{ application.teamer }} {{ icon('info', 'w-4 h-4') }} - {% include '_partials/_rating_stars.html.twig' with { 'teamer': application.teamer } %} + {{ application.pickup|bpn_pickup_label|default('-') }} @@ -138,7 +138,7 @@ {{ disposition.teamer }} {{ icon('info', 'w-4 h-4') }} - {% include '_partials/_rating_stars.html.twig' with { 'teamer': disposition.teamer } %} + {{ disposition.remarks|nl2br|default('-') }} diff --git a/templates/administrative/assignment/index.html.twig b/templates/administrative/assignment/index.html.twig index a8593c2..1d9ee56 100644 --- a/templates/administrative/assignment/index.html.twig +++ b/templates/administrative/assignment/index.html.twig @@ -149,40 +149,38 @@ hx-target="body" hx-swap="beforeend"> {{ disposition.teamer }} - {% include '_partials/_rating_stars.html.twig' with { 'teamer': disposition.teamer } %} +
{% endfor %} - {% embed '_partials/_dropdown.html.twig' %} - {% block items %} - - + + + duplizieren + + {% if is_granted('EDIT', assignment) %} + - duplizieren + bearbeiten - {% if is_granted('EDIT', assignment) %} - - bearbeiten - - {% endif %} - {% endblock %} - {% endembed %} + {% endif %} + {% else %} diff --git a/templates/administrative/teamer/index.html.twig b/templates/administrative/teamer/index.html.twig index 31becd1..ffb9ee5 100644 --- a/templates/administrative/teamer/index.html.twig +++ b/templates/administrative/teamer/index.html.twig @@ -66,7 +66,7 @@ {{ icon('user', 'w-10 h-10 text-gray-200') }} {% endif %} - {% include '_partials/_rating_stars.html.twig' with { 'teamer': teamer } %} + diff --git a/templates/administrative/teamer/modal_info.html.twig b/templates/administrative/teamer/modal_info.html.twig index 1157589..65166f9 100644 --- a/templates/administrative/teamer/modal_info.html.twig +++ b/templates/administrative/teamer/modal_info.html.twig @@ -45,7 +45,7 @@ {{ icon('user', 'w-32 h-32 text-gray-200') }} {% endif %} - {% include '_partials/_rating_stars.html.twig' with { 'teamer': teamer } %} +