Initial commit

This commit is contained in:
2025-05-31 14:50:40 +00:00
commit f61df12e5d
14 changed files with 1128 additions and 0 deletions

43
static/js/scripts.js Normal file
View File

@ -0,0 +1,43 @@
document.addEventListener('DOMContentLoaded', function() {
// Add current date to the dashboard
const now = new Date();
const months = [
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni',
'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
];
// Format date for display
const formattedDate = `${months[now.getMonth()]} ${now.getFullYear()}`;
// Add to any elements with date-display class
const dateElements = document.querySelectorAll('.date-display');
dateElements.forEach(element => {
element.textContent = formattedDate;
});
// Handle form validation
const forms = document.querySelectorAll('form');
forms.forEach(form => {
form.addEventListener('submit', function(event) {
const amountInput = form.querySelector('input[name="amount"]');
if (amountInput && parseFloat(amountInput.value) <= 0) {
event.preventDefault();
alert('Bitte geben Sie einen gültigen Betrag ein (größer als 0).');
}
});
});
// Add responsive menu toggle for mobile
const menuToggle = document.createElement('button');
menuToggle.classList.add('menu-toggle');
menuToggle.innerHTML = '<i class="fas fa-bars"></i>';
const sidebar = document.querySelector('.sidebar');
if (sidebar) {
sidebar.parentNode.insertBefore(menuToggle, sidebar);
menuToggle.addEventListener('click', function() {
sidebar.classList.toggle('active');
});
}
});