add admin panel

Co-authored-by: Jan-Marlon Leibl <jleibl@proton.me>
Reviewed-on: #20
This commit is contained in:
2025-02-09 14:59:31 +00:00
parent e3a67adf63
commit 2ccba65185
31 changed files with 1773 additions and 17 deletions

48
src/Form/TicketType.php Normal file
View File

@ -0,0 +1,48 @@
<?php
namespace App\Form;
use App\Entity\Ticket;
use App\Enum\FoodData;
use App\Enum\TicketData;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class TicketType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('type', ChoiceType::class, [
'label' => 'Ticket Type',
'choices' => TicketData::TYPES,
'row_attr' => [
'style' => 'flex: 1;',
],
])
->add('foodType', ChoiceType::class, [
'label' => 'Ernährung',
'choices' => FoodData::TYPES,
'row_attr' => [
'style' => 'flex: 1;',
],
])
->add('note', TextType::class, [
'label' => 'Notiz',
'required' => false,
'row_attr' => [
'style' => 'flex: 2;',
],
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Ticket::class,
]);
}
}