summaryrefslogtreecommitdiff
path: root/web/kpov_judge/templates
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2019-02-24 21:05:27 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2019-02-24 21:05:27 +0100
commit8081a5520a441b43a8a7a73f3a90c7aacfaa8e10 (patch)
treec7f49bd33ed19d53afc0ee9df8b2c82c200c5910 /web/kpov_judge/templates
parent9963b74f777edf985540eac71b1ca095f88b8bca (diff)
Move everything one level up
Diffstat (limited to 'web/kpov_judge/templates')
-rw-r--r--web/kpov_judge/templates/class_tasks.html16
-rw-r--r--web/kpov_judge/templates/index.html16
-rw-r--r--web/kpov_judge/templates/params.html24
-rw-r--r--web/kpov_judge/templates/results.html15
-rw-r--r--web/kpov_judge/templates/task.html12
-rw-r--r--web/kpov_judge/templates/task_greeting.html141
6 files changed, 224 insertions, 0 deletions
diff --git a/web/kpov_judge/templates/class_tasks.html b/web/kpov_judge/templates/class_tasks.html
new file mode 100644
index 0000000..4b6a523
--- /dev/null
+++ b/web/kpov_judge/templates/class_tasks.html
@@ -0,0 +1,16 @@
+<html>
+<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
+
+<h1><a href="{{ url_for('index') }}" class="back">↩</a> {{clas.name}}</h1>
+
+<p>
+{{ _('Zdravo, %(student)s.', student=student_id) }}
+
+<section>
+<h1>{{ _('Naloge') }}</h1>
+
+<ul>
+{% for t in tasks %}
+ <li><a href="{{url_for('task_lang_redirect', class_id=clas.class_id, task_id=t)}}">{{t}}</a>
+{% endfor %}
+</ul>
diff --git a/web/kpov_judge/templates/index.html b/web/kpov_judge/templates/index.html
new file mode 100644
index 0000000..4c2ba47
--- /dev/null
+++ b/web/kpov_judge/templates/index.html
@@ -0,0 +1,16 @@
+<html>
+<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
+
+<h1>KPOV Judge</h1>
+
+<p>
+{{ _('Zdravo, %(student)s.', student=student_id) }}
+
+<section>
+<h1>{{ _('Predmeti') }}</h1>
+
+<ul>
+{% for c in classes %}
+ <li><a href="{{url_for('class_tasks', class_id=c.class_id)}}">{{c.name}}</a>
+{% endfor %}
+</ul>
diff --git a/web/kpov_judge/templates/params.html b/web/kpov_judge/templates/params.html
new file mode 100644
index 0000000..0648f66
--- /dev/null
+++ b/web/kpov_judge/templates/params.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<link rel="stylesheet" href="/static/style.css">
+</head>
+<body>
+<h1>
+{{task_id}}
+</h1>
+<div>
+<h2>Parametri</h2>
+<form action="" method="post">
+{% for k, v in params.items() %}
+<div><span class="hover">{{k}}: <div class="tooltip">{{params_meta[k]['descriptions']['si']}}</div></span>
+{% if params_meta[k]["w"] %}
+<input type=text name="{{k}}" value="{{v}}" />
+{% else %}
+{{v}}
+{% endif %}</div>
+{% endfor %}
+<p><input type=submit value="Submit"/></p>
+</form>
+</div>
+</body>
+</html>
diff --git a/web/kpov_judge/templates/results.html b/web/kpov_judge/templates/results.html
new file mode 100644
index 0000000..7f05208
--- /dev/null
+++ b/web/kpov_judge/templates/results.html
@@ -0,0 +1,15 @@
+<html>
+<body>
+<h1>
+{{task_id}}
+</h1>
+<p>
+<h2>Rezultati</h2>
+<ul>
+{% for k, v in results.items() %}
+<li>{{k}}: {{v}}</li>
+{% endfor %}
+</ul>
+</p>
+</body>
+</html>
diff --git a/web/kpov_judge/templates/task.html b/web/kpov_judge/templates/task.html
new file mode 100644
index 0000000..ddad5d8
--- /dev/null
+++ b/web/kpov_judge/templates/task.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<body>
+<h1>
+{{task_id}}
+</h1>
+<p>
+<pre>{{task}}</pre>
+</p>
+</body>
+</html>
diff --git a/web/kpov_judge/templates/task_greeting.html b/web/kpov_judge/templates/task_greeting.html
new file mode 100644
index 0000000..b10a49d
--- /dev/null
+++ b/web/kpov_judge/templates/task_greeting.html
@@ -0,0 +1,141 @@
+<!DOCTYPE html>
+<html lang="{{lang}}">
+<meta charset="utf-8">
+<title>KPOV Judge</title>
+
+<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
+<style>
+img.setup {
+ border: 1px solid black;
+ border-radius: 2px;
+ float: right;
+ max-width: 20em;
+ margin: 1em 0 0 1em;
+}
+section.instructions {
+ column-span: all;
+ border: 1px solid gray;
+ border-radius: 2px;
+ background-color: #eee;
+ color: black;
+ padding: 0 1em 1em;
+}
+div.two-columns {
+ columns: 2;
+ column-gap: 4em;
+}
+div.two-columns > section {
+ display: inline-block;
+}
+section.disks > section > h1 {
+ margin-bottom: 0;
+}
+section ul {
+ list-style-position: inside;
+ margin: 0;
+ margin-left: 1em;
+ padding-left: 0;
+}
+section > ul {
+ margin-top: 0.5em;
+}
+</style>
+
+<h1>
+<a href="{{ url_for('class_tasks', class_id=class_id) }}" class="back">↩</a> {{task_id}}
+ <span style="font-size: 50%; font-weight: normal;">[
+{% for lang in ('en', 'si') %}
+<a href="{{ url_for('task_greeting', class_id=class_id, task_id=task_id, lang=lang) }}">{{lang}}</a>
+{% endfor %}
+]</span>
+</h1>
+
+<section class="instructions">
+<a href="setup.png"><img src="setup.png" class="setup" alt="{{ _('Shema omrežja za nalogo.') }}"></a>
+<h2>{{ _('Naloga') }}</h2>
+
+{% include instructions %}
+
+<p>
+<a href="howto/">{{ _('Podrobna navodila.') }}</a>
+<br style="clear: both;">
+</section>
+
+<div class="two-columns">
+<section class="disks">
+<h2>{{ _('Računalniki') }}</h2>
+{% if computers %}
+<dl>
+ {% for c in computers %}
+ <dt>{{c['name']}}
+ <dd><ul>
+ {% for name, disk in c['disk_urls'].items() %}
+ <li>{{name}} [ {% for fmt in disk['formats'] %}<a href="{{disk_base_url+disk[fmt][0]}}">{{fmt}}</a> {% endfor %}]
+ {% else %}
+ {% endfor %}
+ </ul></dd>
+{% endfor %}
+</dl>
+
+<p>
+
+{{ _('Za GNS3 uporabite slike v formatu qcow2, za katere rabite še zaledne datoteke (angl. <em lang=\"en\">backing files</em>). Za VirtualBox uporabite slike VMDK, ki ne podpirajo zalednih datotek in so zato precej večje. Namesto prenosa lahko slike VMDK <a href=\"/faq/#convert-disk-image\">pretvorite iz formata qcow2</a>.') }}
+
+{% if backing_files %}
+<section>
+<h3>{{ _('Zaledne datoteke') }}</h3>
+<p>
+{{ _('Vsako od spodnjih slik prenesete samo pri prvi nalogi, v kateri se pojavi. Vse datoteke morajo biti v istem imeniku.') }}
+
+<dl>
+{% for fmt, images in backing_files.items() %}
+ {% if images %}
+ <dt>{{fmt}}
+ <dd><ul>
+ {% for image in images %}
+ <li><a href="{{disk_base_url+image}}">{{image}}</a></li>
+ {% endfor %}
+ </ul></dd>
+ {% endif %}
+{% endfor %}
+</dl>
+</section>
+{% endif %}
+
+{% else %}
+ <p>{{ _('Slike navideznih diskov so v izdelavi in bodo kmalu na voljo.') }}
+{% endif %}
+</section>
+
+<section>
+<h2>{{ _('Status') }}</h2>
+<p>
+{% if result is none %}
+{{ _('Naloga nima še nobenega poskusa.') }}
+{% elif result['result'] == 10 %}
+{{ _('Naloga je uspešno opravljena dne %(time)s.', time=result['time']) }}
+{% else %}
+{{ _('Naloga še ni opravljena, najvišji rezultat je %(score)s.', score=result['result']) }}
+{% endif %}
+
+<p>
+<a href="../task.html">{{ _('Program za preverjanje.') }}</a>
+
+<h3>{{ _('Parametri') }}</h2>
+<dl>
+{% for p in params if p['value'] %}
+ <dt><em>{{ p['name'] }}</em>{% if p['description'] %} … <small>{{ p['description'] }}</small>{% endif %}</dt>
+ <dd><code>{{ p['value'] }}</code></dd>
+{% endfor %}
+</dl>
+</section>
+</div>
+
+{#
+<p>
+{% if openstack %}
+Openstack projekt za to vajo je že ustvarjen ali v izdelavi (funkcionalnost še ne deluje).
+{% else %}
+<a href='?narediStack=true'>Ustvari</a> Openstack projekt za to vajo (funkcionalnost še ne deluje).
+{% endif %}
+#}