+ ArCOA Role: + {% if 'ROLE_ADMIN' in app.user.roles %} + Administrator + {% elseif 'ROLE_REVISOR' in app.user.roles %} + Revisor + {% else %} + Reader + {% endif %} + + + +
+diff --git a/assets/controllers.json b/assets/controllers.json index 29ea244..2230c71 100644 --- a/assets/controllers.json +++ b/assets/controllers.json @@ -2,7 +2,7 @@ "controllers": { "@symfony/ux-turbo": { "turbo-core": { - "enabled": true, + "enabled": false, "fetch": "eager" }, "mercure-turbo-stream": { diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php new file mode 100644 index 0000000..8099f1f --- /dev/null +++ b/src/Controller/ProfileController.php @@ -0,0 +1,18 @@ +render('profile/index.html.twig', [ + 'controller_name' => 'ProfileController', + ]); + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index 2bef50d..8541dec 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -37,6 +37,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column(length: 40, nullable: true)] private ?string $lastname = null; + #[ORM\Column(length: 100, nullable: true)] + private ?string $email = null; + public function getId(): ?int { return $this->id; @@ -103,6 +106,11 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface return $this; } + public function getEmail(): ?string + { + return $this->email; + } + /** * @see UserInterface */ diff --git a/templates/profile/index.html.twig b/templates/profile/index.html.twig new file mode 100644 index 0000000..1dbea9d --- /dev/null +++ b/templates/profile/index.html.twig @@ -0,0 +1,80 @@ +{% extends 'data_entry.html.twig' %} + +{% block title %}Profile | ArCOA{% endblock %} + +{% block rightpanel %} +
{{ app.user.firstname }} {{ app.user.lastname }}
++ + + + {{ app.user.email }} +
++ ArCOA Role: + {% if 'ROLE_ADMIN' in app.user.roles %} + Administrator + {% elseif 'ROLE_REVISOR' in app.user.roles %} + Revisor + {% else %} + Reader + {% endif %} + + + +
+