Anwesenheit und Spiel speichern und Teilnehmerliste nur für Admins
This commit is contained in:
parent
a729c184eb
commit
87a51c5b6e
4
app.js
4
app.js
|
@ -653,7 +653,7 @@ app.get('/riege', requireAuth, async (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
app.get('/teilnehmer', requireAuth, async (req, res) => {
|
||||
app.get('/teilnehmer', requireAuth, requireAdmin, async (req, res) => {
|
||||
try {
|
||||
const teilnehmendeResult = await pool.query('SELECT * FROM teilnehmende ORDER BY helfer DESC, vorname ASC');
|
||||
|
||||
|
@ -670,7 +670,7 @@ app.get('/teilnehmer', requireAuth, async (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
app.get('/mitglied/:id', requireAuth, async (req, res) => {
|
||||
app.get('/mitglied/:id', requireAuth, requireAdmin, async (req, res) => {
|
||||
const { id } = req.params;
|
||||
try {
|
||||
var riege = 0;
|
||||
|
|
|
@ -24,9 +24,12 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" href="/riege">Riegen</a>
|
||||
</li>
|
||||
<% if (session && session.role === 'admin') { %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/teilnehmer">Teilnehmende</a>
|
||||
</li>
|
||||
<% } %>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/profile">Profil</a>
|
||||
</li>
|
||||
|
|
|
@ -52,7 +52,9 @@
|
|||
<option value="<%= candidate.id %>"><%= candidate.name %> (<%= Math.floor(candidate.weeks_since_last) %> Wochen)</option>
|
||||
<% }) %>
|
||||
</select>
|
||||
<% if (session && session.role === 'admin') { %>
|
||||
<button type="submit">Speichern</button>
|
||||
<% } %>
|
||||
</form></p>
|
||||
<% } %>
|
||||
|
||||
|
@ -70,7 +72,9 @@
|
|||
<% }) %>
|
||||
</datalist>
|
||||
<input list="spiele" id="spielName" name="spielName">
|
||||
<% if (session && session.role === 'admin') { %>
|
||||
<button type="submit">Speichern</button>
|
||||
<% } %>
|
||||
</form></p>
|
||||
<% } %>
|
||||
</div>
|
||||
|
@ -90,7 +94,9 @@
|
|||
<option value="<%= candidate.id %>"><%= candidate.name %> (<%= Math.floor(candidate.weeks_since_last) %> Wochen)</option>
|
||||
<% }) %>
|
||||
</select>
|
||||
<% if (session && session.role === 'admin') { %>
|
||||
<button type="submit">Speichern</button>
|
||||
<% } %>
|
||||
</form></p>
|
||||
<% } %>
|
||||
|
||||
|
@ -110,7 +116,9 @@
|
|||
<% }) %>
|
||||
</datalist>
|
||||
<input list="spiele" id="spielName" name="spielName">
|
||||
<% if (session && session.role === 'admin') { %>
|
||||
<button type="submit">Speichern</button>
|
||||
<% } %>
|
||||
</form>
|
||||
|
||||
<% } %>
|
||||
|
@ -157,7 +165,9 @@
|
|||
</table>
|
||||
<input type="hidden" name="trainingId" value="<%= training.id %>">
|
||||
<input type="hidden" name="riege" value="<%= riegennummer %>">
|
||||
<% if (session && session.role === 'admin') { %>
|
||||
<button type="submit">Speichern</button>
|
||||
<% } %>
|
||||
</form>
|
||||
</div>
|
||||
<% }) %>
|
||||
|
|
Loading…
Reference in New Issue