Add profile page + disable Turbo
This commit is contained in:
parent
008cc7218d
commit
b3585047be
@ -2,7 +2,7 @@
|
||||
"controllers": {
|
||||
"@symfony/ux-turbo": {
|
||||
"turbo-core": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"fetch": "eager"
|
||||
},
|
||||
"mercure-turbo-stream": {
|
||||
|
18
src/Controller/ProfileController.php
Normal file
18
src/Controller/ProfileController.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class ProfileController extends AbstractController
|
||||
{
|
||||
#[Route('/profile', name: 'app_profile')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('profile/index.html.twig', [
|
||||
'controller_name' => 'ProfileController',
|
||||
]);
|
||||
}
|
||||
}
|
@ -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
|
||||
*/
|
||||
|
80
templates/profile/index.html.twig
Normal file
80
templates/profile/index.html.twig
Normal file
@ -0,0 +1,80 @@
|
||||
{% extends 'data_entry.html.twig' %}
|
||||
|
||||
{% block title %}Profile | ArCOA{% endblock %}
|
||||
|
||||
{% block rightpanel %}
|
||||
<h1 class="is-size-1 mb-2 has-text-centered">User profile</h1>
|
||||
|
||||
<div class="ml-6 pl-6 container">
|
||||
<div class="card ml-6">
|
||||
<div class="card-content">
|
||||
<div class="media">
|
||||
<div class="media-left">
|
||||
<span class="icon is-large">
|
||||
<i class="fa fa-user-circle fa-2x"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="media-content">
|
||||
<p class="title is-4">{{ app.user.firstname }} {{ app.user.lastname }}</p>
|
||||
<p class="subtitle is-6">
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-envelope"></i>
|
||||
</span>
|
||||
{{ app.user.email }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="is-size-4 pl-3">
|
||||
<strong>ArCOA Role:</strong>
|
||||
{% if 'ROLE_ADMIN' in app.user.roles %}
|
||||
Administrator
|
||||
{% elseif 'ROLE_REVISOR' in app.user.roles %}
|
||||
Revisor
|
||||
{% else %}
|
||||
Reader
|
||||
{% endif %}
|
||||
<span class="icon is-small is-size-5 pl-3 has-text-link">
|
||||
<i class="fa fa-question-circle"></i>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card ml-6 content">
|
||||
<form class="card-content" id="change-password">
|
||||
<div class="field">
|
||||
<h3 class="is-size-4 has-text-centered">Change password</h3>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Current password</label>
|
||||
<p class="control">
|
||||
<input class="input" name="_current_pass" required type="password" placeholder="Current password">
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">New password</label>
|
||||
<p class="control">
|
||||
<input class="input" name="_new_pass" required type="password" placeholder="New password">
|
||||
</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label">Confirm password</label>
|
||||
<p class="control">
|
||||
<input class="input" name="_confirm_pass" required type="password" placeholder="Confirm password">
|
||||
</p>
|
||||
</div>
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
||||
<div class="field mt-5">
|
||||
<p class="control" id="submit">
|
||||
<button class="button is-link is-fullwidth" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user