2026-07-12 20:22:15 +01:00

139 lines
3.1 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Terrible Working Environment — Post {{ post_id }}</title>
<style>
body {
margin: 0;
background: #d9f3e1; /* pale Xmas green */
color: #000000;
font-family: Verdana, Arial, sans-serif;
}
.page {
max-width: 800px;
margin: 20px auto;
padding: 12px 16px 18px;
background: #ffffff;
border: 3px solid #c00000; /* Xmas red */
}
.subtitle {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1px;
color: #006600;
margin-bottom: 4px;
}
h1 {
font-size: 20px;
margin: 6px 0 10px;
color: #900000;
}
h2 {
font-size: 15px;
margin: 16px 0 8px;
color: #006600;
}
p {
font-size: 13px;
line-height: 1.4;
margin: 6px 0 14px;
color: #333333;
}
form {
display: flex;
flex-direction: column;
gap: 8px;
max-width: 600px;
margin-top: 4px;
}
input[type="text"],
textarea {
width: 100%;
border: 1px solid #cc9999;
background: #fffdfd;
color: #000000;
padding: 6px 8px;
font-family: inherit;
font-size: 13px;
}
textarea {
resize: vertical;
}
input[type="submit"] {
margin-top: 4px;
background: #c00000;
border: 1px solid #800000;
color: #ffffff;
padding: 6px 12px;
font-size: 13px;
font-weight: bold;
cursor: pointer;
}
input[type="submit"]:hover {
background: #a00000;
}
ul {
list-style: none;
padding: 0;
margin: 0;
margin-top: 10px;
border-top: 1px solid #cc9999;
padding-top: 10px;
}
li {
font-size: 13px;
padding: 6px 0;
border-bottom: 1px solid #f0d0d0;
}
strong {
font-weight: bold;
}
span {
color: #000000;
}
a {
color: #a00000;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="page">
<div class="subtitle">North Pole Blog</div>
<h1>Terrible Working Environment — Post {{ post_id }}</h1>
<p>Readers may leave anonymous elf notes below.</p>
<h2>Leave a comment</h2>
<form method="post" action="/comment" onsubmit="return validateForm()">
<input type="text" name="name" placeholder="Name" required>
<textarea name="comment" placeholder="Write something..." rows="6" required></textarea>
<input type="submit" value="Post comment">
</form>
<h2>Comments</h2>
<ul>
{% for c in comments %}
<li><strong>{{ c.name }}</strong>: <span>{{ c.comment|safe }}</span></li>
{% endfor %}
</ul>
</div>
<script>
function validateForm() {
var name = document.querySelector('input[name="name"]').value.trim();
var comment = document.querySelector('textarea[name="comment"]').value.trim();
if (!name || !comment) {
alert("Both name and comment are required.");
return false;
}
return true;
}
</script>
</body>
</html>