This commit is contained in:
2025-12-24 16:01:18 +01:00
parent 9beb6e1b43
commit e615156347
9 changed files with 531 additions and 16 deletions
+221
View File
@@ -0,0 +1,221 @@
/* Christmas list : vue synthétique avec bouton + et menu flottant */
.pf-christmas-list h1 {
margin-bottom: 4px;
}
.pf-christmas-list p {
margin-top: 0;
margin-bottom: 12px;
font-size: 13px;
color: #4b5563;
}
/* Grille principale */
.cl-grid-wrapper {
overflow-x: auto; /* sécurité pour petits écrans */
}
.cl-grid-table {
font-size: 11px;
}
/* En-têtes */
.cl-grid-table thead th {
padding: 6px 4px;
}
.cl-child-header {
text-align: center;
font-weight: 600;
white-space: nowrap;
}
.cl-header-adult {
text-align: left;
white-space: nowrap;
}
.cl-header-occ {
text-align: center;
font-weight: 500;
color: #627d98;
}
/* Colonne adulte */
.cl-adult-cell {
font-weight: 600;
white-space: nowrap;
padding: 8px 6px;
}
/* Cellules cadeau */
.cl-gift-cell {
min-width: 120px;
vertical-align: top;
padding: 6px 4px;
}
/* Contenu de la cellule : colonne verticale */
.cl-gift-cell-content {
display: flex;
flex-direction: column;
gap: 4px;
}
/* Liste des cadeaux : alignée à gauche */
.cl-gift-list {
list-style: none;
margin: 0;
padding: 0;
text-align: left;
}
.cl-gift-list li {
margin-bottom: 2px;
}
/* Montant par cadeau */
.cl-gift-amount {
font-size: 10px;
color: #627d98;
margin-left: 2px;
}
/* Cellule vide */
.cl-empty {
display: inline-block;
margin-bottom: 2px;
font-size: 11px;
color: #9fb3c8;
}
/* Ligne Total + bouton + */
.cl-total-and-add {
display: flex;
align-items: center;
justify-content: space-between; /* Total à gauche, + à droite */
gap: 4px;
margin-top: 2px;
}
/* Texte Total */
.cl-gift-total {
font-size: 10px;
font-weight: 600;
color: #243b53;
}
/* Bouton + */
.cl-add-btn {
width: 20px;
height: 20px;
border-radius: 50%;
border: 1px solid #d9e2ec;
background: #f0f4f8;
color: #243b53;
font-size: 12px;
line-height: 18px;
text-align: center;
padding: 0;
cursor: pointer;
}
.cl-add-btn:hover {
background: #d9e2ec;
}
/* Menu d'ajout (caché par défaut) */
.cl-add-menu {
display: none;
margin-top: 4px;
padding: 6px;
border-radius: 6px;
border: 1px solid #d9e2ec;
background: #f8fafc;
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
/* Classe pour afficher le menu */
.cl-add-menu--open {
display: block;
}
/* Formulaire dans le menu */
.cl-gift-form {
display: flex;
flex-direction: column;
gap: 4px;
}
/* Ligne du formulaire (lien + montant) */
.cl-gift-form-row {
display: flex;
gap: 4px;
}
/* Champs du formulaire */
.cl-gift-form input[type="text"],
.cl-gift-form input[type="url"],
.cl-gift-form input[type="number"] {
font-size: 10px;
padding: 2px 4px;
border-radius: 4px;
border: 1px solid #d9e2ec;
}
.cl-gift-form input[type="text"] {
width: 100%;
}
.cl-gift-form input[type="url"] {
flex: 1 1 auto;
}
.cl-gift-form input[type="number"] {
width: 60px;
}
/* Boutons OK / Cancel */
.cl-gift-form-actions {
display: flex;
justify-content: flex-end;
gap: 4px;
margin-top: 2px;
}
.cl-gift-form-actions button {
font-size: 10px;
padding: 2px 6px;
border-radius: 4px;
border: 1px solid #d9e2ec;
background: #f0f4f8;
cursor: pointer;
}
.cl-gift-form-actions button:hover {
background: #d9e2ec;
}
.cl-ok-btn {
font-weight: 600;
color: #1f2933;
}
.cl-cancel-btn {
color: #9fb3c8;
}
/* Récap global en bas */
.cl-budget-wrapper {
margin-top: 4px;
}
.cl-budget-wrapper .pf-table {
font-size: 11px;
}
.cl-budget-wrapper .pf-table th,
.cl-budget-wrapper .pf-table td {
padding: 4px 4px;
}
+38
View File
@@ -0,0 +1,38 @@
<?php
require __DIR__ . '/../../includes/auth.php';
require_login('/christmas-list.php');
require __DIR__ . '/../../includes/db.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$year = (int)($_POST['year'] ?? date('Y'));
$adult_name = trim($_POST['adult_name'] ?? '');
$child_name = trim($_POST['child_name'] ?? '');
$occasion = trim($_POST['occasion'] ?? ''); // TIO / NADAL / REIS
$gift_desc = trim($_POST['gift_description'] ?? '');
$product_link = trim($_POST['product_link'] ?? '');
$amount = $_POST['amount'] !== '' ? (float)$_POST['amount'] : 0.0;
if ($adult_name && $child_name && $occasion && $gift_desc) {
$stmt = $pdo->prepare("
INSERT INTO pf_christmas_gifts
(year, adult_name, child_name, occasion, gift_description, product_link, amount)
VALUES
(:year, :adult_name, :child_name, :occasion, :gift_description, :product_link, :amount)
");
$stmt->execute([
'year' => $year,
'adult_name' => $adult_name,
'child_name' => $child_name,
'occasion' => $occasion,
'gift_description'=> $gift_desc,
'product_link' => $product_link ?: null,
'amount' => $amount,
]);
}
}
// Retour à la page Christmas list
header('Location: /christmas-list.php');
exit;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 KiB

+27 -4
View File
@@ -1,12 +1,15 @@
/* === HOME : fond et overlay === */
/* Fond image + overlay uniquement pour la home */
/* Fond image uniquement pour la home */
body.pf-home {
position: relative;
background-image: url("/modules/home/assets/img/background.jpg");
background-size: cover;
background-position: top center;
background-position: center center;
background-repeat: no-repeat;
/* Texte global plutôt clair sur la home (sur l'image) */
color: #f9fafb;
}
/* Header translucide par-dessus l'image sur la home */
@@ -30,6 +33,11 @@ body.pf-home > * {
z-index: 0;
}
/* Descendre légèrement le contenu sous le header sur la home */
body.pf-home .pf-main {
padding-top: 60px; /* au lieu de 24px défini dans global.css */
}
/* === HOME / MODULES CARDS === */
/* Container des cartes de modules */
@@ -103,11 +111,11 @@ body.pf-home > * {
.pf-user-info {
margin-top: 12px;
font-size: 13px;
color: #4b5563;
color: #f9fafb; /* lisible sur le fond */
}
.pf-user-info a {
color: #c81e1e;
color: #ffb4b4;
text-decoration: none;
font-weight: 500;
}
@@ -115,3 +123,18 @@ body.pf-home > * {
.pf-user-info a:hover {
text-decoration: underline;
}
/* Dans les cards (fond clair) : texte foncé */
body.pf-home .pf-card,
body.pf-home .pf-section--panel {
color: #222;
}
/* Sassurer que les titres / textes intro sont bien à gauche et lisibles */
body.pf-home h1,
body.pf-home .pf-container > p,
body.pf-home .pf-user-info,
body.pf-home .pf-section > h2 {
text-align: left;
color: #f9fafb;
}