81 lines
2.4 KiB
HTML
81 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
|
<title>Samey</title>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<article>
|
|
<h2>Search</h2>
|
|
<form method="get" action="/posts/1">
|
|
<input
|
|
class="tags"
|
|
type="text"
|
|
id="search-tags"
|
|
name="tags"
|
|
hx-post="/search_tags"
|
|
hx-trigger="input changed delay:400ms"
|
|
hx-target="next .tags-autocomplete"
|
|
hx-on::after-settle="this.focus(); this.setSelectionRange(-1, -1);"
|
|
autofocus
|
|
/>
|
|
<ul class="tags-autocomplete" id="search-autocomplete"></ul>
|
|
<button type="submit">Search</button>
|
|
</form>
|
|
</article>
|
|
{% if let Some(user) = user %}
|
|
<article>
|
|
<h2>Upload media</h2>
|
|
<form method="post" action="/upload" enctype="multipart/form-data">
|
|
<input
|
|
class="tags"
|
|
type="text"
|
|
id="upload-tags"
|
|
name="tags"
|
|
hx-post="/search_tags"
|
|
hx-trigger="input changed delay:400ms"
|
|
hx-target="next .tags-autocomplete"
|
|
hx-on::after-settle="this.focus(); this.setSelectionRange(-1, -1);"
|
|
/>
|
|
<ul class="tags-autocomplete" id="upload-autocomplete"></ul>
|
|
<input
|
|
type="file"
|
|
id="media-file"
|
|
name="media-file"
|
|
accept=".jpg, .jpeg, .png, .webp, .gif"
|
|
/>
|
|
<button type="submit">Submit</button>
|
|
</form>
|
|
</article>
|
|
<article>
|
|
<h2>Create pool</h2>
|
|
<form method="post" action="/pool">
|
|
<input class="tags" type="text" id="pool-name" name="name" />
|
|
<button type="submit">Submit</button>
|
|
</form>
|
|
</article>
|
|
<article>
|
|
<a href="/logout">Log out</a>
|
|
</article>
|
|
{% else %}
|
|
<article>
|
|
<h2>Log in</h2>
|
|
<form method="post" action="/login">
|
|
<div>
|
|
<label>Username</label>
|
|
<input id="username" type="text" name="username" />
|
|
</div>
|
|
<div>
|
|
<label>Password</label>
|
|
<input id="password" type="password" name="password" />
|
|
</div>
|
|
<button type="submit">Submit</button>
|
|
</form>
|
|
</article>
|
|
{% endif %}
|
|
</main>
|
|
</body>
|
|
</html>
|