From 10e36dbb80c6d23baaee7b6083e33780e2ac5922 Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Tue, 22 Oct 2024 22:48:19 +0200 Subject: [PATCH] Add sort field to search form --- archivist/apps/sites/forms.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/archivist/apps/sites/forms.py b/archivist/apps/sites/forms.py index 63ecfac..919050c 100644 --- a/archivist/apps/sites/forms.py +++ b/archivist/apps/sites/forms.py @@ -27,6 +27,19 @@ class SearchForm(forms.Form): } ), ) + + sort = forms.ChoiceField( + label="Sort by", + choices=[('1', 'Date'), ('2', 'Views'), ('3', 'Likes'), ('4', 'Relevance')], + initial='1', + required=False, + widget=forms.Select( + attrs={ + 'class': 'form-select', + } + ) + ) + mature = forms.ChoiceField( label="Filter by Mature", choices=[('1', 'All'),('2', 'General'), ('3', 'Mature/Adult')],