spiele Edit

This commit is contained in:
Klaas Börgmann 2024-05-29 22:07:17 +02:00
parent 1339ba0b60
commit 9d897806cc
3 changed files with 10 additions and 7 deletions

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "kinderturnen-gpt", "name": "training",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "kinderturnen-gpt", "name": "training",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {

View File

@ -1,5 +1,5 @@
{ {
"name": "kinderturnen-gpt", "name": "training",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "app.js", "main": "app.js",

View File

@ -11,6 +11,9 @@
<h2>Regeln</h2> <h2>Regeln</h2>
<p><%= spiel.regeln %></p> <p><%= spiel.regeln %></p>
<h2>Variationen</h2>
<p><%= spiel.variationen %></p>
<% if (session && (session.role === 'user' || session.role==='admin')) {%> <% if (session && (session.role === 'user' || session.role==='admin')) {%>
<button class="btn btn-primary" onclick="toggleDivs()">Zum Edit-Modus wechseln</button> <button class="btn btn-primary" onclick="toggleDivs()">Zum Edit-Modus wechseln</button>
@ -19,10 +22,10 @@
<div id="edit" class="mt-5 d-none"> <div id="edit" class="mt-5 d-none">
<form method="POST" action="/edit-Spiel"> <form method="POST" action="/edit-Spiel">
<input type="hidden" name="id" value="<%= spiel.id %>"> <input type="hidden" name="id" value="<%= spiel.id %>">
<strong>Material: </strong><input type="text" name="material" value="<%= spiel.matierial %>"></br> <strong>Material: </strong><br><textarea name="material"><%= spiel.material %> </textarea><br>
<strong>Dauer: </strong><input name="dauer" value="<%=spiel.dauer %>"></br> <strong>Dauer: </strong><input name="dauer" value="<%=spiel.dauer %>"><%=spiel.dauer %></input><br>
<strong>Regeln: </strong><input type="text" name="regeln" value="<%= spiel.regeln %>"></br> <strong>Regeln: </strong><br><textarea name="regeln"><%= spiel.regeln %> </textarea><br>
<strong>Variationen: </strong><input type="text" name="variationen" value="<%= spiel.variationen %>"></br> <strong>Variationen: </strong><br><textarea name="variationen"><%= spiel.variationen %> </textarea><br>
<button type="submit">Speichern</button> <button type="submit">Speichern</button>
</form> </form>
<button class="btn btn-secondary" onclick="toggleDivs()">Zum View-Modus wechseln</button> <button class="btn btn-secondary" onclick="toggleDivs()">Zum View-Modus wechseln</button>