diff options
Diffstat (limited to 'components/index.html')
-rw-r--r-- | components/index.html | 70 |
1 files changed, 13 insertions, 57 deletions
diff --git a/components/index.html b/components/index.html index 9c43a50..816fd21 100644 --- a/components/index.html +++ b/components/index.html @@ -9,66 +9,22 @@ <script src="https://unpkg.com/htmx.org@2.0.4" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script> </head> <body> - <div id="ancestor"> - <div class="question-text" data-testid="question"> - {{.Text}} - </div> - <div id="feedback" data-testid="feedback"> - {{template "feedback" .}} - {{if .ShowNext}} - <button - hx-get="/next-question?current_id={{.ID}}" - hx-target="#ancestor" - hx-swap="outerHTML" - class="next-button" - data-testid="next-button"> - Next Question → - </button> - {{end}} - </div> - {{template "feedback" .}} - <div id="options"> - <button - data-testid="option1" - hx-post="/answer" - hx-vals='{"selected": "0", "question_id": "{{.ID}}"}' - hx-target="#feedback" - hx-swap="innerHTML" - class="option-button" - > - {{.Option1}} - </button> - <button - data-testid="option2" - hx-post="/answer" - hx-vals='{"selected": "1", "question_id": "{{.ID}}"}' - hx-target="#feedback" - hx-swap="innerHTML" - class="option-button" - > - {{.Option2}} - </button> - <button - data-testid="option3" - hx-post="/answer" - hx-vals='{"selected": "2", "question_id": "{{.ID}}"}' - hx-target="#feedback" - hx-swap="innerHTML" - class="option-button" - > - {{.Option3}} - </button> + <div class="container"> + <h1>Mixed Übungen</h1> + <div class="ubung-list"> + {{range .}} + <p> <button - data-testid="option4" - hx-post="/answer" - hx-vals='{"selected": "3", "question_id": "{{.ID}}"}' - hx-target="#feedback" - hx-swap="innerHTML" - class="option-button" - > - {{.Option4}} + class="ubung-button" + hx-get="/mixed?id={{.ID}}" + hx-target="#ancestor" + hx-swap="outerHTML"> + {{.Name}} (Level {{.LevelID}}) </button> + </p> + {{end}} </div> + <div id="ancestor"></div> </div> </body> </html> |