Enhance admin dashboard with block day functionality, improve appointment details, and update footer animations

- Added a section in the admin dashboard for blocking calendar days with a form to submit block dates and reasons.
- Implemented a list of blocked days with the ability to unblock them.
- Enhanced appointment details to include meeting type and location information.
- Updated styles for blocked days in the appointment calendar.
- Improved footer design with animations and responsive adjustments.
- Removed unused license transfer forms from admin and user license templates.
- Changed database name references from 'Inventarsystem' to 'Invario_Website' in user management functions.
This commit is contained in:
2026-03-24 16:18:39 +01:00
parent 7e45cec5f8
commit 40db9e9576
8 changed files with 704 additions and 313 deletions
+111
View File
@@ -48,6 +48,76 @@
margin-bottom: 0.8rem;
}
.block-days-section {
margin-bottom: 1.2rem;
padding: 1rem;
border: 1px solid #d8e3ec;
border-radius: 12px;
background: #f9fbfd;
}
.block-days-section h3 {
margin: 0 0 0.6rem;
color: #143a55;
font-size: 1.05rem;
}
.block-form {
display: grid;
grid-template-columns: 180px 1fr auto;
gap: 0.5rem;
margin-bottom: 0.8rem;
}
.block-form input {
width: 100%;
border: 1px solid #c4d4e0;
border-radius: 8px;
padding: 0.45rem 0.55rem;
font: inherit;
}
.block-btn,
.unblock-btn {
border: none;
border-radius: 8px;
padding: 0.45rem 0.65rem;
font-weight: 700;
cursor: pointer;
}
.block-btn {
color: #ffffff;
background: linear-gradient(120deg, #0b5b89 0%, #0b4262 100%);
}
.blocked-list {
display: grid;
gap: 0.45rem;
}
.blocked-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.6rem;
border: 1px solid #d5dee6;
border-radius: 9px;
padding: 0.5rem 0.65rem;
background: #ffffff;
}
.blocked-item p {
margin: 0;
font-size: 0.88rem;
}
.unblock-btn {
color: #7e2d2d;
background: #fff3f3;
border: 1px solid #e8b8b8;
}
.appointment-card {
border: 1px solid #d8e3ec;
border-radius: 12px;
@@ -141,6 +211,10 @@
.admin-grid {
grid-template-columns: 1fr 1fr;
}
.block-form {
grid-template-columns: 1fr;
}
}
@media (max-width: 600px) {
@@ -175,12 +249,49 @@
<section class="appointments-section">
<h2>Terminanfragen verwalten</h2>
<div class="block-days-section">
<h3>Kalender-Tage sperren</h3>
<form method="POST" action="{{ url_for('admin_block_day') }}" class="block-form">
<input type="hidden" name="action" value="add">
<input type="date" name="block_date" required>
<input type="text" name="reason" placeholder="Grund (optional)">
<button type="submit" class="block-btn">Tag sperren</button>
</form>
<div class="blocked-list">
{% if blocked_days %}
{% for blocked in blocked_days %}
<div class="blocked-item">
<p>
<strong>{{ blocked.date }}</strong>
{% if blocked.reason %}
- {{ blocked.reason }}
{% endif %}
</p>
<form method="POST" action="{{ url_for('admin_block_day') }}">
<input type="hidden" name="action" value="remove">
<input type="hidden" name="block_date" value="{{ blocked.date }}">
<button type="submit" class="unblock-btn">Entsperren</button>
</form>
</div>
{% endfor %}
{% else %}
<p>Aktuell sind keine Tage gesperrt.</p>
{% endif %}
</div>
</div>
{% if appointments %}
{% for appointment in appointments %}
<article class="appointment-card">
<div class="appointment-info">
<strong>{{ appointment.display_name }} - {{ appointment.subject }}</strong>
<p><strong>Datum:</strong> {{ appointment.date }} um {{ appointment.time }}</p>
<p><strong>Terminart:</strong> {{ appointment.meeting_label or ('Vor Ort' if appointment.meeting_type == 'vor_ort' else 'Digital') }}</p>
{% if appointment.location_name %}
<p><strong>Ort:</strong> {{ appointment.location_name }}</p>
{% endif %}
{% if appointment.location_maps_url %}
<p><strong>Maps:</strong> <a href="{{ appointment.location_maps_url }}" target="_blank" rel="noopener noreferrer">Link öffnen</a></p>
{% endif %}
<p><strong>Angefragt:</strong> {{ appointment.created_at[:10] }}</p>
{% if appointment.note %}
<p><strong>Notiz:</strong> {{ appointment.note }}</p>
-13
View File
@@ -45,19 +45,6 @@
<input type="text" name="valid_until" value="{{ item.valid_until }}" placeholder="Gültig bis">
<button type="submit">Aktualisieren</button>
</form>
<form method="post" class="inline-form" style="margin-top:0.45rem;">
<input type="hidden" name="action" value="transfer">
<input type="hidden" name="license_id" value="{{ item.id }}">
<select name="target_username" required>
<option value="">Lizenz weitergeben an...</option>
{% for user in users %}
{% if user.username != item.username %}
<option value="{{ user.username }}">{{ user.username }} ({{ user.display_name }})</option>
{% endif %}
{% endfor %}
</select>
<button type="submit">Weitergeben</button>
</form>
<form method="post">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="license_id" value="{{ item.id }}">
+103 -2
View File
@@ -94,6 +94,18 @@
color: #ffffff;
}
.day.blocked {
background: #f3f4f7;
color: #8b96a1;
border-color: #d2d8de;
cursor: not-allowed;
}
.day.blocked:hover {
transform: none;
border-color: #d2d8de;
}
.booking-form h2,
.appointment-list h2 {
font-size: 1.2rem;
@@ -124,7 +136,8 @@
}
.field input,
.field textarea {
.field textarea,
.field select {
width: 100%;
border: 1px solid #c4d4e0;
border-radius: 10px;
@@ -180,6 +193,41 @@
background: #eef4f8;
}
.meeting-note {
margin: 0 0 0.75rem;
color: #27526d;
font-weight: 600;
}
.helper-line {
margin-top: 0.35rem;
font-size: 0.84rem;
color: #4f6f83;
}
.maps-tools {
display: flex;
gap: 0.45rem;
margin-top: 0.45rem;
}
.maps-btn {
border: 1px solid #8fb1c8;
background: #f6fbff;
color: #1d5575;
border-radius: 999px;
padding: 0.35rem 0.7rem;
font-size: 0.84rem;
font-weight: 700;
cursor: pointer;
}
.entry-meta {
margin-top: 0.2rem;
color: #345e78;
font-size: 0.9rem;
}
@media (max-width: 960px) {
.appointments-grid {
grid-template-columns: 1fr;
@@ -216,10 +264,15 @@
<button type="button" class="day empty" disabled></button>
{% else %}
{% set day_iso = "%04d-%02d-%02d"|format(year, month, day) %}
{% set blocked_day = blocked_day_map.get(day_iso) %}
<button
type="button"
class="day {% if day_iso == today_iso %}today{% endif %}"
class="day {% if day_iso == today_iso %}today{% endif %} {% if blocked_day %}blocked{% endif %}"
data-date="{{ day_iso }}"
{% if blocked_day %}
disabled
title="Gesperrt{% if blocked_day.reason %}: {{ blocked_day.reason }}{% endif %}"
{% endif %}
>
{{ day }}
</button>
@@ -231,6 +284,7 @@
<aside class="panel booking-form">
<h2>Termin anfragen</h2>
<p class="meeting-note">Persoenliches Gespraechstermin: Digital oder Vor Ort.</p>
<span class="selected-date-badge" id="selectedDateBadge">Kein Datum gewählt</span>
<form method="POST" action="{{ url_for('appointments', month=month, year=year) }}">
<input type="hidden" id="selectedDateInput" name="selected_date" required>
@@ -238,10 +292,26 @@
<label for="appointment_time">Uhrzeit</label>
<input id="appointment_time" name="appointment_time" type="time" required>
</div>
<div class="field">
<label for="meeting_type">Terminart</label>
<select id="meeting_type" name="meeting_type" required>
<option value="digital">Digital</option>
<option value="vor_ort">Vor Ort</option>
</select>
</div>
<div class="field">
<label for="subject">Betreff</label>
<input id="subject" name="subject" type="text" placeholder="z. B. Projekt Kickoff" required>
</div>
<div class="field" id="locationField" style="display: none;">
<label for="location_name">Ort (bei Vor-Ort Pflicht)</label>
<input id="location_name" name="location_name" type="text" placeholder="Adresse oder Ort">
<div class="maps-tools">
<button type="button" id="mapsSearchBtn" class="maps-btn">In Google Maps suchen</button>
</div>
<div class="helper-line">Optional: Google-Maps-Link eintragen.</div>
<input id="location_maps_url" name="location_maps_url" type="url" placeholder="https://maps.google.com/..." style="margin-top: 0.4rem;">
</div>
<div class="field">
<label for="note">Notiz (optional)</label>
<textarea id="note" name="note" placeholder="Kurzbeschreibung der Anfrage"></textarea>
@@ -260,6 +330,13 @@
{% if item.note %}
<p>{{ item.note }}</p>
{% endif %}
<p class="entry-meta"><strong>Terminart:</strong> {{ item.meeting_label or ('Vor Ort' if item.meeting_type == 'vor_ort' else 'Digital') }}</p>
{% if item.location_name %}
<p class="entry-meta"><strong>Ort:</strong> {{ item.location_name }}</p>
{% endif %}
{% if item.location_maps_url %}
<p class="entry-meta"><a href="{{ item.location_maps_url }}" target="_blank" rel="noopener noreferrer">Google Maps anzeigen</a></p>
{% endif %}
{% if item.response %}
<p><strong>Admin-Antwort:</strong> {{ item.response }}</p>
{% endif %}
@@ -276,6 +353,10 @@
const dayGrid = document.getElementById("dayGrid");
const selectedDateInput = document.getElementById("selectedDateInput");
const selectedDateBadge = document.getElementById("selectedDateBadge");
const meetingType = document.getElementById("meeting_type");
const locationField = document.getElementById("locationField");
const locationNameInput = document.getElementById("location_name");
const mapsSearchBtn = document.getElementById("mapsSearchBtn");
function setSelection(dateValue, button) {
selectedDateInput.value = dateValue;
@@ -290,6 +371,16 @@
}
}
function updateLocationRequirement() {
const isOnsite = meetingType.value === "vor_ort";
locationField.style.display = isOnsite ? "block" : "none";
locationNameInput.required = isOnsite;
if (!isOnsite) {
locationNameInput.value = "";
document.getElementById("location_maps_url").value = "";
}
}
dayGrid.addEventListener("click", function (event) {
const target = event.target.closest(".day[data-date]");
if (!target) {
@@ -297,6 +388,16 @@
}
setSelection(target.dataset.date, target);
});
meetingType.addEventListener("change", updateLocationRequirement);
mapsSearchBtn.addEventListener("click", function () {
const query = (locationNameInput.value || "").trim();
const base = "https://www.google.com/maps/search/?api=1&query=";
window.open(base + encodeURIComponent(query || "meeting location"), "_blank", "noopener");
});
updateLocationRequirement();
})();
</script>
{% endblock %}
+162 -3
View File
@@ -42,6 +42,12 @@
var(--bg-main);
}
body {
min-height: 100vh;
display: flex;
flex-direction: column;
}
h1 {
margin: 0;
font-family: "Space Grotesk", system-ui, sans-serif;
@@ -210,6 +216,7 @@
}
.main-wrap {
flex: 1 0 auto;
padding: 2rem 0 3.4rem;
}
@@ -354,22 +361,66 @@
.site-footer {
background: linear-gradient(135deg, var(--brand-strong) 0%, #0a4c74 100%);
color: #ffffff;
margin-top: 4rem;
margin-top: auto;
padding: 3rem 0 1.5rem;
border-top: 1px solid var(--line);
position: relative;
overflow: hidden;
animation: footerEnter 0.7s ease both;
will-change: transform, opacity;
transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, box-shadow 0.45s ease;
}
body.footer-scroll-mode .site-footer {
opacity: 0.9;
transform: translateY(26px);
box-shadow: 0 -8px 22px rgba(5, 27, 41, 0.14);
}
body.footer-scroll-mode.footer-reveal .site-footer {
opacity: 1;
transform: translateY(0);
box-shadow: 0 -14px 34px rgba(5, 27, 41, 0.2);
}
.site-footer::before {
content: "";
position: absolute;
inset: -40% -10% auto -10%;
height: 180px;
background: radial-gradient(circle at 20% 50%, rgba(242, 140, 40, 0.25) 0%, rgba(242, 140, 40, 0) 62%);
transform: translateX(-12%);
animation: footerGlow 7s ease-in-out infinite;
pointer-events: none;
}
.footer-inner {
position: relative;
z-index: 1;
display: grid;
gap: 2rem;
margin-bottom: 2rem;
}
.footer-content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-bottom: 2rem;
}
.footer-section {
display: flex;
flex-direction: column;
gap: 0.75rem;
animation: footerSectionRise 0.65s ease both;
}
.footer-section:nth-child(2) {
animation-delay: 0.08s;
}
.footer-section:nth-child(3) {
animation-delay: 0.16s;
}
.footer-section h4 {
@@ -395,11 +446,12 @@
.footer-links a {
color: rgba(255, 255, 255, 0.8);
font-size: 0.95rem;
transition: color 0.2s ease;
transition: color 0.2s ease, transform 0.2s ease;
}
.footer-links a:hover {
color: #ffffff;
transform: translateX(4px);
}
.footer-bottom {
@@ -414,8 +466,63 @@
margin: 0;
}
@keyframes footerEnter {
from {
opacity: 0;
transform: translateY(22px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes footerSectionRise {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes footerGlow {
0%,
100% {
transform: translateX(-12%);
opacity: 0.65;
}
50% {
transform: translateX(12%);
opacity: 0.95;
}
}
@media (prefers-reduced-motion: reduce) {
.site-footer,
.site-footer::before,
.footer-section,
.footer-links a {
animation: none;
transition: none;
}
body.footer-scroll-mode .site-footer,
body.footer-scroll-mode.footer-reveal .site-footer {
opacity: 1;
transform: none;
box-shadow: none;
}
}
@media (max-width: 700px) {
.footer-inner {
gap: 1.5rem;
}
.footer-content {
grid-template-columns: 1fr;
gap: 1.5rem;
}
@@ -425,5 +532,57 @@
<!-- Mobile compatibility scripts -->
<script src="{{ url_for('static', filename='js/mobile_compatibility.js') }}"></script>
<script src="{{ url_for('static', filename='js/ios_fixes.js') }}"></script>
<script>
(function () {
var footer = document.querySelector(".site-footer");
if (!footer) {
return;
}
var body = document.body;
var reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
var ticking = false;
function updateFooterMode() {
ticking = false;
var maxScroll = Math.max(0, document.documentElement.scrollHeight - window.innerHeight);
body.classList.remove("footer-scroll-mode", "footer-reveal");
if (reduceMotion.matches || maxScroll < 140) {
return;
}
body.classList.add("footer-scroll-mode");
var currentScroll = window.scrollY || window.pageYOffset || 0;
var distanceToBottom = maxScroll - currentScroll;
var progress = maxScroll > 0 ? currentScroll / maxScroll : 1;
var shouldReveal = progress >= 0.78 || distanceToBottom <= 320;
body.classList.toggle("footer-reveal", shouldReveal);
}
function requestUpdate() {
if (ticking) {
return;
}
ticking = true;
window.requestAnimationFrame(updateFooterMode);
}
window.addEventListener("scroll", requestUpdate, { passive: true });
window.addEventListener("resize", requestUpdate);
window.addEventListener("load", requestUpdate);
if (typeof reduceMotion.addEventListener === "function") {
reduceMotion.addEventListener("change", requestUpdate);
} else if (typeof reduceMotion.addListener === "function") {
reduceMotion.addListener(requestUpdate);
}
requestUpdate();
})();
</script>
</body>
</html>
-14
View File
@@ -17,17 +17,6 @@
<p><strong>Lizenzschlüssel:</strong> {{ item.license_key }}</p>
<p><strong>Status:</strong> {{ item.status }}</p>
<p><strong>Gültig bis:</strong> {{ item.valid_until }}</p>
<form method="post" class="transfer-form">
<input type="hidden" name="action" value="transfer">
<input type="hidden" name="license_id" value="{{ item.id }}">
<select name="target_username" required>
<option value="">Lizenz weitergeben an...</option>
{% for user in transfer_users %}
<option value="{{ user.username }}">{{ user.username }} ({{ user.display_name }})</option>
{% endfor %}
</select>
<button type="submit">Weitergeben</button>
</form>
</article>
{% endfor %}
{% else %}
@@ -43,8 +32,5 @@
.grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: #fff; border: 1px solid #d8e1e8; border-radius: 14px; padding: 1rem; }
.card p { margin-top: 0.35rem; }
.transfer-form { margin-top: 0.8rem; display: grid; gap: 0.45rem; }
select, button { border: 1px solid #c9d8e3; border-radius: 10px; padding: 0.52rem; font: inherit; }
button { border-radius: 999px; color: #fff; background: linear-gradient(120deg, #0c5a86 0%, #08486c 100%); border-color: #0a4c74; font-weight: 700; }
</style>
{% endblock %}