Inputvaledierung für die Projektnummern
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
</div>
|
||||
<div class="nav-right">
|
||||
<span>Verwaltung: <%= user.firstname %> <%= user.lastname %></span>
|
||||
<select id="verwaltungNav" class="role-switcher" style="margin-right: 10px; padding: 5px 10px; border-radius: 4px; border: 1px solid #ddd;">
|
||||
<option value="/verwaltung">Postfach</option>
|
||||
<option value="/verwaltung/projektauswertung" selected>Projektauswertung</option>
|
||||
</select>
|
||||
<% if (user.roles && user.roles.length > 1) { %>
|
||||
<select id="roleSwitcher" class="role-switcher" style="margin-right: 10px; padding: 5px 10px; border-radius: 4px; border: 1px solid #ddd;">
|
||||
<% const roleLabels = { 'mitarbeiter': 'Mitarbeiter', 'verwaltung': 'Verwaltung', 'admin': 'Administrator' }; %>
|
||||
@@ -35,10 +39,6 @@
|
||||
<h2>Projektauswertung nach Mitarbeitern</h2>
|
||||
<p>Geben Sie eine Projektnummer ein, um alle erfassten Stunden pro Mitarbeiter für dieses Projekt auszuwerten.</p>
|
||||
|
||||
<div style="margin-bottom: 15px;">
|
||||
<a href="/verwaltung" class="btn btn-secondary">« Zurück zur Verwaltung</a>
|
||||
</div>
|
||||
|
||||
<form method="GET" action="/verwaltung/projektauswertung" class="projekt-filter-form" style="margin-bottom: 20px;">
|
||||
<div class="form-group">
|
||||
<label for="projectNumber"><strong>Projektnummer</strong></label>
|
||||
@@ -48,14 +48,18 @@
|
||||
name="project"
|
||||
value="<%= projectNumber || '' %>"
|
||||
class="form-control"
|
||||
placeholder="z. B. 12345"
|
||||
placeholder="z. B. 5260001"
|
||||
required
|
||||
style="max-width: 240px;">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Auswerten</button>
|
||||
</form>
|
||||
|
||||
<% if (projectNumber && !hasResults) { %>
|
||||
<% if (projectNumberError) { %>
|
||||
<div style="max-width: 480px; padding: 12px 16px; background: #f8d7da; border: 1px solid #f5c6cb; border-radius: 4px; color: #721c24;">
|
||||
<%= projectNumberError %>
|
||||
</div>
|
||||
<% } else if (projectNumber && !hasResults) { %>
|
||||
<div class="empty-state">
|
||||
<p>Für das Projekt <strong><%= projectNumber %></strong> wurden keine Stunden gefunden.</p>
|
||||
</div>
|
||||
@@ -167,6 +171,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
const verwaltungNav = document.getElementById('verwaltungNav');
|
||||
if (verwaltungNav) {
|
||||
verwaltungNav.addEventListener('change', function() {
|
||||
const url = this.value;
|
||||
if (url) window.location.href = url;
|
||||
});
|
||||
}
|
||||
|
||||
// Mitarbeiter-Details (Aktivitäten) ein-/ausklappen
|
||||
document.querySelectorAll('.toggle-details-btn').forEach(function(btn) {
|
||||
btn.addEventListener('click', function() {
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
</div>
|
||||
<div class="nav-right">
|
||||
<span>Verwaltung: <%= user.firstname %> <%= user.lastname %></span>
|
||||
<a href="/verwaltung/projektauswertung" class="btn btn-secondary" style="margin-right: 10px;">Projektauswertung</a>
|
||||
<select id="verwaltungNav" class="role-switcher" style="margin-right: 10px; padding: 5px 10px; border-radius: 4px; border: 1px solid #ddd;">
|
||||
<option value="/verwaltung" selected>Postfach</option>
|
||||
<option value="/verwaltung/projektauswertung">Projektauswertung</option>
|
||||
</select>
|
||||
<% if (user.roles && user.roles.length > 1) { %>
|
||||
<select id="roleSwitcher" class="role-switcher" style="margin-right: 10px; padding: 5px 10px; border-radius: 4px; border: 1px solid #ddd;">
|
||||
<% const roleLabels = { 'mitarbeiter': 'Mitarbeiter', 'verwaltung': 'Verwaltung', 'admin': 'Administrator' }; %>
|
||||
@@ -1192,6 +1195,14 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const verwaltungNav = document.getElementById('verwaltungNav');
|
||||
if (verwaltungNav) {
|
||||
verwaltungNav.addEventListener('change', function() {
|
||||
const url = this.value;
|
||||
if (url) window.location.href = url;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<%- include('footer') %>
|
||||
|
||||
Reference in New Issue
Block a user