2024-05-23 20:49:34 +02:00
|
|
|
<%- include('partials/header') %>
|
2024-05-26 18:25:15 +02:00
|
|
|
<h1>
|
|
|
|
<div>
|
|
|
|
<% if (previousTraining) { %>
|
2024-05-26 20:05:30 +02:00
|
|
|
<a href="/?date=<%= moment(previousTraining.datum).format('DD.MM.YYYY') %>"> < </a>
|
2024-05-26 18:25:15 +02:00
|
|
|
<% } %>
|
|
|
|
Training <%= training.datum %>
|
|
|
|
<% if (nextTraining) { %>
|
|
|
|
<a href="/?date=<%= moment(nextTraining.datum).format('DD.MM.YYYY') %>"> > </a>
|
|
|
|
<% } %>
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<% if (training) { %>
|
2024-05-23 21:58:22 +02:00
|
|
|
<h2> Geräte </h2>
|
|
|
|
<ul>
|
|
|
|
<li>Riege 1: <%= training.geraet_riege_1_name %></li>
|
|
|
|
<li>Riege 2: <%= training.geraet_riege_2_name %></li>
|
|
|
|
<li>Riege 3: <%= training.geraet_riege_3_name %></li>
|
|
|
|
<li>Riege 4: <%= training.geraet_riege_4_name %></li>
|
|
|
|
<li>Riege 5: <%= training.geraet_riege_5_name %></li>
|
|
|
|
</ul>
|
2024-05-26 18:25:15 +02:00
|
|
|
|
|
|
|
<div id="aufwaermen">
|
|
|
|
<h3>Aufwärmen:</h3>
|
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<% if (training.aufwaermleiter_name) { %>
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Leitung:</strong>
|
|
|
|
<%= training.aufwaermleiter_name %></p>
|
2024-05-23 20:49:34 +02:00
|
|
|
<% } else { %>
|
|
|
|
<form method="POST" action="/update-leader">
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Leitung:</strong>
|
2024-05-23 20:49:34 +02:00
|
|
|
<input type="hidden" name="trainingId" value="<%= training.id %>">
|
|
|
|
<input type="hidden" name="type" value="aufwaermleiter">
|
|
|
|
<select name="leaderId">
|
|
|
|
<% aufwaermleiterCandidates.forEach(candidate => { %>
|
|
|
|
<option value="<%= candidate.id %>"><%= candidate.name %> (<%= Math.floor(candidate.weeks_since_last) %> Wochen)</option>
|
|
|
|
<% }) %>
|
|
|
|
</select>
|
|
|
|
<button type="submit">Speichern</button>
|
2024-05-26 18:25:15 +02:00
|
|
|
</form></p>
|
2024-05-23 20:49:34 +02:00
|
|
|
<% } %>
|
2024-05-26 18:25:15 +02:00
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<% if (training.aufwaermen_name) { %>
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Spiel:</strong>
|
|
|
|
<%= training.aufwaermen_name %></p>
|
2024-05-23 20:49:34 +02:00
|
|
|
<% } else { %>
|
|
|
|
<form method="POST" action="/update-training">
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Spiel:</strong>
|
2024-05-23 20:49:34 +02:00
|
|
|
<input type="hidden" name="trainingId" value="<%= training.id %>">
|
|
|
|
<input type="hidden" name="type" value="aufwaermen">
|
2024-05-26 18:25:15 +02:00
|
|
|
<datalist id="spiele">
|
|
|
|
<% aufwaermenCandidates.forEach(candidate => { %>
|
|
|
|
<option value="<%= candidate.name %>"><%= candidate.name %></option>
|
2024-05-23 20:49:34 +02:00
|
|
|
<% }) %>
|
2024-05-26 18:25:15 +02:00
|
|
|
</datalist>
|
|
|
|
<input list="spiele" id="spielName" name="spielName">
|
2024-05-23 20:49:34 +02:00
|
|
|
<button type="submit">Speichern</button>
|
2024-05-26 18:25:15 +02:00
|
|
|
</form></p>
|
2024-05-23 20:49:34 +02:00
|
|
|
<% } %>
|
2024-05-26 18:25:15 +02:00
|
|
|
</div>
|
|
|
|
<div id="spiel">
|
|
|
|
<h3>Spiel: </h3>
|
|
|
|
|
2024-05-23 22:00:44 +02:00
|
|
|
<% if (training.spielleiter_name) { %>
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Leitung:</strong>
|
|
|
|
<%= training.spielleiter_name %></p>
|
2024-05-23 22:00:44 +02:00
|
|
|
<% } else { %>
|
|
|
|
<form method="POST" action="/update-leader">
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Leitung:</strong>
|
2024-05-23 22:00:44 +02:00
|
|
|
<input type="hidden" name="trainingId" value="<%= training.id %>">
|
|
|
|
<input type="hidden" name="type" value="spielleiter">
|
|
|
|
<select name="leaderId">
|
|
|
|
<% spielleiterCandidates.forEach(candidate => { %>
|
|
|
|
<option value="<%= candidate.id %>"><%= candidate.name %> (<%= Math.floor(candidate.weeks_since_last) %> Wochen)</option>
|
|
|
|
<% }) %>
|
|
|
|
</select>
|
|
|
|
<button type="submit">Speichern</button>
|
2024-05-26 18:25:15 +02:00
|
|
|
</form></p>
|
2024-05-23 22:00:44 +02:00
|
|
|
<% } %>
|
|
|
|
|
2024-05-26 18:25:15 +02:00
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<% if (training.spiel_name) { %>
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Spiel:</strong>
|
2024-05-23 20:49:34 +02:00
|
|
|
<%= training.spiel_name %>
|
|
|
|
<% } else { %>
|
2024-05-26 18:25:15 +02:00
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<form method="POST" action="/update-training">
|
2024-05-26 18:25:15 +02:00
|
|
|
<p><strong>Spiel:</strong>
|
2024-05-23 20:49:34 +02:00
|
|
|
<input type="hidden" name="trainingId" value="<%= training.id %>">
|
|
|
|
<input type="hidden" name="type" value="spiel">
|
2024-05-26 18:25:15 +02:00
|
|
|
<datalist id="spiele">
|
|
|
|
<% aufwaermenCandidates.forEach(candidate => { %>
|
|
|
|
<option value="<%= candidate.name %>"><%= candidate.name %></option>
|
|
|
|
<% }) %>
|
|
|
|
</datalist>
|
|
|
|
<input list="spiele" id="spielName" name="spielName">
|
2024-05-23 20:49:34 +02:00
|
|
|
<button type="submit">Speichern</button>
|
|
|
|
</form>
|
2024-05-26 18:25:15 +02:00
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<% } %>
|
2024-05-26 18:25:15 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<form method="GET" action="/">
|
|
|
|
<label for="training-date">Datum wählen:</label>
|
|
|
|
<select id="training-date" name="date" onchange="this.form.submit()">
|
|
|
|
<% trainingsDates.forEach(date => { %>
|
|
|
|
<option value="<%= date.datum %>" <%= selectedDate === date.datum ? 'selected' : '' %>>
|
|
|
|
<%= date.datum %>
|
|
|
|
</option>
|
|
|
|
<% }) %>
|
|
|
|
</select>
|
|
|
|
</form>
|
|
|
|
|
2024-05-23 20:49:34 +02:00
|
|
|
<% } else { %>
|
|
|
|
<p>Kein Training gefunden für das ausgewählte Datum.</p>
|
|
|
|
<% } %>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
<%- include('partials/footer') %>
|