diff --git a/config/packages/security.yaml b/config/packages/security.yaml index dc7ca17..9c8d719 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -26,8 +26,7 @@ security: # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used access_control: - # - { path: ^/admin, roles: ROLE_ADMIN } - # - { path: ^/profile, roles: ROLE_USER } + #- { path: ^/*, roles: ROLE_USER } when@test: security: diff --git a/src/Controller/EmployeeController.php b/src/Controller/EmployeeController.php index 11f2de5..3eee805 100644 --- a/src/Controller/EmployeeController.php +++ b/src/Controller/EmployeeController.php @@ -14,7 +14,7 @@ use Symfony\Component\Routing\Attribute\Route; #[Route('/employee', name: 'employee')] final class EmployeeController extends AbstractController { - #[Route(name: '_index', methods: ['GET'])] + #[Route('',name: '_index', methods: ['GET'])] public function index(EmployeeRepository $employeeRepository): Response { return $this->render('employee/index.html.twig', [ diff --git a/src/Form/EmployeeType.php b/src/Form/EmployeeType.php index 7868b3b..9a0048f 100644 --- a/src/Form/EmployeeType.php +++ b/src/Form/EmployeeType.php @@ -30,7 +30,7 @@ class EmployeeType extends AbstractType 'multiple' => true, // Allow multiple selections 'expanded' => true, // Render as checkboxes ]) - ->add('save', SubmitType::class, ['label' => 'Add Employee']); + ; } public function configureOptions(OptionsResolver $resolver): void diff --git a/templates/employee/_delete_form.html.twig b/templates/employee/_delete_form.html.twig index 39da1f7..d027a2b 100644 --- a/templates/employee/_delete_form.html.twig +++ b/templates/employee/_delete_form.html.twig @@ -1,4 +1,4 @@ -
+
diff --git a/templates/employee/edit.html.twig b/templates/employee/edit.html.twig index 4dadd66..904110d 100644 --- a/templates/employee/edit.html.twig +++ b/templates/employee/edit.html.twig @@ -7,7 +7,7 @@ {{ include('employee/_form.html.twig', {'button_label': 'Update'}) }} - back to list + back to list {{ include('employee/_delete_form.html.twig') }} {% endblock %} diff --git a/templates/employee/index.html.twig b/templates/employee/index.html.twig index fdd4f0d..4b198a4 100644 --- a/templates/employee/index.html.twig +++ b/templates/employee/index.html.twig @@ -12,7 +12,6 @@ Email FirstName LastName - Password Roles actions @@ -24,11 +23,10 @@ {{ employee.email }} {{ employee.firstName }} {{ employee.lastName }} - {{ employee.password }} {{ employee.roles ? employee.roles|json_encode : '' }} - show - edit + show + edit {% else %} @@ -39,5 +37,5 @@ - Create new + Create new {% endblock %} diff --git a/templates/employee/new.html.twig b/templates/employee/new.html.twig index 677c5b6..6a9863a 100644 --- a/templates/employee/new.html.twig +++ b/templates/employee/new.html.twig @@ -7,5 +7,5 @@ {{ include('employee/_form.html.twig') }} - back to list + back to list {% endblock %} diff --git a/templates/employee/show.html.twig b/templates/employee/show.html.twig index d9619eb..93f2621 100644 --- a/templates/employee/show.html.twig +++ b/templates/employee/show.html.twig @@ -23,10 +23,6 @@ LastName {{ employee.lastName }} - - Password - {{ employee.password }} - Roles {{ employee.roles ? employee.roles|json_encode : '' }} @@ -34,9 +30,9 @@ - back to list + back to list - edit + edit {{ include('employee/_delete_form.html.twig') }} {% endblock %}