blob: e37e0465efa9498f3bf0b0f0c8f3a5a34ef58b0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
{% extends "base.html" %}
{% block head %}
{{ super() }}
<script src="/static/js/htmx.min.js"></script>
<script>
htmx.config.responseHandling = [
{code: "204", swap: false},
{code: "3..", swap: false},
{code: "[45]..", swap: true, error: false},
{code: "...", swap: false},
];
</script>
<style>
#error-msg p {
color: red;
max-width: 400px;
text-align: center;
}
</style>
{% endblock %}
{% block content %}
<form hx-post="/admin/login" hx-swap="innerHTML" hx-target="#error-msg">
<label for="password">Password:</label>
<input type="password" name="password" />
<input type="submit" value="Submit" />
<div id="error-msg"></div>
</form>
{% endblock %}
|