From a46192566fdf6cbc333d02a19d255ae3eb01e486 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Thu, 6 Apr 2023 18:42:04 +0000 Subject: [PATCH] Pagination I hate math --- .../static/sass/components/buttons/pill.sass | 19 +++++++++ gallery/templates/image.html | 3 +- gallery/templates/index.html | 41 ++++++++++++++++--- gallery/templates/layout.html | 2 +- gallery/views/image.py | 25 ++++++++++- gallery/views/index.py | 33 +++++++++++---- 6 files changed, 108 insertions(+), 15 deletions(-) diff --git a/gallery/static/sass/components/buttons/pill.sass b/gallery/static/sass/components/buttons/pill.sass index e98fa1a..3259b4e 100644 --- a/gallery/static/sass/components/buttons/pill.sass +++ b/gallery/static/sass/components/buttons/pill.sass @@ -19,6 +19,25 @@ background-color: RGB($bg-100) border-radius: $rad +.pill-text + margin: 0 + padding: 0.5rem + + width: auto + height: 2.5rem + + display: flex + justify-content: center + align-items: center + + position: relative + + text-align: center + font-size: 1rem + font-weight: 500 + + color: RGB($fg-white) + .pill-item margin: 0 padding: 0.5rem diff --git a/gallery/templates/image.html b/gallery/templates/image.html index 6db7ec5..e651835 100644 --- a/gallery/templates/image.html +++ b/gallery/templates/image.html @@ -1,5 +1,6 @@ {% extends 'layout.html' %} -{% block wrapper_class %}image-wrapper{% endblock %} +{% block page_index %} +{% if return_page > 1 %}?page={{ return_page }}{% endif %}{% endblock %} {% block head %} diff --git a/gallery/templates/index.html b/gallery/templates/index.html index d40af43..6f77592 100644 --- a/gallery/templates/index.html +++ b/gallery/templates/index.html @@ -4,15 +4,46 @@ + {% if images %}