summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJani Peter Karhunen <jkarhun2@local>2023-11-25 03:32:29 +0200
committerJani Peter Karhunen <jkarhun2@local>2023-11-25 03:32:29 +0200
commitd2de3ae10b6f5314bd4b8243218212d2004f35b0 (patch)
tree2ab448e0c2ec361478851dbcb43bcd176d17b584 /templates
parentc059696450d301b99956d643c21b0e46b4fc39dc (diff)
MEGA Commit. Rework of routing. Visuals. Answer analysis and much more.
Diffstat (limited to 'templates')
-rw-r--r--templates/analyse.html75
-rw-r--r--templates/answer.html26
-rw-r--r--templates/base.html7
-rw-r--r--templates/create.html32
-rw-r--r--templates/info.html13
-rw-r--r--templates/moderate.html2
-rw-r--r--templates/new_answer.html7
-rw-r--r--templates/nick.html4
-rw-r--r--templates/question.html2
-rw-r--r--templates/quiz.html2
10 files changed, 149 insertions, 21 deletions
diff --git a/templates/analyse.html b/templates/analyse.html
index 6970764..70fb98e 100644
--- a/templates/analyse.html
+++ b/templates/analyse.html
@@ -1,4 +1,73 @@
-<div id="nickbox">{{ nick }}</div>
-<div id="alertbox">{{ alert }}</div>
-<h1>analyse</h1>
+{% include 'base.html' %}
+
+{% if users %}
+
+Tutkit kyselyä: {{ code }}
+
+
+<div class="kysQuestion"><div class="kysScale">
+<form action="/set/compare" method="POST">
+<input type="submit" value="Vertaa" class="kysButton">
+<select class="kysSelectU1 kysSelect" name="user1">
+{% for user in users %}
+ {% if user1==user.id %}
+ <option value="{{ user.id }}" selected>{{ user.nick }}</option>
+ {% else %}
+ <option value="{{ user.id }}">{{ user.nick }}</option>
+ {% endif %}
+{% endfor %}
+</select>
+<select class="kysSelectU2 kysSelect" name="user2">
+{% for user in users %}
+ {% if user2==user.id %}
+ <option value="{{ user.id }}" selected>{{ user.nick }}</option>
+ {% else %}
+ <option value="{{ user.id }}">{{ user.nick }}</option>
+ {% endif %}
+{% endfor %}
+</select>
+<div class="kysScaleSpacer"></div>
+</form>
+</div></div>
+
+{% endif %}
+
+{% if code %}
+
+<div id="questions" class="kysQuestions">
+ <div class="kysQuestion">
+ <div class="kysTotal">{{ avg }}%</div>
+ </div>
+{% for q in questions %}
+<div class="kysQuestion">
+ <div class="kysText">{{ q.q }} ({{ q.c }}%)</div>
+ <input class="kysAnswer kysUser1" type="range" min="0" max="999"
+ value="{{ q.a1 }}" disabled="">
+ <input class="kysAnswer kysUser2" type="range" min="0" max="999"
+ value="{{ q.a2 }}" disabled="">
+ <div class="kysScale">
+ <div class="kysNegative">{{ q.n }}</div>
+ <div class="kysScaleSpacer"></div>
+ <div class="kysPositive">{{ q.p }}</div>
+ </div>
+</div>
+{% endfor %}
+
+</div>
+
+{% endif %}
+
+<form action="/set/answer_id" method="POST">
+Vaihda kyselyn koodia:
+<input type="text" name="link">
+<input type="text" name="next" value="analyse" hidden="true">
+<input type="submit" value="Vaihda">
+</form>
+
+{% if code %}
+Linkki tähän kyselyyn:
+<a href="http://anal.fi:5000/kys/{{ code }}">
+ http://anal.fi:5000/kys/{{ code }}
+</a>
+{% endif %}
diff --git a/templates/answer.html b/templates/answer.html
index 0ed0a05..eb49ff8 100644
--- a/templates/answer.html
+++ b/templates/answer.html
@@ -1,5 +1,21 @@
-<script src="answer.js"></script>
-<div id="nickbox">{{ nick }}</div>
-<div id="alertbox">{{ alert }}</div>
-<h1>answer NOW!</h1>
-<form id=questionForm action="/set/answers" method="POST"></form>
+{% include 'base.html' %}
+
+Vastaa kyselmään "{{ link }}":
+
+<form class="kysQuestionaire" action="/set/answers" method="POST">
+<div id="questions" class="kysQuestions">
+{% for q in questions %}
+<div class="kysQuestion">
+<div class="kysText">{{ q.q }}</div>
+<div class="kysScale">
+ <div class="kysNegative">{{ q.n }}</div>
+ <div class="kysScaleSpacer"></div>
+ <div class="kysPositive">{{ q.p }}</div>
+</div>
+<input class="kysAnswer" type="range" min="0" max="999" name="{{ q.i }}">
+</div>
+{% endfor %}
+<input class="kysSubmitAnswers" type="submit" value="Vastaa kyselyyn">
+</div>
+</form>
+
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..839cc88
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,7 @@
+{% if nick %}
+ <div class="kysNick">{{ nick }}</div>
+{% endif %}
+{% if alert %}
+ <div class="kysAlert">{{ alert }}</div>
+ <script src="alert-timeout.js"></script>
+{% endif %}
diff --git a/templates/create.html b/templates/create.html
index fe2aa24..b369ae8 100644
--- a/templates/create.html
+++ b/templates/create.html
@@ -1,9 +1,29 @@
-<script src="create.js"></script>
-<div id="nickbox">{{ nick }}</div>
-<div id="alertbox">{{ alert }}</div>
-<h1>create</h1>
+{% include 'base.html' %}
-<div id=questions></div>
-<a href="#question">Lisää kysymys</a>
+<div id="questions" class="kysQuestions">
+{% for q in questions %}
+<div class="kysQuestion">
+<div class="kysText">{{ q.q }}</div>
+<div class="kysScale">
+ <div class="kysNegative">{{ q.n }}</div>
+ <div class="kysScaleSpacer"></div>
+ <div class="kysPositive">{{ q.p }}</div>
+</div>
+<input class="kysAnswer" type="range" min="0" max="999"
+ value="{{ q.a }}" disabled=""></div>
+{% endfor %}
+
+<div class="kysQuestion">
+<div class="kysScale">
+<a href="#question">
+ <input type="button" value="Lisää kysymys" class="kysButton">
+</a>
+<div class="kysScaleSpacer"></div>
+<form action="/set/quiz_ready" method="POST">
+<input type="text" name="ok" hidden=true>
+<input type="submit" value="Valmis" class="kysButton">
</form>
+<div class="kysScale">
+</div>
+</div> \ No newline at end of file
diff --git a/templates/info.html b/templates/info.html
index 3f984a6..30e84e2 100644
--- a/templates/info.html
+++ b/templates/info.html
@@ -1,2 +1,11 @@
-<div id="alertbox">{{ alert }}</div>
-<h1>info</h1>
+{% include 'base.html' %}
+<h1>Kyselmä</h1>
+
+Tervetuloa kyselmien ihmeelliseen maailmaan. Täällä laadit ikioman kyselmän
+ja vastailet kavereidesi luomiin kyselmiin. Vastattuasi pääset vertailemaan
+vastauksiasi muiden vatausten kassa. Alkuun pääset painamalla ylhäätä "Luo"
+ja tekemällä uuden kyselmän. Tämän jälkeen vain lisäät niin monta kysymystä
+vastausvaihtoehtoineen kuin haluat ja lopuksi painat valmis, jonka jälkeen
+muutkin pääsee vastaamaan kyselmään koodilla. Tarkastelussa voit valita
+mitkä tahansa kaksi vastaaja ja tutkia vastausten samankaltaisuutta ja
+kaiken huipuksi vastauksista lasketaan yhtäläisyys prosentti.
diff --git a/templates/moderate.html b/templates/moderate.html
index 116f2ff..118c8d4 100644
--- a/templates/moderate.html
+++ b/templates/moderate.html
@@ -1,2 +1,2 @@
-<div id="alertbox">{{ alert }}</div>
+{% include 'base.html' %}
<h1>moderate</h1>
diff --git a/templates/new_answer.html b/templates/new_answer.html
new file mode 100644
index 0000000..0d690d4
--- /dev/null
+++ b/templates/new_answer.html
@@ -0,0 +1,7 @@
+{% include 'base.html' %}
+<form action="/set/answer_id" method="POST">
+Vastaa kyselyyn koodilla:
+<input type="text" name="link">
+<input type="submit" value="Kyselmään">
+</form>
+Saatoit myös päätyä tänne mikäli olet jo vastannut.
diff --git a/templates/nick.html b/templates/nick.html
index fe4a50a..92e166f 100644
--- a/templates/nick.html
+++ b/templates/nick.html
@@ -1,6 +1,6 @@
-<div id="alertbox">{{ alert }}</div>
+{% include 'base.html' %}
<form action="/set/nick" method="POST">
Anna itsellesi nimimerkki ensin:
-<input type="text" name="nick" rows="1" cols="40"></textarea>
+<input type="text" name="nick">
<input type="submit" value="Lähetä">
</form>
diff --git a/templates/question.html b/templates/question.html
index 016a1ac..62afaaf 100644
--- a/templates/question.html
+++ b/templates/question.html
@@ -1,4 +1,4 @@
-<div id="kysAlert">{{ alert }}</div>
+{% include 'base.html' %}
<form action="/set/question" method="POST">
<div class="kysQuestion">
<div class="kysCreateText">Kysymys:</div>
diff --git a/templates/quiz.html b/templates/quiz.html
index b2083ae..9e356c3 100644
--- a/templates/quiz.html
+++ b/templates/quiz.html
@@ -1,4 +1,4 @@
-<div id="alertbox">{{ alert }}</div>
+{% include 'base.html' %}
<form action="/set/quiz" method="POST">
<input type="submit" value="Aloita uusi kyselmä">
</form>