Compare commits
No commits in common. "6b2345a726e4a8b59adf3ab10e4bdacece433700" and "d50b0bd8de90fe59ed9c3206e9eb35fd33459b4b" have entirely different histories.
6b2345a726
...
d50b0bd8de
3 changed files with 23 additions and 101 deletions
|
@ -93,9 +93,28 @@
|
||||||
|
|
||||||
{% if q is not defined and "s=newest" not in request.url %} <a href="/?s=newest">Sort by newest</a> {% endif %}
|
{% if q is not defined and "s=newest" not in request.url %} <a href="/?s=newest">Sort by newest</a> {% endif %}
|
||||||
|
|
||||||
<form action="upload">
|
<details>
|
||||||
<input type="submit" value="Upload an image" />
|
<summary>Or post an image</summary>
|
||||||
|
|
||||||
|
<form method="POST" enctype="multipart/form-data">
|
||||||
|
<label for="desc">Image description:</label>
|
||||||
|
<input type="text" name="desc" id="desc" placeholder="description" autocomplete="off" maxlength="{{ desc_len }}" />
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<label for="key">Access key:</label>
|
||||||
|
<input type="password" name="key" id="key" placeholder="key" maxlength="{{ key_len }}" required />
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<label for="image">Image:</label>
|
||||||
|
<input type="file" accept="image/*" name="image" id="image" placeholder="the image" required />
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<button type="post">Post</button>
|
||||||
</form>
|
</form>
|
||||||
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
|
||||||
{% if title is defined %}
|
|
||||||
<title>Imag - {{ title | escape }}</title>
|
|
||||||
<meta name="description" content="The Imag image board | {{ title | escape }}" />
|
|
||||||
{% else %}
|
|
||||||
<title>Imag</title>
|
|
||||||
<meta name="description" content="The Imag image board" />
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<meta
|
|
||||||
name="keywords"
|
|
||||||
content="imageboard, image board, image, image hosting"
|
|
||||||
/>
|
|
||||||
<meta
|
|
||||||
name="robots"
|
|
||||||
content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"
|
|
||||||
/>
|
|
||||||
<meta property="og:type" content="website" />
|
|
||||||
|
|
||||||
<meta name="color-scheme" content="dark" />
|
|
||||||
<meta name="theme-color" content="black" />
|
|
||||||
|
|
||||||
<meta name="license" content="WTFPL" />
|
|
||||||
|
|
||||||
<!-- preloads the css ( technically you can replace it with a style tag -->
|
|
||||||
<link
|
|
||||||
href="{{ url_for("static", filename="index.css") }}"
|
|
||||||
rel="preload"
|
|
||||||
referrerpolicy="no-referrer"
|
|
||||||
type="text/css"
|
|
||||||
as="style"
|
|
||||||
onload="this.onload=null;this.rel='stylesheet'"
|
|
||||||
/>
|
|
||||||
<noscript>
|
|
||||||
<link
|
|
||||||
href="{{ url_for("static", filename="index.css") }}"
|
|
||||||
rel="stylesheet"
|
|
||||||
referrerpolicy="no-referrer"
|
|
||||||
type="text/css"
|
|
||||||
/>
|
|
||||||
</noscript>
|
|
||||||
|
|
||||||
<script src="{{ url_for("static", filename="index.js") }}" defer></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h1>The <a href="https://git.everypizza.im/n/imag/src/branch/main">Imag</a> image board ({{ imagv }}). | upload</h1>
|
|
||||||
<center>
|
|
||||||
Matrix chat: <a href="https://matrix.to/#/#quotes:everypizza.im">#quotes:everypizza.im</a> |
|
|
||||||
Matrix bot: <a href="https://matrix.to/#/@quotes:everypizza.im">@quotes:everypizza.im</a> <br>
|
|
||||||
<hr class="thin">
|
|
||||||
<small>
|
|
||||||
There's a very WIP complete rewrite of the bot in Python currently:
|
|
||||||
<a href="https://matrix.to/#/@quotes-python:everypizza.im">@quotes-python:everypizza.im</a>
|
|
||||||
</small>
|
|
||||||
</center>
|
|
||||||
<hr class="tiny">
|
|
||||||
<center>
|
|
||||||
<small>
|
|
||||||
Board message: {{ imagmessage }}
|
|
||||||
</small>
|
|
||||||
</center>
|
|
||||||
<hr class="thin">
|
|
||||||
<form method="POST" enctype="multipart/form-data">
|
|
||||||
<label for="desc">Image description:</label>
|
|
||||||
<input type="text" name="desc" id="desc" placeholder="description" autocomplete="off" maxlength="{{ desc_len }}" />
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<label for="key">Access key:</label>
|
|
||||||
<input type="password" name="key" id="key" placeholder="key" maxlength="{{ key_len }}" required />
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<label for="image">Image:</label>
|
|
||||||
<input type="file" accept="image/*" name="image" id="image" placeholder="the image" required />
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<button onclick="history.back()">Back</button>
|
|
||||||
<button type="post">Post</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -25,15 +25,8 @@ def index() -> str:
|
||||||
images=models.Image.query.order_by((models.Image.created if flask.request.args.get("s") == "newest" else models.Image.score).desc()).all(), # type: ignore
|
images=models.Image.query.order_by((models.Image.created if flask.request.args.get("s") == "newest" else models.Image.score).desc()).all(), # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
@views.get("/upload")
|
|
||||||
def upload() -> str:
|
|
||||||
"""upload page"""
|
|
||||||
return flask.render_template(
|
|
||||||
"upload.j2",
|
|
||||||
images=models.Image.query.order_by((models.Image.created if flask.request.args.get("s") == "newest" else models.Image.score).desc()).all(), # type: ignore
|
|
||||||
)
|
|
||||||
|
|
||||||
@views.post("/upload")
|
@views.post("/")
|
||||||
@util.with_access(models.AccessLevel.write)
|
@util.with_access(models.AccessLevel.write)
|
||||||
def post_image() -> Response:
|
def post_image() -> Response:
|
||||||
"""post image"""
|
"""post image"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue