feat: rework admin portal with pricing breakdown and document management
- Added pricing snapshot columns to the leads table: daily_subtotal, weekend_subtotal, subtotal_eur, vat_eur, total_eur, deposit_eur, total_days, weekday_count, weekend_day_count. - Updated create_lead RPC to accept and store new pricing parameters. - Enhanced frontend app.js to compute and send pricing details during lead creation. - Introduced new UI elements in admin.html for displaying pricing and documents in a tabbed dialog. - Updated i18n.js with new translation keys for pricing and document management. - Improved styles in styles.css for new dialog components and pricing cards. - Added migration script 06-admin-pricing-documents.sql for database schema changes.
This commit is contained in:
+109
-6
@@ -1034,18 +1034,21 @@ input:checked + .toggle-slider:before {
|
||||
.btn.danger:hover { background: #8f3535; }
|
||||
|
||||
/* Dialog */
|
||||
dialog#leadDialog {
|
||||
dialog#leadDialog,
|
||||
dialog#customerDialog {
|
||||
border: 1px solid var(--line); border-radius: var(--radius);
|
||||
background: var(--bg-card); color: var(--text);
|
||||
padding: 0; max-width: 580px; width: 92%;
|
||||
padding: 0; max-width: 640px; width: 94%;
|
||||
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
|
||||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||||
}
|
||||
dialog#leadDialog[open] {
|
||||
dialog#leadDialog[open],
|
||||
dialog#customerDialog[open] {
|
||||
animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
}
|
||||
dialog#leadDialog::backdrop {
|
||||
background: rgba(0,0,0,0.7);
|
||||
dialog#leadDialog::backdrop,
|
||||
dialog#customerDialog::backdrop {
|
||||
background: rgba(0,0,0,0.7);
|
||||
backdrop-filter: blur(4px);
|
||||
animation: fadeIn 0.3s ease forwards;
|
||||
}
|
||||
@@ -1071,10 +1074,110 @@ dialog#leadDialog::backdrop {
|
||||
color: var(--text);
|
||||
}
|
||||
.dialog-body { padding: 1.6rem; }
|
||||
dl.kv { display: grid; grid-template-columns: 120px 1fr; gap: 0.6rem 1rem; margin: 0; font-size: 0.9rem; }
|
||||
dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0.6rem 1rem; margin: 0; font-size: 0.9rem; }
|
||||
dl.kv dt { color: var(--muted); font-weight: 500; }
|
||||
dl.kv dd { margin: 0; color: var(--text); }
|
||||
|
||||
/* Dialog tabs */
|
||||
.dialog-tabs {
|
||||
display: flex; gap: 0.2rem;
|
||||
padding: 0 1.6rem;
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: rgba(255,255,255,0.01);
|
||||
overflow-x: auto;
|
||||
}
|
||||
.dialog-tabs button {
|
||||
background: transparent; border: none;
|
||||
color: var(--muted); padding: 0.7rem 1rem;
|
||||
font-size: 0.85rem; font-family: "Inter", sans-serif;
|
||||
cursor: pointer; border-bottom: 2px solid transparent;
|
||||
transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.dialog-tabs button:hover {
|
||||
color: var(--text); background: rgba(255,255,255,0.03);
|
||||
}
|
||||
.dialog-tabs button.active {
|
||||
color: var(--accent-strong); border-bottom-color: var(--accent);
|
||||
background: rgba(196, 138, 66, 0.05);
|
||||
}
|
||||
|
||||
/* Dialog footer */
|
||||
.dialog-footer {
|
||||
padding: 1rem 1.6rem;
|
||||
border-top: 1px solid var(--line);
|
||||
background: rgba(255,255,255,0.01);
|
||||
}
|
||||
|
||||
/* Pricing card */
|
||||
.pricing-card {
|
||||
background: var(--bg-elev);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 1.2rem 1.4rem;
|
||||
}
|
||||
.price-row {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 0.5rem 0; font-size: 0.92rem;
|
||||
}
|
||||
.price-row.total {
|
||||
font-weight: 700; font-size: 1.15rem; color: var(--accent-strong);
|
||||
border-top: 2px solid var(--accent);
|
||||
padding-top: 0.8rem; margin-top: 0.4rem;
|
||||
}
|
||||
.price-row.divider {
|
||||
border-top: 1px solid var(--line);
|
||||
padding-top: 0.6rem; margin-top: 0.2rem;
|
||||
}
|
||||
.price-row.muted { color: var(--muted); font-size: 0.85rem; }
|
||||
|
||||
/* Document items */
|
||||
.doc-item {
|
||||
display: flex; justify-content: space-between; align-items: center;
|
||||
padding: 0.8rem 1rem;
|
||||
background: var(--bg-elev);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 10px;
|
||||
margin-bottom: 0.6rem;
|
||||
transition: border-color 0.2s ease;
|
||||
}
|
||||
.doc-item:hover {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
.doc-info {
|
||||
display: flex; align-items: center; gap: 0.8rem; min-width: 0;
|
||||
}
|
||||
.doc-icon {
|
||||
font-size: 1.4rem; flex-shrink: 0;
|
||||
}
|
||||
.doc-info strong {
|
||||
display: block; font-size: 0.9rem; word-break: break-all;
|
||||
}
|
||||
.doc-info .muted {
|
||||
font-size: 0.8rem; margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
/* ---------------- Responsive ---------------- */
|
||||
@media (max-width: 900px) {
|
||||
.filters, .booking-form, .admin-grid, .why-grid { grid-template-columns: 1fr; }
|
||||
.footer-grid { grid-template-columns: 1fr 1fr; }
|
||||
.section-head { flex-direction: column; align-items: flex-start; }
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.main-nav { display: none; position: absolute; right: 1rem; top: 100%; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--line); padding: 1rem; border-radius: var(--radius); }
|
||||
.main-nav.open { display: flex; }
|
||||
.menu-toggle { display: inline-flex; }
|
||||
.footer-grid { grid-template-columns: 1fr; }
|
||||
.admin-form .row2, .admin-form .row3 { grid-template-columns: 1fr; }
|
||||
dl.kv { grid-template-columns: 100px 1fr; }
|
||||
.dialog-tabs { padding: 0 0.8rem; }
|
||||
.dialog-tabs button { padding: 0.6rem 0.7rem; font-size: 0.8rem; }
|
||||
.dialog-body { padding: 1rem; }
|
||||
.dialog-head { padding: 1rem 1.2rem; }
|
||||
.dialog-footer { padding: 0.8rem 1.2rem; }
|
||||
}
|
||||
|
||||
/* ---------------- Responsive ---------------- */
|
||||
@media (max-width: 900px) {
|
||||
.filters, .booking-form, .admin-grid, .why-grid { grid-template-columns: 1fr; }
|
||||
|
||||
Reference in New Issue
Block a user