feat: improve layout of contacts page

This commit is contained in:
Björn Fromme
2024-04-04 10:10:42 +02:00
parent d9a205cfd1
commit 1f6ccd8974
4 changed files with 69 additions and 40 deletions
+13 -8
View File
@@ -2,6 +2,7 @@
namespace App\Controller\Teamer;
use App\Entity\Contact;
use App\Repository\ContactRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@@ -15,19 +16,23 @@ class ContactController extends AbstractController
#[Route('/teamer/contact', name: 'app_teamer_contact')]
public function index(): Response
{
$generalContacts = $this
$allContacts = $this
->contactRepository
->getGeneralContacts()
->findAll()
;
$destinationContacts = $this
->contactRepository
->getDestinationContacts()
;
$contacts = [
Contact::CATEGORY_HR => [],
Contact::CATEGORY_MANAGEMENT => [],
Contact::CATEGORY_HOUSE_MANAGEMENT => [],
];
foreach ($allContacts as $contact) {
$contacts[$contact->getCategory()][] = $contact;
}
return $this->render('teamer/contact/index.html.twig', [
'generalContacts' => $generalContacts,
'destinationContacts' => $destinationContacts,
'contacts' => $contacts,
]);
}
}