datum-test

This commit is contained in:
klaas 2024-05-26 09:17:50 +00:00
parent 7ad9c8b0cb
commit 94b50dbd21
2 changed files with 3 additions and 5 deletions

6
app.js
View File

@ -165,8 +165,7 @@ FROM teilnehmende t
LEFT JOIN trainings tr ON t.id = tr.aufwaermleiter LEFT JOIN trainings tr ON t.id = tr.aufwaermleiter
WHERE t.helfer = true WHERE t.helfer = true
GROUP BY t.id GROUP BY t.id
ORDER BY weeks_since_last DESC ORDER BY weeks_since_last DESC;
LIMIT 4;
`); `);
return result.rows; return result.rows;
}; };
@ -180,8 +179,7 @@ const getCandidatesForSpielleiter = async () => {
LEFT JOIN trainings tr ON t.id = tr.spielleiter LEFT JOIN trainings tr ON t.id = tr.spielleiter
WHERE t.helfer = true WHERE t.helfer = true
GROUP BY t.id GROUP BY t.id
ORDER BY weeks_since_last DESC ORDER BY weeks_since_last DESC;
LIMIT 4
`); `);
return result.rows; return result.rows;
}; };

View File

@ -1,6 +1,6 @@
<%- include('partials/header') %> <%- include('partials/header') %>
<h1>Training <%= training.datum %></h1> <h1>Training <%= training.datum %></h1>
<h2> <%= training.datum + 7 %> </h2>
<form method="GET" action="/"> <form method="GET" action="/">
<label for="training-date">Datum wählen:</label> <label for="training-date">Datum wählen:</label>
<select id="training-date" name="date" onchange="this.form.submit()"> <select id="training-date" name="date" onchange="this.form.submit()">