2023-11-01 21:12:18 +01:00
|
|
|
<% if !htmx {%>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>zettoIT ARS</title>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<link rel="stylesheet" href="/static/charts.min.css">
|
|
|
|
<link rel="stylesheet" href="/static/pico.min.css">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
</head>
|
|
|
|
<body>
|
2023-11-01 21:15:55 +01:00
|
|
|
<script src="/static/chart.js"></script>
|
2023-11-01 21:12:18 +01:00
|
|
|
<main class="container" hx-sse="connect:/<%= id %>/view/events swap:message">
|
|
|
|
<% } %>
|
|
|
|
<h1>zettoIT ARS</h1>
|
|
|
|
|
2023-11-02 22:46:38 +01:00
|
|
|
<% if let ViewerState::Answering{ inner_body } = state { %>
|
|
|
|
<%- inner_body %>
|
2023-11-01 21:12:18 +01:00
|
|
|
|
2023-11-02 22:46:38 +01:00
|
|
|
<button hx-post="" class="outline">Show correct Answer</button>
|
2023-11-01 21:12:18 +01:00
|
|
|
|
2023-11-02 22:46:38 +01:00
|
|
|
<% } else if let ViewerState::Result{ last_question, inner_body} = state { %>
|
2023-11-01 21:12:18 +01:00
|
|
|
|
2023-11-02 22:46:38 +01:00
|
|
|
<%- inner_body %>
|
2023-11-01 21:12:18 +01:00
|
|
|
|
2023-11-02 22:46:38 +01:00
|
|
|
<% if last_question { %>
|
|
|
|
<button hx-post="" class="outline">End Quiz</button>
|
|
|
|
<% } else { %>
|
|
|
|
<button hx-post="" class="outline">Next Question</button>
|
|
|
|
<% } %>
|
2023-11-01 21:12:18 +01:00
|
|
|
|
|
|
|
<% } else if let ViewerState::NotStarted((player, qrcode, url)) = state { %>
|
|
|
|
</article>
|
|
|
|
<center><%- qrcode %></center>
|
|
|
|
<center><%= url %></center>
|
|
|
|
<button hx-post="" class="outline">Start Quiz with <b><%= player %></b> Players</button>
|
|
|
|
</article>
|
|
|
|
<% } else {%>
|
|
|
|
<article>
|
|
|
|
The Quiz finished. You can close this tab now.
|
|
|
|
</article>
|
|
|
|
<% } %>
|
|
|
|
<% if !htmx { %>
|
|
|
|
</main>
|
|
|
|
<script src="/static/htmx.min.js"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<% } %>
|