Compare commits
17 Commits
8f18e44be6
...
b67abad361
Author | SHA1 | Date | |
---|---|---|---|
b67abad361 | |||
8bc99d9492 | |||
e729450c64 | |||
39a8e59288 | |||
fc222f516c | |||
95aca509fc | |||
80b7c64aaf | |||
a8b80273a7 | |||
071fcb41b4 | |||
a949b7b390 | |||
6ccbb1a245 | |||
e9c7395d86 | |||
ceb8edafe6 | |||
b3321fc76d | |||
d9ce22834c | |||
9573cfea91 | |||
3afb1777ab |
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -1,21 +1,47 @@
|
||||
security:
|
||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||
password_hashers:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'plaintext' # à mettre en auto pour sécuriser les mdp
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
providers:
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider:
|
||||
app_intern_provider:
|
||||
entity:
|
||||
class: App\Entity\User
|
||||
class: App\Entity\Intern
|
||||
property: nickname
|
||||
|
||||
app_employee_provider:
|
||||
entity:
|
||||
class: App\Entity\Employee
|
||||
property: nickname
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
intern:
|
||||
lazy: true
|
||||
provider: app_user_provider
|
||||
provider: app_intern_provider
|
||||
form_login:
|
||||
login_path: app_login
|
||||
check_path: app_login
|
||||
enable_csrf: true
|
||||
logout:
|
||||
path: app_logout
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
employee:
|
||||
lazy: true
|
||||
provider: app_employee_provider
|
||||
form_login:
|
||||
login_path: app_login
|
||||
check_path: app_login
|
||||
enable_csrf: true
|
||||
logout:
|
||||
path: app_logout
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
|
31
migrations/Version20241121153037.php
Normal file
31
migrations/Version20241121153037.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 Version20241121153037 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
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
BIN
public/images/fond_site.png
Normal file
BIN
public/images/fond_site.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 392 KiB |
@ -11,8 +11,12 @@ class IndexController extends AbstractController
|
||||
#[Route('/index', name: 'app_index')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('index/index.html.twig', [
|
||||
'controller_name' => 'IndexController',
|
||||
]);
|
||||
return $this->render('index/index.html.twig', []);
|
||||
}
|
||||
|
||||
#[Route('/test', name: 'app_test')]
|
||||
public function test(): Response
|
||||
{
|
||||
return $this->render('base.html.twig', []);
|
||||
}
|
||||
}
|
75
src/Controller/RegistrationController.php
Normal file
75
src/Controller/RegistrationController.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Employee;
|
||||
use App\Entity\Intern;
|
||||
use App\Entity\UserApp;
|
||||
use App\Form\RegistrationFormType;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/register', name: 'app_register')]
|
||||
class RegistrationController extends AbstractController
|
||||
{
|
||||
#[Route('/intern', name: '_intern')]
|
||||
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, Security $security, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$user = new Intern();
|
||||
$form = $this->createForm(RegistrationFormType::class, $user);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var string $plainPassword */
|
||||
$plainPassword = $form->get('plainPassword')->getData();
|
||||
|
||||
$user->setRoles(['ROLE_INTERN']);
|
||||
// encode the plain password
|
||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||
|
||||
$entityManager->persist($user);
|
||||
$entityManager->flush();
|
||||
|
||||
// do anything else you need here, like send an email
|
||||
|
||||
return $security->login($user, 'form_login', 'intern');
|
||||
}
|
||||
|
||||
return $this->render('registration/register.html.twig', [
|
||||
'registrationForm' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/employee', name: '_employee')]
|
||||
public function registerEmployee(Request $request, UserPasswordHasherInterface $userPasswordHasher, Security $security, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$user = new Employee();
|
||||
$form = $this->createForm(RegistrationFormType::class, $user);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var string $plainPassword */
|
||||
$plainPassword = $form->get('plainPassword')->getData();
|
||||
|
||||
$user->setRoles(['ROLE_EMPLOYEE']);
|
||||
// encode the plain password
|
||||
$user->setPassword($userPasswordHasher->hashPassword($user, $plainPassword));
|
||||
|
||||
$entityManager->persist($user);
|
||||
$entityManager->flush();
|
||||
|
||||
// do anything else you need here, like send an email
|
||||
|
||||
return $security->login($user, 'form_login', 'employee');
|
||||
}
|
||||
|
||||
return $this->render('registration/register.html.twig', [
|
||||
'registrationForm' => $form,
|
||||
]);
|
||||
}
|
||||
}
|
32
src/Controller/SecurityController.php
Normal file
32
src/Controller/SecurityController.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
class SecurityController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/login', name: 'app_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||
{
|
||||
// get the login error if there is one
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
|
||||
// last username entered by the user
|
||||
$lastUsername = $authenticationUtils->getLastUsername();
|
||||
|
||||
return $this->render('security/login.html.twig', [
|
||||
'last_username' => $lastUsername,
|
||||
'error' => $error,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/logout', name: 'app_logout')]
|
||||
public function logout(): void
|
||||
{
|
||||
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||
}
|
||||
}
|
@ -96,7 +96,7 @@ class Announcement
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setStatus(?Status $status): static
|
||||
public function setStatus(?string $status): static
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
|
@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
class Employee extends UserApp
|
||||
{
|
||||
#[ORM\ManyToOne(inversedBy: 'employees')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
#[ORM\JoinColumn(nullable: true)]
|
||||
private ?Company $company = null;
|
||||
|
||||
public function getCompany(): ?Company
|
||||
|
@ -12,10 +12,10 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
class Intern extends UserApp
|
||||
{
|
||||
|
||||
#[ORM\Column(type: Types::TEXT)]
|
||||
#[ORM\Column(type: Types::TEXT,nullable: true)]
|
||||
private ?string $coverLetter = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255,nullable: true)]
|
||||
private ?string $resume = null;
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ namespace App\Entity;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
@ -13,6 +14,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
#[ORM\DiscriminatorColumn(name: 'DISCRIMINATOR', type: 'string')]
|
||||
#[ORM\DiscriminatorMap(['employee' => Employee::class, 'intern' => Intern::class])]
|
||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_NICKNAME', fields: ['nickname'])]
|
||||
#[UniqueEntity(fields: ['nickname'], message: 'Il y a déjà un compte avec ces identifiants !')]
|
||||
class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
@ -26,8 +28,8 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
/**
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?array $roles = null;
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
|
||||
/**
|
||||
* @var string The hashed password
|
||||
@ -35,21 +37,24 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
#[ORM\Column]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255,nullable: true)]
|
||||
private ?string $tel = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255,nullable: true)]
|
||||
private ?string $address = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255,nullable: true)]
|
||||
private ?string $mail = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private bool $isVerified = false;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@ -184,6 +189,18 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isVerified(): bool
|
||||
{
|
||||
return $this->isVerified;
|
||||
}
|
||||
|
||||
public function setVerified(bool $isVerified): static
|
||||
{
|
||||
$this->isVerified = $isVerified;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
81
src/Form/RegistrationFormType.php
Normal file
81
src/Form/RegistrationFormType.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\UserApp;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\IsTrue;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class RegistrationFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('nickname', TextType::class, [
|
||||
'label' => 'Utilisateur : ',
|
||||
])
|
||||
->add('firstname', TextType::class, [
|
||||
'label' => 'Prénom : ',
|
||||
'required' => true,
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
]
|
||||
])
|
||||
->add('lastname', TextType::class, [
|
||||
'label' => 'Nom : ',
|
||||
'required' => true,
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
]
|
||||
])
|
||||
->add('mail', EmailType::class, [
|
||||
'label' => 'Email : ',
|
||||
'required' => true,
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
]
|
||||
])
|
||||
// ->add('agreeTerms', CheckboxType::class, [
|
||||
// 'mapped' => false,
|
||||
// 'constraints' => [
|
||||
// new IsTrue([
|
||||
// 'message' => 'Vous devez accepter les conditions d\'utilisation.',
|
||||
// ]),
|
||||
// ],
|
||||
// ])
|
||||
->add('plainPassword', PasswordType::class, [
|
||||
// instead of being set onto the object directly,
|
||||
// this is read and encoded in the controller
|
||||
'mapped' => false,
|
||||
'attr' => ['autocomplete' => 'new-password'],
|
||||
'constraints' => [
|
||||
new NotBlank([
|
||||
'message' => 'Merci d\'entrer votre mot de passe.',
|
||||
]),
|
||||
new Length([
|
||||
'min' => 6,
|
||||
'minMessage' => 'Votre mot de passe doit avoir au moins {{ limit }} caractères',
|
||||
// max length allowed by Symfony for security reasons
|
||||
'max' => 4096,
|
||||
]),
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => UserApp::class,
|
||||
]);
|
||||
}
|
||||
}
|
52
src/Security/EmailVerifier.php
Normal file
52
src/Security/EmailVerifier.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Security;
|
||||
|
||||
use App\Entity\UserApp;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
|
||||
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
|
||||
|
||||
class EmailVerifier
|
||||
{
|
||||
public function __construct(
|
||||
private VerifyEmailHelperInterface $verifyEmailHelper,
|
||||
private MailerInterface $mailer,
|
||||
private EntityManagerInterface $entityManager
|
||||
) {
|
||||
}
|
||||
|
||||
public function sendEmailConfirmation(string $verifyEmailRouteName, UserApp $user, TemplatedEmail $email): void
|
||||
{
|
||||
$signatureComponents = $this->verifyEmailHelper->generateSignature(
|
||||
$verifyEmailRouteName,
|
||||
(string) $user->getId(),
|
||||
(string) $user->getMail()
|
||||
);
|
||||
|
||||
$context = $email->getContext();
|
||||
$context['signedUrl'] = $signatureComponents->getSignedUrl();
|
||||
$context['expiresAtMessageKey'] = $signatureComponents->getExpirationMessageKey();
|
||||
$context['expiresAtMessageData'] = $signatureComponents->getExpirationMessageData();
|
||||
|
||||
$email->context($context);
|
||||
|
||||
$this->mailer->send($email);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws VerifyEmailExceptionInterface
|
||||
*/
|
||||
public function handleEmailConfirmation(Request $request, UserApp $user): void
|
||||
{
|
||||
$this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, (string) $user->getId(), (string) $user->getMail());
|
||||
|
||||
$user->setVerified(true);
|
||||
|
||||
$this->entityManager->persist($user);
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
}
|
@ -14,6 +14,8 @@
|
||||
<h3> {{ ann.company.name }} </h3>
|
||||
<p> {{ ann.description }} </p>
|
||||
------------------------------
|
||||
|
||||
<p> {{ ann.creationDate|format("") }} </p>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
@ -1,17 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
{% block stylesheets %}
|
||||
{% endblock %}
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<title>{% block title %}Job Portal{% endblock %}</title>
|
||||
|
||||
{% block javascripts %}
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
{# Tailwind CSS CDN #}
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
{# FontAwesome & Google Fonts #}
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet"/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"/>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<header class="bg-gray-900 text-white">
|
||||
<div class="container mx-auto flex justify-between items-center py-4 px-6">
|
||||
<div class="flex items-center">
|
||||
<i class="fas fa-briefcase text-2xl mr-2"></i>
|
||||
<span class="text-xl font-bold">HegreSphere</span>
|
||||
</div>
|
||||
<nav class="space-x-6">
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Accueil</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Stages</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">À propos de nous</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Nous contacter</a>
|
||||
</nav>
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full" href="{{ path('app_index') }}">
|
||||
Profil
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{# Block for the specific page content #}
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,297 +1,76 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<title>
|
||||
Job Portal
|
||||
</title>
|
||||
<script src="https://cdn.tailwindcss.com">
|
||||
</script>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet"/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<header class="bg-gray-900 text-white">
|
||||
<div class="container mx-auto flex justify-between items-center py-4 px-6">
|
||||
<div class="flex items-center">
|
||||
<i class="fas fa-briefcase text-2xl mr-2"></i>
|
||||
<span class="text-xl font-bold">HegreSphere</span>
|
||||
</div>
|
||||
<nav class="space-x-6">
|
||||
<a class="hover:text-teal-400" href="#">Accueil</a>
|
||||
<a class="hover:text-teal-400" href="#">Stages</a>
|
||||
<a class="hover:text-teal-400" href="#">À propos de nous</a>
|
||||
<a class="hover:text-teal-400" href="#">Nous contacter</a>
|
||||
</nav>
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full" href="#">
|
||||
Profil
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
<section class="bg-cover bg-center py-20" style="background-image: url('/images/fond_site.png');">
|
||||
{% block title %}Accueil - Job Portal{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="bg-cover bg-center py-20" style="background-image: url('{{ asset('images/fond_site.png') }}');">
|
||||
<div class="container mx-auto text-center text-white">
|
||||
<h1 class="text-4xl md:text-5xl font-bold mb-4">Trouvez votre stage de rêve !</h1>
|
||||
<p class="text-lg mb-8">Connectez les talents aux opportunités : votre clé vers le succès professionnel</p>
|
||||
<div class="bg-white rounded-lg shadow-lg p-6 inline-block">
|
||||
<div class="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4">
|
||||
<label>
|
||||
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Nom de l'entreprise" type="text"/>
|
||||
</label>
|
||||
<label>
|
||||
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Indiquez un endroit" type="text"/>
|
||||
</label>
|
||||
<label>
|
||||
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Sélectionnez une catégorie" type="text"/>
|
||||
</label>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-6 rounded">Trouvez un stage</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-8 mt-8">
|
||||
<div class="text-center">
|
||||
<i class="fas fa-briefcase text-2xl"></i>
|
||||
<p class="mt-2">+850 Stages</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<i class="fas fa-users text-2xl"></i>
|
||||
<p class="mt-2">1500 Candidats</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<i class="fas fa-building text-2xl"></i>
|
||||
<p class="mt-2">+500 Entreprises</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="container mx-auto text-center text-white">
|
||||
<h1 class="text-4xl md:text-5xl font-bold mb-4">
|
||||
Trouvez votre stage de rêve !
|
||||
</h1>
|
||||
<p class="text-lg mb-8">
|
||||
Connectez les talents aux opportunités : votre clé vers le succès professionnel
|
||||
</p>
|
||||
<div class="bg-white rounded-lg shadow-lg p-6 inline-block">
|
||||
<div class="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4">
|
||||
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Nom de l'entreprise" type="text"/>
|
||||
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Indiquez un endroit" type="text"/>
|
||||
<input class="border border-gray-300 rounded py-2 px-4 w-full md:w-auto" placeholder="Selectionnez une categorie" type="text"/>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-6 rounded">
|
||||
Trouvez un stage
|
||||
</button>
|
||||
</div>
|
||||
<section class="container mx-auto py-12">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-2xl font-bold">Propositions de stages </h2>
|
||||
<a class="text-teal-500 hover:underline" href="{{ path('app_announcement_list') }}">Voir tout</a>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-8 mt-8">
|
||||
<div class="text-center">
|
||||
<i class="fas fa-briefcase text-2xl">
|
||||
</i>
|
||||
<p class="mt-2">
|
||||
+850 Stages
|
||||
</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<i class="fas fa-users text-2xl">
|
||||
</i>
|
||||
<p class="mt-2">
|
||||
1500 Candidats
|
||||
</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<i class="fas fa-building text-2xl">
|
||||
</i>
|
||||
<p class="mt-2">
|
||||
+500 Entreprises
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="container mx-auto py-12">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-2xl font-bold">
|
||||
Propositions de stages récentes
|
||||
</h2>
|
||||
<a class="text-teal-500 hover:underline" href="#">
|
||||
Voir tout
|
||||
</a>
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">
|
||||
10 min ago
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">
|
||||
Forward Security Director
|
||||
</h3>
|
||||
<p class="text-gray-600">
|
||||
Bauch, Schuppe and Schulist Co
|
||||
</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1">
|
||||
</i>
|
||||
Hotels & Tourism
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1">
|
||||
</i>
|
||||
Full time
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1">
|
||||
</i>
|
||||
$40000-$42000
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1">
|
||||
</i>
|
||||
New York, USA
|
||||
</span>
|
||||
<div class="space-y-6">
|
||||
{# Loop over recent offers (replace with dynamic data)
|
||||
{% for offer in recent_offers %}
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">{{ offer.time_ago }}</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">{{ offer.title }}</h3>
|
||||
<p class="text-gray-600">{{ offer.company }}</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1"></i> {{ offer.category }}
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1"></i> {{ offer.type }}
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1"></i> {{ offer.salary }}
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1"></i> {{ offer.location }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">Détails de l'offre</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">
|
||||
Détails de l'offre
|
||||
</button>
|
||||
{% endfor %}#}
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">
|
||||
12 min ago
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">
|
||||
Regional Creative Facilitator
|
||||
</h3>
|
||||
<p class="text-gray-600">
|
||||
Wisozk - Becker Co
|
||||
</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1">
|
||||
</i>
|
||||
Media
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1">
|
||||
</i>
|
||||
Part time
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1">
|
||||
</i>
|
||||
$28000-$32000
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1">
|
||||
</i>
|
||||
Los Angeles, USA
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">
|
||||
Détails de l'offre
|
||||
</button>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">
|
||||
15 min ago
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">
|
||||
Internal Integration Planner
|
||||
</h3>
|
||||
<p class="text-gray-600">
|
||||
Metz, Quigley and Feest Inc.
|
||||
</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1">
|
||||
</i>
|
||||
Construction
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1">
|
||||
</i>
|
||||
Full time
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1">
|
||||
</i>
|
||||
$48000-$50000
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1">
|
||||
</i>
|
||||
Texas, USA
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">
|
||||
Détails de l'offre
|
||||
</button>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">
|
||||
26 min ago
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">
|
||||
District Intranet Director
|
||||
</h3>
|
||||
<p class="text-gray-600">
|
||||
VonRueden - Weber Co
|
||||
</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1">
|
||||
</i>
|
||||
Commerce
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1">
|
||||
</i>
|
||||
Full time
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1">
|
||||
</i>
|
||||
$42000-$46000
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1">
|
||||
</i>
|
||||
Florida, USA
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">
|
||||
Détails de l'offre
|
||||
</button>
|
||||
</div>
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">
|
||||
26 min ago
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">
|
||||
Corporate Tactics Facilitator
|
||||
</h3>
|
||||
<p class="text-gray-600">
|
||||
Cormier, Turner and Bailey Inc
|
||||
</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1">
|
||||
</i>
|
||||
Commerce
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1">
|
||||
</i>
|
||||
Full time
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1">
|
||||
</i>
|
||||
$38000-$40000
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1">
|
||||
</i>
|
||||
Boston, USA
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">
|
||||
Détails de l'offre
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
55
templates/registration/register.html.twig
Normal file
55
templates/registration/register.html.twig
Normal file
@ -0,0 +1,55 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Inscription{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="bg-gray-100 flex items-center justify-center min-h-screen">
|
||||
<div class="bg-white p-8 rounded-lg shadow-md w-full max-w-md">
|
||||
<h2 class="text-2xl font-bold text-center mb-2">Inscription</h2>
|
||||
<p class="text-center text-gray-600 mb-6">
|
||||
Déjà inscrit ? <a href="{{ path('app_login') }}" class="text-teal-600 hover:underline">Connectez-vous ici</a>
|
||||
</p>
|
||||
|
||||
{{ form_start(registrationForm, { 'attr': { 'class': 'space-y-4' } }) }}
|
||||
|
||||
<div class="mb-4">
|
||||
{{ form_label(registrationForm.nickname, 'Pseudo', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(registrationForm.nickname, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
{{ form_errors(registrationForm.nickname) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
{{ form_label(registrationForm.firstname, 'Prénom', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(registrationForm.firstname, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
{{ form_errors(registrationForm.firstname) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
{{ form_label(registrationForm.lastname, 'Nom', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(registrationForm.lastname, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
{{ form_errors(registrationForm.lastname) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
{{ form_label(registrationForm.mail, 'Adresse email', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(registrationForm.mail, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
{{ form_errors(registrationForm.mail) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
{{ form_label(registrationForm.plainPassword, 'Mot de passe', {'label_attr': {'class': 'block text-gray-700 mb-2'}}) }}
|
||||
{{ form_widget(registrationForm.plainPassword, {'attr': {'class': 'w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
{{ form_errors(registrationForm.plainPassword) }}
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="bg-teal-600 text-white px-6 py-2 rounded-lg w-full hover:bg-teal-700 focus:outline-none focus:ring-2 focus:ring-teal-500">
|
||||
S'inscrire
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(registrationForm) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
41
templates/security/login.html.twig
Normal file
41
templates/security/login.html.twig
Normal file
@ -0,0 +1,41 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Connexion{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<form method="post">
|
||||
{% if error %}
|
||||
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.user %}
|
||||
<div class="mb-3">
|
||||
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="h3 mb-3 font-weight-normal">Connexion à votre compte</h1>
|
||||
<label for="username">Nom d'utilisateur</label>
|
||||
<input type="text" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="username" required autofocus>
|
||||
<label for="password">Mot de passe</label>
|
||||
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
|
||||
|
||||
<input type="hidden" name="_csrf_token"
|
||||
value="{{ csrf_token('authenticate') }}"
|
||||
>
|
||||
|
||||
{#
|
||||
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
||||
See https://symfony.com/doc/current/security/remember_me.html
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<input type="checkbox" name="_remember_me" id="_remember_me">
|
||||
<label for="_remember_me">Remember me</label>
|
||||
</div>
|
||||
#}
|
||||
|
||||
<button class="btn btn-lg btn-primary" type="submit">
|
||||
Connexion
|
||||
</button>
|
||||
</form>
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user