Anzahl der anwesenden

This commit is contained in:
Klaas Börgmann 2024-09-18 15:15:22 +02:00
parent e002a8716e
commit bf94deab1d
3 changed files with 11 additions and 7 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"cSpell.language": "en,de-DE"
}

3
app.js
View File

@ -648,7 +648,7 @@ app.get("/training", requireAuth, async (req, res) => {
[training.id] [training.id]
); );
anwesend = anwesendResult.rows; anwesend = anwesendResult.rows;
const anzahl = anwesend.length;
const trainingsResult = await pool.query( const trainingsResult = await pool.query(
"SELECT kw, jahr FROM trainings ORDER BY kw ASC" "SELECT kw, jahr FROM trainings ORDER BY kw ASC"
); );
@ -697,6 +697,7 @@ app.get("/training", requireAuth, async (req, res) => {
age: age, age: age,
helfer: row.helfer, helfer: row.helfer,
anwesend: tnAnwesend, anwesend: tnAnwesend,
anzahl,
}); });
}); });

View File

@ -28,11 +28,11 @@
<div class="tab-pane fade <%= activeTab === 'geraete' ? 'show active' : '' %>" id="geraete" role="tabpanel" aria-labelledby="tab-geraete"> <div class="tab-pane fade <%= activeTab === 'geraete' ? 'show active' : '' %>" id="geraete" role="tabpanel" aria-labelledby="tab-geraete">
<h2> Geräte </h2> <h2> Geräte </h2>
<ul> <ul>
<li>Riege 1: <%= training.geraet_riege_1_name %></li> <li>Riege 1 (Klaas): <%= training.geraet_riege_1_name %></li>
<li>Riege 2: <%= training.geraet_riege_2_name %></li> <li>Riege 2 (Rabea): <%= training.geraet_riege_2_name %></li>
<li>Riege 3: <%= training.geraet_riege_3_name %></li> <li>Riege 3 (Laura): <%= training.geraet_riege_3_name %></li>
<li>Riege 4: <%= training.geraet_riege_4_name %></li> <li>Riege 4 (laila / Carlotta): <%= training.geraet_riege_4_name %></li>
<li>Riege 5: <%= training.geraet_riege_5_name %></li> <li>Riege 5 (Simon): <%= training.geraet_riege_5_name %></li>
</ul> </ul>
</div> </div>
<div class="tab-pane fade <%= activeTab === 'spiel' ? 'show active' : '' %>" id="spiel" role="tabpanel" aria-labelledby="tab-spiel"> <div class="tab-pane fade <%= activeTab === 'spiel' ? 'show active' : '' %>" id="spiel" role="tabpanel" aria-labelledby="tab-spiel">
@ -255,7 +255,7 @@
</div> </div>
<div class="tab-pane fade <%= activeTab === 'anwesend' ? 'show active' : '' %>" id="anwesend" role="tabpanel" aria-labelledby="tab-anwesend"> <div class="tab-pane fade <%= activeTab === 'anwesend' ? 'show active' : '' %>" id="anwesend" role="tabpanel" aria-labelledby="tab-anwesend">
<h3>Anwesenheit</h3> <h3>Anwesenheit</h3>
<p>Anwesend: <%= anwesend.length %></p>
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs" id="RiegenTab" role="tablist"> <ul class="nav nav-tabs" id="RiegenTab" role="tablist">
<% Object.keys(riegen).forEach((riegennummer, index) => { %> <% Object.keys(riegen).forEach((riegennummer, index) => { %>