gaybook/templates/index.html

63 lines
No EOL
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>gaybook</title>
<link rel="stylesheet" href="/static/style.css">
<script src="/static/proof-of-work.js" defer></script>
</head>
<body>
<header>
<h1>The GayBook&trade;</h1>
<p>If you pass by, feel free to leave a message here!</p>
</header>
<main>
{% if message != "" %}
<section id="website-message">
<h1>Message from the website</h1>
<p>{{ message }}</p>
</section>
{% endif %}
<section>
<h1>Leave a quote!</h1>
<form method="POST">
<label for="username">Username:</label>
<input type="text" name="username" id="username" required>
<br>
<label for="message">Message:</label>
<textarea name="message" id="message" rows="5" required></textarea>
<br>
<label for="proof-of-work">Proof of work:</label>
<input type="text" name="proof-of-work" id="proof-of-work" required>
<button id="generate-pow" style="display: none">
Generate proof of work
</button>
<noscript>
<p>
You have Javascript disabled. You'll need to generate the proof-of-work manually.
<br>
Compute a nonce such that the ascii hex sha1 digest of
"$USERNAME\0$MESSAGE\0$NONCE" starts with 5 zeros. The nonce needs to be a base-10 integer
number encoded in ASCII.
Once you've verified the nonce works, enter it in base10 ascii in the "Proof of work" field.
</p>
</noscript>
<br>
<input type="submit" value="Publish">
</form>
</section>
<section>
<h1>Past quotes</h1>
{% for quote in quotes %}
<p>From: {{ quote.author }}, at {{ quote.timestamp }}</p>
<p>{{ quote.content }}</p>
<hr>
{% endfor %}
</section>
</main>
</body>
</html>