From ec20d2e4fdab339572655a3ff1591ceeaaccc110 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Sun, 17 Nov 2024 12:36:08 +1100 Subject: [PATCH] Add slideshow page --- data/db.sqlite3 | Bin 241664 -> 241664 bytes links/collection_views.py | 5 + links/templates/links/collection_detail.html | 9 + .../templates/links/collection_slideshow.html | 222 ++++++++++++++++++ links/urls.py | 6 + new_theme/static/css/dist/styles.css | 5 + templates/base_blank.html | 18 ++ 7 files changed, 265 insertions(+) create mode 100644 links/templates/links/collection_slideshow.html create mode 100644 templates/base_blank.html diff --git a/data/db.sqlite3 b/data/db.sqlite3 index 3ba7c3e40780a033a788c669da87b0457f120707..3230a491d0fa3700cb34416bf4e759afc37ba995 100644 GIT binary patch delta 807 zcmb7?yKWOf6o#{F0?96!B@#s>TsVp)8pb|z*}1qtifAIh@CJ!zc4kd1nHb`R${~_# zE{$J+hB`)DQ1KR|O6v5q7MnyM6a`t)NN0+3q<_vg-@z$5I7J^H1ZSVBPlB`eopC4l z)(OA7T#Ha|0ewKdq)0v|{bVcIKr?iVrbndq0!@mOupY#hS2USzhxOv;cKGPWTC}*j zfYw*=T^+Y0v)o^LcV~S2+2ZPvx%cbV=upOSySs9@yk6PdY-^DL<$?n#3lZ8_aG9i9 zXSp<5`L2KM-#IF&#`1o zVeWupLyg5$%hZf0Na~Df0%y$fOkwY-$J_v5rKQ8xI%aaq7~!gU^Y~_O;JbnSO3Sq{ zA(+S-kQQStfCeL)RvG(WOTy&)NmwfhMgI^Y)Hdk c0&3p^GzMrK-%X%_%KXY;gSKz6WA-To083LTL;wH) diff --git a/links/collection_views.py b/links/collection_views.py index e4ef3d7..8a08bca 100644 --- a/links/collection_views.py +++ b/links/collection_views.py @@ -44,3 +44,8 @@ class CollectionDeleteView(DeleteView): def delete(self, request, *args, **kwargs): messages.success(request, _('Collection deleted successfully.')) return super().delete(request, *args, **kwargs) + +class CollectionSlideshowView(DetailView): + model = ImageCollection + template_name = 'links/collection_slideshow.html' + context_object_name = 'collection' diff --git a/links/templates/links/collection_detail.html b/links/templates/links/collection_detail.html index 94b5932..360cb16 100644 --- a/links/templates/links/collection_detail.html +++ b/links/templates/links/collection_detail.html @@ -69,6 +69,15 @@ {% trans "Delete Collection" %} + diff --git a/links/templates/links/collection_slideshow.html b/links/templates/links/collection_slideshow.html new file mode 100644 index 0000000..20ce6dd --- /dev/null +++ b/links/templates/links/collection_slideshow.html @@ -0,0 +1,222 @@ +{% extends 'base_blank.html' %} +{% load i18n %} +{% load static %} + +{% block extra_css %} + +{% endblock %} + +{% block content %} +
+
+ + {% for image in collection.images.all %} +
+ {{ image.title }} +
+ {% endfor %} + +
+ + + + +
+
+{% endblock %} + +{% block extra_js %} + +{% endblock %} diff --git a/links/urls.py b/links/urls.py index 6a7518f..d9e3b22 100644 --- a/links/urls.py +++ b/links/urls.py @@ -3,6 +3,7 @@ from . import views from . import page_views from . import search_views from . import newsletter_views +from . import collection_views urlpatterns = [ # Regular UI URLs @@ -50,4 +51,9 @@ urlpatterns = [ path('/', views.redirect_to_original, name='redirect_to_original'), path('//', views.redirect_to_original, name='redirect_to_original_with_param'), path('alias//', views.LinkDetailView.as_view(), name='link_detail_by_alias'), + + # Collection slideshow + path('ui/collections//slideshow/', + collection_views.CollectionSlideshowView.as_view(), + name='collection-slideshow'), ] diff --git a/new_theme/static/css/dist/styles.css b/new_theme/static/css/dist/styles.css index 3e84b9f..1bcdfe3 100644 --- a/new_theme/static/css/dist/styles.css +++ b/new_theme/static/css/dist/styles.css @@ -1340,6 +1340,11 @@ video { background-color: rgb(254 249 195 / var(--tw-bg-opacity)); } +.bg-green-600 { + --tw-bg-opacity: 1; + background-color: rgb(22 163 74 / var(--tw-bg-opacity)); +} + .bg-opacity-50 { --tw-bg-opacity: 0.5; } diff --git a/templates/base_blank.html b/templates/base_blank.html new file mode 100644 index 0000000..d6cb349 --- /dev/null +++ b/templates/base_blank.html @@ -0,0 +1,18 @@ + + + + + + {% block title %}{% endblock %} + + {% load static %} + + + {% block extra_css %}{% endblock %} + + + {% block content %}{% endblock %} + + {% block extra_js %}{% endblock %} + +