From 1118fdfb455b056d50a29034f4ddb74d04700f93 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sun, 22 Dec 2024 01:16:15 +0000 Subject: [PATCH] Add resource type --- src/Entity/CommunityResource.php | 3 +-- src/Form/ResourceFormType.php | 7 +++++++ templates/internal/community_resource/add.html.twig | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Entity/CommunityResource.php b/src/Entity/CommunityResource.php index 9241f11..e73cbb0 100644 --- a/src/Entity/CommunityResource.php +++ b/src/Entity/CommunityResource.php @@ -104,9 +104,8 @@ class CommunityResource private array $type = []; public function __construct( - private DateTime $today + private DateTime $today = new DateTime('now', new DateTimeZone('America/New_York')) ) { - $this->today = new DateTime('now', new DateTimeZone('America/New_York')); } public function getId(): ?Uuid diff --git a/src/Form/ResourceFormType.php b/src/Form/ResourceFormType.php index 5c50e31..e3c8e92 100644 --- a/src/Form/ResourceFormType.php +++ b/src/Form/ResourceFormType.php @@ -4,6 +4,7 @@ namespace App\Form; use App\Entity\CommunityResource; use App\Enums\County; +use App\Enums\ResourceType; use App\Enums\State; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\EmailType; @@ -83,6 +84,12 @@ class ResourceFormType extends AbstractType 'widget' => 'single_text', ]) ->add('notes') + ->add('type', EnumType::class, [ + 'class' => ResourceType::class, + 'expanded' => true, + 'multiple' => true, + + ]) ->add('servicesAvailable') ; } diff --git a/templates/internal/community_resource/add.html.twig b/templates/internal/community_resource/add.html.twig index 51bf6f0..bafe5f9 100644 --- a/templates/internal/community_resource/add.html.twig +++ b/templates/internal/community_resource/add.html.twig @@ -88,6 +88,10 @@ + +
+ {{ form_row(form.type) }} +