From 6f49244dbd8efc9f16c27bf0f87acae3c38eec45 Mon Sep 17 00:00:00 2001 From: nyx Date: Sun, 2 Feb 2025 20:51:25 -0600 Subject: [PATCH 1/4] Split off upload --- src/imag/templates/upload.j2 | 90 ++++++++++++++++++++++++++++++++++++ src/imag/views.py | 9 +++- 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 src/imag/templates/upload.j2 diff --git a/src/imag/templates/upload.j2 b/src/imag/templates/upload.j2 new file mode 100644 index 0000000..7a03d80 --- /dev/null +++ b/src/imag/templates/upload.j2 @@ -0,0 +1,90 @@ + + + + + + + + {% if title is defined %} + Imag - {{ title | escape }} + + {% else %} + Imag + + {% endif %} + + + + + + + + + + + + + + + + + + +

The Imag image board ({{ imagv }}). | upload

+
+ Matrix chat: #quotes:everypizza.im | + Matrix bot: @quotes:everypizza.im
+
+ + There's a very WIP complete rewrite of the bot in Python currently: + @quotes-python:everypizza.im + +
+
+
+ + Board message: {{ imagmessage }} + +
+
+
+ + + +
+ + + + +
+ + + + +
+ + +
+ + + diff --git a/src/imag/views.py b/src/imag/views.py index 33a7359..424011f 100644 --- a/src/imag/views.py +++ b/src/imag/views.py @@ -25,8 +25,15 @@ 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 ) +@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("/") +@views.post("/upload") @util.with_access(models.AccessLevel.write) def post_image() -> Response: """post image""" From d348ba7a2ea98d9fbad4f71069011c0ced7348e9 Mon Sep 17 00:00:00 2001 From: nyx Date: Sun, 2 Feb 2025 20:52:00 -0600 Subject: [PATCH 2/4] Fix formatting --- src/imag/templates/upload.j2 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/imag/templates/upload.j2 b/src/imag/templates/upload.j2 index 7a03d80..ca397eb 100644 --- a/src/imag/templates/upload.j2 +++ b/src/imag/templates/upload.j2 @@ -67,24 +67,24 @@
-
- - + + + -
+
- - + + -
+
- - + + -
+
- -
+ + From d9ceca8b77c90d28bbdd4ae201a7dea853316216 Mon Sep 17 00:00:00 2001 From: nyx Date: Sun, 2 Feb 2025 20:54:43 -0600 Subject: [PATCH 3/4] Add upload button --- src/imag/templates/index.j2 | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/imag/templates/index.j2 b/src/imag/templates/index.j2 index 0448305..52b11f9 100644 --- a/src/imag/templates/index.j2 +++ b/src/imag/templates/index.j2 @@ -93,28 +93,9 @@ {% if q is not defined and "s=newest" not in request.url %} Sort by newest {% endif %} -
- Or post an image - -
- - - -
- - - - -
- - - - -
- - -
-
+
+ +

From d7a54202b3e280eb1276f05854464378c1bd87e5 Mon Sep 17 00:00:00 2001 From: nyx Date: Sun, 2 Feb 2025 20:56:54 -0600 Subject: [PATCH 4/4] Add a back button --- src/imag/templates/upload.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imag/templates/upload.j2 b/src/imag/templates/upload.j2 index ca397eb..ae55fbb 100644 --- a/src/imag/templates/upload.j2 +++ b/src/imag/templates/upload.j2 @@ -82,7 +82,7 @@
- +