feat: adds nav on account page
This commit is contained in:
parent
17af3ac345
commit
6aa77329e6
@ -1,6 +1,21 @@
|
|||||||
|
.clickable{
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
a{
|
||||||
|
@extend .clickable;
|
||||||
|
color: $primary_color;
|
||||||
|
&:hover{
|
||||||
|
color: $primary_color_darker;
|
||||||
|
}
|
||||||
|
}
|
||||||
button{
|
button{
|
||||||
|
@extend .clickable;
|
||||||
|
|
||||||
padding: 1rem 2rem;
|
padding: 1rem 2rem;
|
||||||
border: solid 1px $bg_color;
|
border: solid 1px $bg_color;
|
||||||
background: $primary_color;
|
background: $primary_color;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
|
&:hover{
|
||||||
|
background: $primary_color_darker;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
$bg_color:lightgray;
|
$bg_color:lightgray;
|
||||||
$bg_main_color: white;
|
$bg_main_color: white;
|
||||||
$primary_color: #98c87e;
|
$primary_color: #98c87e;
|
||||||
|
$primary_color_darker: #537b3d;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-iconv": "*",
|
"ext-iconv": "*",
|
||||||
|
"amphp/http-client": "^4.2.1",
|
||||||
"doctrine/dbal": "^3",
|
"doctrine/dbal": "^3",
|
||||||
"doctrine/doctrine-bundle": "^2.12",
|
"doctrine/doctrine-bundle": "^2.12",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.3",
|
"doctrine/doctrine-migrations-bundle": "^3.3",
|
||||||
|
1390
composer.lock
generated
1390
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
framework:
|
framework:
|
||||||
default_locale: en
|
default_locale: fr
|
||||||
translator:
|
translator:
|
||||||
default_path: '%kernel.project_dir%/translations'
|
default_path: '%kernel.project_dir%/translations'
|
||||||
fallbacks:
|
fallbacks:
|
||||||
|
31
migrations/Version20240716084111.php
Normal file
31
migrations/Version20240716084111.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20240716084111 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -15,4 +15,10 @@ class AccountController extends AbstractController
|
|||||||
'controller_name' => 'AccountController',
|
'controller_name' => 'AccountController',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
#[Route('/account/history', name: 'app_account_history')]
|
||||||
|
public function history(): Response
|
||||||
|
{
|
||||||
|
return $this->render('account/history.html.twig', [
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
#[ORM\Column(length: 180, unique: true)]
|
#[ORM\Column(length: 180, unique: true)]
|
||||||
private ?string $email = null;
|
private ?string $email = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 500)]
|
#[ORM\Column(length: 500, nullable: true)]
|
||||||
private ?string $description = null;
|
private ?string $description = null;
|
||||||
|
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
|
12
templates/account/base.html.twig
Normal file
12
templates/account/base.html.twig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block title %}Votre compte{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div id="account_main">
|
||||||
|
{% include 'account/nav.html.twig' %}
|
||||||
|
{% block account_body %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock body %}
|
22
templates/account/history.html.twig
Normal file
22
templates/account/history.html.twig
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{% extends 'account/base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Votre historique{% endblock %}
|
||||||
|
|
||||||
|
{% block account_body %}
|
||||||
|
<div id="account_history">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
Mon compte
|
||||||
|
</h1>
|
||||||
|
<p>
|
||||||
|
Page historique
|
||||||
|
</p>
|
||||||
|
<article>
|
||||||
|
<h1>Votre historique d'actions</h1>
|
||||||
|
<p>
|
||||||
|
Blah blah blah.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock account_body %}
|
@ -1,43 +1,23 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'account/base.html.twig' %}
|
||||||
|
|
||||||
{% block title %}Votre compte{% endblock %}
|
{% block title %}Votre compte{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block account_body %}
|
||||||
<style>
|
|
||||||
.example-wrapper {
|
|
||||||
margin: 1em auto;
|
|
||||||
max-width: 800px;
|
|
||||||
width: 95%;
|
|
||||||
font: 18px/1.5 sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.example-wrapper code {
|
<div id="account_home">
|
||||||
background: #F5F5F5;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div class="example-wrapper">
|
|
||||||
<div id="account">
|
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
Mon compte
|
Mon compte
|
||||||
</h1>
|
</h1>
|
||||||
|
<p>
|
||||||
|
Coucou!
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<footer>
|
||||||
<p>
|
<p>
|
||||||
Coucou!
|
<a href="{{ path('app_logout') }}">Logout</a>
|
||||||
</p>
|
</p>
|
||||||
<menu>
|
</footer>
|
||||||
Un menu
|
|
||||||
<ul>
|
|
||||||
<li>un choix</li>
|
|
||||||
<li>un autre</li>
|
|
||||||
<li>un bidule</li>
|
|
||||||
</ul>
|
|
||||||
</menu>
|
|
||||||
<footer>
|
|
||||||
<p>
|
|
||||||
<a href="{{ path('app_logout') }}">Logout</a>
|
|
||||||
</p>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock body %}
|
</div>
|
||||||
|
{% endblock account_body %}
|
||||||
|
12
templates/account/nav.html.twig
Normal file
12
templates/account/nav.html.twig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<menu>
|
||||||
|
{# Navigation de l'espace utilisateur #}
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('app_account_history') }}">
|
||||||
|
Historique
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>un autre</li>
|
||||||
|
<li>un bidule</li>
|
||||||
|
</ul>
|
||||||
|
</menu>
|
@ -1,43 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Votre compte{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<style>
|
|
||||||
.example-wrapper {
|
|
||||||
margin: 1em auto;
|
|
||||||
max-width: 800px;
|
|
||||||
width: 95%;
|
|
||||||
font: 18px/1.5 sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.example-wrapper code {
|
|
||||||
background: #F5F5F5;
|
|
||||||
padding: 2px 6px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div class="example-wrapper">
|
|
||||||
<div id="account">
|
|
||||||
|
|
||||||
<h1>
|
|
||||||
Mon compte
|
|
||||||
</h1>
|
|
||||||
<p>
|
|
||||||
Coucou!
|
|
||||||
</p>
|
|
||||||
<menu>
|
|
||||||
Un menu
|
|
||||||
<ul>
|
|
||||||
<li>un choix</li>
|
|
||||||
<li>un autre</li>
|
|
||||||
<li>un bidule</li>
|
|
||||||
</ul>
|
|
||||||
</menu>
|
|
||||||
<footer>
|
|
||||||
<p>
|
|
||||||
<a href="{{ path('app_logout') }}">Logout</a>
|
|
||||||
</p>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock body %}
|
|
@ -1,13 +1,14 @@
|
|||||||
<div id="nav_menu">
|
<div id="nav_menu">
|
||||||
<nav>
|
<nav>
|
||||||
|
<a href="{{path('app_index')}}">Accueil</a>
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
You are logged in as
|
You are logged in as
|
||||||
<a href="{{path('account')}}">Account</a>
|
<a class="account-link" href="{{path('app_account')}}">{{ app.user.userIdentifier }}</a>
|
||||||
{{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
|
, <a href="{{ path('app_logout') }}">Logout</a>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{path('app_login')}}">Login</a>
|
<a href="{{path('app_login')}}">{{ 'user.login'|trans }}</a>
|
||||||
<a href="{{path('app_register')}}">Register</a>
|
<a href="{{path('app_register')}}">Register</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{# <a href="{{path('admin')}}">Admin</a>#}
|
{# <a href="{{path('admin')}}">Admin</a>#}
|
||||||
|
11
translations/messages.en.yaml
Normal file
11
translations/messages.en.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
common:
|
||||||
|
homepage: Homepage
|
||||||
|
pages:
|
||||||
|
app_index:
|
||||||
|
title: Hello!
|
||||||
|
subtitle: This friendly message is coming from your controller.
|
||||||
|
user:
|
||||||
|
# id is user.login
|
||||||
|
login: Login
|
||||||
|
logout: Logout
|
||||||
|
register: Register
|
1
translations/messages.fr.yaml
Normal file
1
translations/messages.fr.yaml
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
Loading…
Reference in New Issue
Block a user