feat: adds nav on account page

This commit is contained in:
Tykayn 2024-07-16 10:54:05 +02:00 committed by tykayn
parent 17af3ac345
commit 6aa77329e6
16 changed files with 1522 additions and 84 deletions

View File

@ -1,6 +1,21 @@
.clickable{
cursor:pointer;
}
a{
@extend .clickable;
color: $primary_color;
&:hover{
color: $primary_color_darker;
}
}
button{
@extend .clickable;
padding: 1rem 2rem;
border: solid 1px $bg_color;
background: $primary_color;
border-radius: 0.25rem;
&:hover{
background: $primary_color_darker;
}
}

View File

@ -1,3 +1,4 @@
$bg_color:lightgray;
$bg_main_color: white;
$primary_color: #98c87e;
$primary_color_darker: #537b3d;

View File

@ -7,6 +7,7 @@
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"amphp/http-client": "^4.2.1",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",

1390
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
framework:
default_locale: en
default_locale: fr
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:

View 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
}
}

View File

@ -15,4 +15,10 @@ class AccountController extends AbstractController
'controller_name' => 'AccountController',
]);
}
#[Route('/account/history', name: 'app_account_history')]
public function history(): Response
{
return $this->render('account/history.html.twig', [
]);
}
}

View File

@ -21,7 +21,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(length: 180, unique: true)]
private ?string $email = null;
#[ORM\Column(length: 500)]
#[ORM\Column(length: 500, nullable: true)]
private ?string $description = null;
#[ORM\Column]

View 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 %}

View 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 %}

View File

@ -1,23 +1,10 @@
{% extends 'base.html.twig' %}
{% extends 'account/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;
}
{% block account_body %}
.example-wrapper code {
background: #F5F5F5;
padding: 2px 6px;
}
</style>
<div class="example-wrapper">
<div id="account">
<div id="account_home">
<h1>
Mon compte
@ -25,14 +12,7 @@
<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>
@ -40,4 +20,4 @@
</footer>
</div>
</div>
{% endblock body %}
{% endblock account_body %}

View 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>

View File

@ -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 %}

View File

@ -1,13 +1,14 @@
<div id="nav_menu">
<nav>
<a href="{{path('app_index')}}">Accueil</a>
{% if app.user %}
<div class="mb-3">
You are logged in as
<a href="{{path('account')}}">Account</a>
{{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
<a class="account-link" href="{{path('app_account')}}">{{ app.user.userIdentifier }}</a>
, <a href="{{ path('app_logout') }}">Logout</a>
</div>
{% else %}
<a href="{{path('app_login')}}">Login</a>
<a href="{{path('app_login')}}">{{ 'user.login'|trans }}</a>
<a href="{{path('app_register')}}">Register</a>
{% endif %}
{# <a href="{{path('admin')}}">Admin</a>#}

View 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

View File

@ -0,0 +1 @@