From 254a48bae2169ab4a616ff7fc8405d2cdb30f597 Mon Sep 17 00:00:00 2001 From: Jan-Marlon Leibl Date: Thu, 23 Jan 2025 17:54:46 +0100 Subject: [PATCH] feat(contact): add web profiler and update contact form layout --- composer.json | 4 +- composer.lock | 146 +++++++++++++++++++++++++++++- config/bundles.php | 1 + config/packages/web_profiler.yaml | 17 ++++ config/routes/web_profiler.yaml | 8 ++ src/Form/ContactForm.php | 3 +- symfony.lock | 13 +++ templates/contact/index.html.twig | 63 ++++++++++--- templates/home/index.html.twig | 4 +- 9 files changed, 239 insertions(+), 20 deletions(-) create mode 100644 config/packages/web_profiler.yaml create mode 100644 config/routes/web_profiler.yaml diff --git a/composer.json b/composer.json index 750aef6..d4bcf73 100644 --- a/composer.json +++ b/composer.json @@ -73,6 +73,8 @@ } }, "require-dev": { - "symfony/maker-bundle": "^1.62" + "symfony/maker-bundle": "^1.62", + "symfony/stopwatch": "7.2.*", + "symfony/web-profiler-bundle": "7.2.*" } } diff --git a/composer.lock b/composer.lock index 76d2517..69621f3 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": "558a68f7d125c4bb0c483b28d3d4216d", + "content-hash": "87a9abd6d5fb70cb5bb8ca8a4fbec881", "packages": [ { "name": "composer/semver", @@ -4086,6 +4086,150 @@ } ], "time": "2025-01-15T00:21:40+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "reference": "e46690d5b9d7164a6d061cab1e8d46141b9f49df", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.2.2" + }, + "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-12-18T14:28:33+00:00" + }, + { + "name": "symfony/web-profiler-bundle", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/web-profiler-bundle.git", + "reference": "5d37d9bd86ab49bd94c57e18e601e27fb6760f2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/5d37d9bd86ab49bd94c57e18e601e27fb6760f2c", + "reference": "5d37d9bd86ab49bd94c57e18e601e27fb6760f2c", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/config": "^6.4|^7.0", + "symfony/framework-bundle": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", + "symfony/twig-bundle": "^6.4|^7.0", + "twig/twig": "^3.12" + }, + "conflict": { + "symfony/form": "<6.4", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", + "symfony/serializer": "<7.2" + }, + "require-dev": { + "symfony/browser-kit": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/css-selector": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Symfony\\Bundle\\WebProfilerBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a development tool that gives detailed information about the execution of any request", + "homepage": "https://symfony.com", + "keywords": [ + "dev" + ], + "support": { + "source": "https://github.com/symfony/web-profiler-bundle/tree/v7.2.2" + }, + "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-12-11T15:34:14+00:00" } ], "aliases": [], diff --git a/config/bundles.php b/config/bundles.php index cf1b4a7..d801072 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -6,4 +6,5 @@ return [ Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], ]; diff --git a/config/packages/web_profiler.yaml b/config/packages/web_profiler.yaml new file mode 100644 index 0000000..b946111 --- /dev/null +++ b/config/packages/web_profiler.yaml @@ -0,0 +1,17 @@ +when@dev: + web_profiler: + toolbar: true + intercept_redirects: false + + framework: + profiler: + only_exceptions: false + collect_serializer_data: true + +when@test: + web_profiler: + toolbar: false + intercept_redirects: false + + framework: + profiler: { collect: false } diff --git a/config/routes/web_profiler.yaml b/config/routes/web_profiler.yaml new file mode 100644 index 0000000..8d85319 --- /dev/null +++ b/config/routes/web_profiler.yaml @@ -0,0 +1,8 @@ +when@dev: + web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + + web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler diff --git a/src/Form/ContactForm.php b/src/Form/ContactForm.php index e5b4aa4..b967b37 100644 --- a/src/Form/ContactForm.php +++ b/src/Form/ContactForm.php @@ -15,7 +15,6 @@ class ContactForm extends AbstractType { $builder->add('email', EmailType::class) ->add('message', TextareaType::class) - ->add('phone', TextType::class) - ->add('send', SubmitType::class); + ->add('phone', TextType::class); } } \ No newline at end of file diff --git a/symfony.lock b/symfony.lock index ab6c957..2d9a934 100644 --- a/symfony.lock +++ b/symfony.lock @@ -105,6 +105,19 @@ "templates/base.html.twig" ] }, + "symfony/web-profiler-bundle": { + "version": "7.2", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "6.1", + "ref": "e42b3f0177df239add25373083a564e5ead4e13a" + }, + "files": [ + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" + ] + }, "symfonycasts/tailwind-bundle": { "version": "v0.7.1" }, diff --git a/templates/contact/index.html.twig b/templates/contact/index.html.twig index 8b17c78..c471476 100644 --- a/templates/contact/index.html.twig +++ b/templates/contact/index.html.twig @@ -1,20 +1,55 @@ {% extends 'base.html.twig' %} -{% block title %}Hello ContactController!{% endblock %} +{% block title %}Kontakt{% endblock %} {% block body %} - +
+
+ +
-
-

Hello {{ controller_name }}! ✅

- - This friendly message is coming from: -
    -
  • Your controller at /var/www/html/src/Controller/ContactController.php
  • -
  • Your template at /var/www/html/templates/contact/index.html.twig
  • -
-
+
+
+

+ Kontakt +

+ +
+ {{ form_start(form, { 'attr': { 'class': 'space-y-6' } }) }} +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ {{ form_end(form) }} +
+
+
+
{% endblock %} diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 63f5dc2..a7e9f10 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -7,7 +7,7 @@
@@ -19,7 +19,7 @@ Willkommen zum Abiball 2025 -
+

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.