68 lines
1.4 KiB
HTML
68 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Simple BBS</title>
|
|
</head>
|
|
<body>
|
|
<ul>
|
|
{% for post in posts %}
|
|
<li><span class="user-post">{{ post }}</span></li>
|
|
{% endfor %}
|
|
</ul>
|
|
<form action="/submit" method="post">
|
|
<input type="hidden" name="handle" id="handleInput">
|
|
<textarea name="content" required></textarea>
|
|
<input type="submit" value="Post">
|
|
</form>
|
|
</body>
|
|
|
|
<script>
|
|
function getHandleFromUrl() {
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
return urlParams.get('handle');
|
|
}
|
|
window.onload = function() {
|
|
const handle = getHandleFromUrl();
|
|
if (handle) {
|
|
document.getElementById('handleInput').value = handle;
|
|
} else {
|
|
document.getElementById('handleInput').value = "anonymous";
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
li {
|
|
width: 100%;
|
|
list-style: none;
|
|
padding: 10px 0px;
|
|
border-bottom: 1px solid #ccc;
|
|
}
|
|
textarea {
|
|
width: 100%;
|
|
border-radius: 5px;
|
|
resize: none;
|
|
border-bottom: 3px solid #2e7b96;
|
|
box-sizing: border-box;
|
|
}
|
|
input[type="submit"] {
|
|
border-radius: 5px;
|
|
width: 100%;
|
|
color: #fff;
|
|
background: #bb1a1a;
|
|
border: none;
|
|
padding: 10px;
|
|
}
|
|
ul {
|
|
border-radius: 5px;
|
|
padding: 0px;
|
|
margin: 0 auto;
|
|
border: 1px solid #ccc;
|
|
}
|
|
span.user-post {
|
|
padding: 0px 10px;
|
|
}
|
|
</style>
|
|
|
|
</html>
|