Skip to content
Snippets Groups Projects
Commit 576ee020 authored by AKIFI NAIL's avatar AKIFI NAIL
Browse files

1day

parent bc02f606
Branches polish-level
No related merge requests found
......@@ -36,6 +36,7 @@ security:
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
- { path: '^/produits/admin/', roles: ROLE_ADMIN }
- { path: '^/user/admin/', roles: ROLE_ADMIN }
when@test:
......
This diff is collapsed.
import "./imp.js";
\ No newline at end of file
import "./imp.js";
......@@ -972,3 +972,7 @@ aside article{
.edti a:hover{
color: #3b82f6 !important;
}
i{
font-size: 1.5rem;
}
\ No newline at end of file
.toast-container {
position: fixed;
z-index: 999999;
pointer-events: none;
line-height: normal;
line-height: initial;
-webkit-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
/* the wrapper where the toast messages appends: */
.toast-container .toast-wrapper {
position: relative;
padding: 0.5em;
}
/* the class that is assigned to the sound player. */
/* normally, this is a hidden wildcard: */
.toast-container .toast-soundplayer {
display: none;
visibility: hidden;
}
/**
* Toast messages styles:
* -------------------------------------------------- */
/* each toast message gets this style: */
.toast {
position: relative;
padding: 16px;
border: 1px solid;
margin: 0.5em 0em;
border-left: 6px solid transparent;
border-radius: 2px;
pointer-events: none;
-webkit-transition: all 0.32s ease-in-out;
-o-transition: all 0.32s ease-in-out;
transition: all 0.32s ease-in-out;
-webkit-box-shadow: 0px 0px 9px rgba(0, 0, 0, .25);
box-shadow: 0px 0px 9px rgba(0, 0, 0, .25);
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
/* informational toast class: */
.toast--info {
color: #31708f;
background-color: #eaf2fa;
border-color: #91c5f2;
}
/* successful toast class: */
.toast--success {
color: #3c763d;
background-color: #e9ffd9;
border-color: #a6ca8a;
}
/* warning toast class: */
.toast--warning {
color: #8a6d3b;
background-color: #fff8c4;
border-color: #f2c779;
}
/* error toast class: */
.toast--error {
color: #a94442;
background-color: #ffecec;
border-color: #f5aca6;
}
/* this class is assigned to each toast message when autoClose
* plugin option is set to BOOLEAN false. */
/* Normally, this is a pointer events handler:*/
.toast.close-on-click {
cursor: pointer;
pointer-events: auto;
}
/**
* Progress bar styles:
* ------------------------------------------------------------------------- */
/* each progress bar gets this style: */
.toast-progressbar {
position: absolute;
height: 4px;
width: 0%;
left: 0px;
bottom: 0px;
opacity: 0.5;
-webkit-transition: width 0s ease;
-o-transition: width 0s ease;
transition: width 0s ease;
}
/* progress bar color for each toast type: */
.toast-progressbar--info {
background-color: #91c5f2;
}
.toast-progressbar--success {
background-color: #a6ca8a;
}
.toast-progressbar--warning {
background-color: #f2c779;
}
.toast-progressbar--error {
background-color: #f5aca6;
}
/**
* Available toast transitions:
* ------------------------------------------------------------------------- */
/* TRANSITION 01 - a [fade] transition (DEFAULT TRANSITION): */
.toast-container--fade {
right: 0;
bottom: 0;
}
.toast-container--fade .toast-wrapper {
display: inline-block;
}
.toast.fade-init {
opacity: 0;
}
.toast.fade-show {
opacity: 1;
}
.toast.fade-hide {
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 02 - a [slideLeftFade] transition: */
.toast-container--slideLeftFade {
right: 0;
bottom: 0;
}
.toast-container--slideLeftFade .toast-wrapper {
display: inline-block;
}
.toast.slideLeftFade-init {
right: -100%;
opacity: 0;
}
.toast.slideLeftFade-show {
right: 0%;
opacity: 1;
}
.toast.slideLeftFade-hide {
right: 100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 03 - a [slideLeftRightFade] transition: */
.toast-container--slideLeftRightFade {
right: 0;
bottom: 0;
}
.toast-container--slideLeftRightFade .toast-wrapper {
display: inline-block;
}
.toast.slideLeftRightFade-init {
right: -100%;
opacity: 0;
}
.toast.slideLeftRightFade-show {
right: 0%;
opacity: 1;
}
.toast.slideLeftRightFade-hide {
right: -100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 04 - a [slideRightFade] transition: */
.toast-container--slideRightFade {
right: 0;
bottom: 0;
}
.toast-container--slideRightFade .toast-wrapper {
display: inline-block;
}
.toast.slideRightFade-init {
left: -100%;
opacity: 0;
}
.toast.slideRightFade-show {
left: 0%;
opacity: 1;
}
.toast.slideRightFade-hide {
left: 100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 05 - a [slideRightLeftFade] transition: */
.toast-container--slideRightLeftFade {
right: 0;
bottom: 0;
}
.toast-container--slideRightLeftFade .toast-wrapper {
display: inline-block;
}
.toast.slideRightLeftFade-init {
left: -100%;
opacity: 0;
}
.toast.slideRightLeftFade-show {
left: 0%;
opacity: 1;
}
.toast.slideRightLeftFade-hide {
left: -100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 06 - a [slideUpFade] transition: */
.toast-container--slideUpFade {
top: 0;
right: 0;
bottom: 0;
}
.toast-container--slideUpFade .toast-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.toast.slideUpFade-init {
bottom: -100%;
opacity: 0;
}
.toast.slideUpFade-show {
bottom: 0%;
opacity: 1;
}
.toast.slideUpFade-hide {
bottom: 100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 07 - a [slideUpDownFade] transition: */
.toast-container--slideUpDownFade {
top: 0;
right: 0;
bottom: 0;
}
.toast-container--slideUpDownFade .toast-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.toast.slideUpDownFade-init {
bottom: -100%;
opacity: 0;
}
.toast.slideUpDownFade-show {
bottom: 0%;
opacity: 1;
}
.toast.slideUpDownFade-hide {
bottom: -100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 08 - a [slideDownFade] transition: */
.toast-container--slideDownFade {
top: 0;
right: 0;
bottom: 0;
}
.toast-container--slideDownFade .toast-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.toast.slideDownFade-init {
top: -100%;
opacity: 0;
}
.toast.slideDownFade-show {
top: 0%;
opacity: 1;
}
.toast.slideDownFade-hide {
top: 100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 09 - a [slideDownUpFade] transition: */
.toast-container--slideDownUpFade {
top: 0;
right: 0;
bottom: 0;
}
.toast-container--slideDownUpFade .toast-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.toast.slideDownUpFade-init {
top: -100%;
opacity: 0;
}
.toast.slideDownUpFade-show {
top: 0%;
opacity: 1;
}
.toast.slideDownUpFade-hide {
top: -100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 10 - a [pinItUp] transition: */
.toast-container--pinItUp {
top: 0;
right: 0;
bottom: 0;
}
.toast-container--pinItUp .toast-wrapper {
display: inline-block;
height: 25px;
float: right;
}
.toast.pinItUp-init {
bottom: -100%;
opacity: 0;
}
.toast.pinItUp-show {
bottom: 0%;
opacity: 1;
}
.toast.pinItUp-hide {
bottom: 100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
/* TRANSITION 11 - a [pinItDown] transition: */
.toast-container--pinItDown {
top: 0;
right: 0;
bottom: 0;
}
.toast-container--pinItDown .toast-wrapper {
display: inline-block;
height: 25px;
float: right;
}
.toast.pinItDown-init {
top: -100%;
opacity: 0;
}
.toast.pinItDown-show {
top: 0%;
opacity: 1;
}
.toast.pinItDown-hide {
top: 100%;
opacity: 0;
}
/* ------------------------------------------------------------------------- */
\ No newline at end of file
......@@ -52,6 +52,7 @@ class ProduitsController extends AbstractController
// Enregistrement final (si aucun fichier n'est envoyé ou pour mettre à jour le nom du ficher)
$entityManager->persist($produit);
$entityManager->flush();
$this->addFlash('success2', 'Le produit a été crée avec succès.');
return $this->redirectToRoute('app_produits_index', [], Response::HTTP_SEE_OTHER);
}
......@@ -92,6 +93,7 @@ class ProduitsController extends AbstractController
}
$entityManager->persist($produit);
$entityManager->flush();
$this->addFlash('success', 'Le produit a été mis à jour avec succès.');
return $this->redirectToRoute('app_produits_index', [], Response::HTTP_SEE_OTHER);
}
......@@ -116,6 +118,7 @@ class ProduitsController extends AbstractController
// Supprime l'entité
$entityManager->remove($produit);
$entityManager->flush();
$this->addFlash('success_delete', 'Le produit a été supprimer avec succès.');
}
return $this->redirectToRoute('app_produits_index', [], Response::HTTP_SEE_OTHER);
......
......@@ -15,7 +15,7 @@ use Symfony\Component\Routing\Attribute\Route;
#[Route('/user')]
class UserController extends AbstractController
{
#[Route('/', name: 'app_user_index', methods: ['GET'])]
#[Route('/admin/', name: 'app_user_index', methods: ['GET'])]
public function index(UserRepository $userRepository): Response
{
return $this->render('user/index.html.twig', [
......@@ -43,8 +43,9 @@ class UserController extends AbstractController
// Enregistrer les informations
$entityManager->persist($user);
$entityManager->flush();
$this->addFlash('success_create_account', 'le compte a été crée avec succès.');
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
return $this->redirectToRoute('app_login', [], Response::HTTP_SEE_OTHER);
}
return $this->render('user/new.html.twig', [
......
......@@ -8,6 +8,7 @@
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('styles/utils.css') }}">
<link rel="stylesheet" href="{{ asset('styles/styles.css') }}">
<link rel="stylesheet" href="{{ asset('styles/toast.css') }}">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
{% endblock %}
......@@ -30,19 +31,23 @@
<a href="/" >Accueil</a>
<a href="/produits" >Boutique</a>
<a href="https://in.linkedin.com/in/jonesvinothjoseph" >Contact</a>
{{ dump(app.user) }}
{% if app.user %}
<a href="{{ path('app_logout') }}" >Se deconnecter</a>
<a href="{{ path('app_user_show', {'id': app.user.id}) }}" ><i class="bi bi-person"></i></a>
<a href="{{ path('app_user_show', {'id': app.user.id}) }}" ><i class="bi bi-basket2"></i></a>
{% else %}
<a href="{{ path('app_login') }}" >Se connecter</a>
<a href="{{ path('app_user_new') }}" >Crée un compte</a>
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ path('app_user_index') }}" >Admin</a>
{% endif %}
<a href="{{ path('app_user_index') }}" >Crée</a>
</div>
</div>
{% block javascripts %}
{# {% block importmap %}{{ importmap('app') }}{% endblock %}#}
<script src="{{ asset('notif.js') }}" defer></script>
{% endblock %}
......
......@@ -10,6 +10,40 @@
{% endif %}
{% if app.flashes('success') %}
<script>
document.addEventListener('DOMContentLoaded', function() {
// Création d'une nouvelle instance de Toasty
var myToasty = new Toasty();
// Afficher un toast de succès
myToasty.success( "Le produit a été mis à jour avec succès.", 4000);
});
</script>
{% endif %}
{% if app.flashes('success2') %}
<script>
document.addEventListener('DOMContentLoaded', function() {
// Création d'une nouvelle instance de Toasty
var myToasty = new Toasty();
// Afficher un toast de succès
myToasty.success( "Le produit a été crée avec succès.", 4000);
});
</script>
{% endif %}
{% if app.flashes('success_delete') %}
<script>
document.addEventListener('DOMContentLoaded', function() {
// Création d'une nouvelle instance de Toasty
var myToasty = new Toasty();
// Afficher un toast de succès
myToasty.success( "Le produit a bien été supprimé.", 4000);
});
</script>
{% endif %}
<main>
<aside>
<h2 class="fs-4">chaussures : ({{ produits|length }})</h2>
......@@ -78,7 +112,6 @@
<section class="row gap-big jc-c warp shopbase">
{% for produit in produits %}
{{ dump(produit) }}
<article class="row article-content ">
<div class="article-left" data-color="{{ produit.couleur.nom }}">
......
......@@ -13,6 +13,15 @@
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ path('app_logout') }}">Logout</a>
</div>
{% endif %}
{% if app.flashes('success_create_account') %}
<script>
document.addEventListener('DOMContentLoaded', function() {
var myToasty = new Toasty();
myToasty.success( "Le compte à bien été crée.", 4000);
});
</script>
{% endif %}
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<label for="username">Email</label>
......@@ -38,5 +47,6 @@
<button class="btn btn-lg btn-primary" type="submit">
Sign in
</button>
<a href="{{ path('app_user_new') }}" >Crée un compte</a>
</form>
{% endblock %}
......@@ -7,5 +7,5 @@
{{ include('user/_form.html.twig') }}
<a href="{{ path('app_user_index') }}">back to list</a>
<a href="{{ path('app_login') }}" >Se connecter</a>
{% endblock %}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment