ftracker/web/index.html

77 lines
2.7 KiB
HTML
Raw Normal View History

2020-12-01 13:08:40 +01:00
<!DOCTYPE html>
<html>
<head>
<title>FTracker</title>
<meta charset="utf-8">
2020-12-01 15:34:09 +01:00
<meta name="theme-color" content="#c50e1f">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="style.css" rel="stylesheet" type="text/css">
2020-12-01 13:08:40 +01:00
<script>
// 1st script, prepares values needed for writing document
2020-12-01 13:08:40 +01:00
var cbt = {
2020-12-01 14:06:05 +01:00
'arrival': 'I have read and will adhere to the <a href="/guidelines" target="_blank">protection guidelines</a>',
2020-12-01 13:08:40 +01:00
'departure': 'I have cleaned my workspace'
}
var testCheckBox = '<label class="checkbox"><input type="checkbox" name="tested" id="tested"><span>I have been tested negative for COVID in the last 24 hours</span></label>'
2020-12-01 13:08:40 +01:00
function getParams() {
var h = document.location.href
var qparam = h.split('?')[1] || null
2020-12-03 22:28:14 +01:00
if (qparam == null)
2020-12-01 13:08:40 +01:00
return null
var vals = qparam.split('=')
2020-12-03 22:28:14 +01:00
if (vals.length < 2 || !cbt.hasOwnProperty(vals[0]))
2020-12-01 13:08:40 +01:00
return null
return {
action: vals[0],
room: vals[1]
}
}
var qp = getParams()
</script>
</head>
<body>
2020-12-01 15:34:09 +01:00
<h1><script>
2020-12-03 22:28:14 +01:00
if (qp)
document.write(qp.action + "<br>Room " + qp.room)
else
document.write('FTracker<br>V1')
2020-12-01 15:34:09 +01:00
</script></h1>
<div id="startpage">
This is a web app to track which people
were in the same rooms at which times in order to backtrace
potential viral infections.<br><br>
If you've reached this page that either means your're
testing things or something has gone quite wrong with the\
URL.<br>
In the former case: Yay it works! In the latter you should
probably contact an admin or a dev nearby :(<br><br>
Here are a few links for testing:<br>
<a href="/view">View Data</a>,
<a href="/QRgen">Door Sign Generator</a>,
<a href="/?arrival=42">Test Arrival</a>,
<a href="/?departure=42">Test Departure</a><br><br>
&copy; 2020 made by <a target="_blank" href="mailto:&#111;&#46;&#119;&#105;&#110;&#107;&#101;&#108;&#115;&#64;&#102;&#97;&#115;&#116;&#116;&#117;&#98;&#101;&#46;&#100;&#101;">Oskar</a> \
for <a target="_blank" href="//fasttube.de">FaSTTUBe</a>.<br>
For source code & licensing see <a href="//git.fasttube.de/FaSTTUBe/ftracker">git repo</a>
</div>
<form id="mainform" style="display: none">
2020-12-01 15:34:09 +01:00
<label>
Full Name:<br>
<input type="text" name="name" id="name" placeholder="John Doe" required>
</label>
<label class="checkbox">
2020-12-01 15:34:09 +01:00
<input type="checkbox" name="agree" id="agree" required>
2020-12-03 22:28:14 +01:00
<span><script>
document.write(qp ? cbt[qp.action] : '')
</script></span>
2020-12-01 15:34:09 +01:00
</label>
<script>
if (qp && qp.action == 'arrival')
document.write(testCheckBox)
</script>
2020-12-01 15:34:09 +01:00
<input type="submit">
</form>
<script src="main.js"></script>
2020-12-01 13:08:40 +01:00
</body>
</html>