summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/analyse.html45
-rw-r--r--templates/answer.html16
-rw-r--r--templates/base.html8
-rw-r--r--templates/create.html15
-rw-r--r--templates/new_answer.html7
-rw-r--r--templates/nick.html6
-rw-r--r--templates/quiz.html4
7 files changed, 77 insertions, 24 deletions
diff --git a/templates/analyse.html b/templates/analyse.html
index 70fb98e..a57376d 100644
--- a/templates/analyse.html
+++ b/templates/analyse.html
@@ -1,13 +1,13 @@
{% include 'base.html' %}
+{% if nick %}
{% if users %}
-Tutkit kyselyä: {{ code }}
+Tutkit kyselmää: {{ 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 %}
@@ -26,7 +26,7 @@ Tutkit kyselyä: {{ code }}
{% endif %}
{% endfor %}
</select>
-<div class="kysScaleSpacer"></div>
+<input type="submit" value="Vertaa" class="kysButton">
</form>
</div></div>
@@ -35,9 +35,13 @@ Tutkit kyselyä: {{ code }}
{% if code %}
<div id="questions" class="kysQuestions">
- <div class="kysQuestion">
- <div class="kysTotal">{{ avg }}%</div>
+
+ <div class="kysTotal">
+ <div class="kysTotalBackground">
+ <div class="kysTotalText">{{ avg }}%</div>
+ </div>
</div>
+
{% for q in questions %}
<div class="kysQuestion">
<div class="kysText">{{ q.q }} ({{ q.c }}%)</div>
@@ -53,6 +57,34 @@ Tutkit kyselyä: {{ code }}
</div>
{% endfor %}
+<form action="/set/compare" method="POST">
+<input type="text" name="user1" hidden="true" value={{ best.max_u1 }}>
+<input type="text" name="user2" hidden="true" value={{ best.max_u2 }}>
+<input type="submit" value="Kaikista paras yhtäläisyys ({{ best.max }}%)"
+ class="kysButton">
+</form>
+
+<form action="/set/compare" method="POST">
+<input type="text" name="user1" hidden="true" value={{ best.maxme_u1 }}>
+<input type="text" name="user2" hidden="true" value={{ best.maxme_u2 }}>
+<input type="submit" value="Paras yhtäläisyys kanssani ({{ best.maxme }}%)"
+ class="kysButton">
+</form>
+
+<form action="/set/compare" method="POST">
+<input type="text" name="user1" hidden="true" value={{ best.minme_u1 }}>
+<input type="text" name="user2" hidden="true" value={{ best.minme_u2 }}>
+<input type="submit" value="Huonoin yhtäläisyys kanssani ({{ best.minme }}%)"
+ class="kysButton">
+</form>
+
+<form action="/set/compare" method="POST">
+<input type="text" name="user1" hidden="true" value={{ best.min_u1 }}>
+<input type="text" name="user2" hidden="true" value={{ best.min_u2 }}>
+<input type="submit" value="Kaikista huonoin yhtäläisyys ({{ best.min }}%)"
+ class="kysButton">
+</form>
+
</div>
{% endif %}
@@ -60,7 +92,7 @@ Tutkit kyselyä: {{ code }}
<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="text" name="caller" value="analyse" hidden="true">
<input type="submit" value="Vaihda">
</form>
@@ -71,3 +103,4 @@ Linkki tähän kyselyyn:
</a>
{% endif %}
+{% endif %}
diff --git a/templates/answer.html b/templates/answer.html
index eb49ff8..6231785 100644
--- a/templates/answer.html
+++ b/templates/answer.html
@@ -1,4 +1,7 @@
{% include 'base.html' %}
+{% if nick %}
+
+{% if link %}
Vastaa kyselmään "{{ link }}":
@@ -19,3 +22,16 @@ Vastaa kyselmään "{{ link }}":
</div>
</form>
+{% else %}
+
+<form action="/set/answer_id" method="POST">
+Vastaa kyselyyn koodilla:
+<input type="text" name="link">
+<input type="text" name="caller" value="answer" hidden="true">
+<input type="submit" value="Kyselmään">
+</form>
+
+{% endif %}
+
+
+{% endif %}
diff --git a/templates/base.html b/templates/base.html
index 839cc88..f38eb12 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,6 +1,14 @@
{% if nick %}
<div class="kysNick">{{ nick }}</div>
+{% else %}
+<form action="/set/nick" method="POST">
+Anna itsellesi nimimerkki ensin:
+<input type="text" name="nick">
+<input type="text" name="caller" value="{{ caller }}" hidden="true">
+<input type="submit" value="Lähetä">
+</form>
{% endif %}
+
{% if alert %}
<div class="kysAlert">{{ alert }}</div>
<script src="alert-timeout.js"></script>
diff --git a/templates/create.html b/templates/create.html
index b369ae8..21520b5 100644
--- a/templates/create.html
+++ b/templates/create.html
@@ -1,5 +1,8 @@
{% include 'base.html' %}
+{% if nick %}
+
+{% if quiz_set %}
<div id="questions" class="kysQuestions">
{% for q in questions %}
@@ -26,4 +29,14 @@
</form>
<div class="kysScale">
</div>
-</div> \ No newline at end of file
+</div>
+
+{% else %}
+
+<form action="/set/quiz" method="POST">
+<input type="submit" value="Aloita uusi kyselmä">
+</form>
+
+{% endif %}
+
+{% endif %}
diff --git a/templates/new_answer.html b/templates/new_answer.html
deleted file mode 100644
index 0d690d4..0000000
--- a/templates/new_answer.html
+++ /dev/null
@@ -1,7 +0,0 @@
-{% 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
deleted file mode 100644
index 92e166f..0000000
--- a/templates/nick.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{% include 'base.html' %}
-<form action="/set/nick" method="POST">
-Anna itsellesi nimimerkki ensin:
-<input type="text" name="nick">
-<input type="submit" value="Lähetä">
-</form>
diff --git a/templates/quiz.html b/templates/quiz.html
deleted file mode 100644
index 9e356c3..0000000
--- a/templates/quiz.html
+++ /dev/null
@@ -1,4 +0,0 @@
-{% include 'base.html' %}
-<form action="/set/quiz" method="POST">
-<input type="submit" value="Aloita uusi kyselmä">
-</form>