From 6b6a5e0e13b762d7796f57d2042cb8f57b98745d Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Thu, 17 Oct 2024 20:34:34 +0200 Subject: [PATCH 1/9] Added bootstrap5 --- bartenders/forms.py | 1 + .../migrations/0003_auto_20241017_2029.py | 49 +++++++++++++++++++ bartenders/models.py | 18 +++---- bartenders/templates/ballots.html | 2 +- bartenders/templates/ballots_update.html | 6 ++- bartenders/templates/bartender_info.html | 10 ++-- bartenders/templates/index.html | 6 ++- events/forms.py | 4 ++ events/templates/events.html | 6 ++- fredagscafeen/settings/base.py | 7 +-- requirements.in | 2 +- requirements.txt | 4 +- udlejning/forms.py | 1 + udlejning/templates/udlejning.html | 6 ++- web/static/css/stylesheet.css | 5 ++ web/templates/base.html | 2 +- web/templates/login.html | 6 ++- 17 files changed, 105 insertions(+), 30 deletions(-) create mode 100644 bartenders/migrations/0003_auto_20241017_2029.py diff --git a/bartenders/forms.py b/bartenders/forms.py index a0abf87..eb42861 100644 --- a/bartenders/forms.py +++ b/bartenders/forms.py @@ -23,6 +23,7 @@ class Meta: def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.fields["tshirt_size"].widget.attrs.update({"class": "form-control"}) for name in self.fields: self.fields[name].required = name != "info" diff --git a/bartenders/migrations/0003_auto_20241017_2029.py b/bartenders/migrations/0003_auto_20241017_2029.py new file mode 100644 index 0000000..4056b66 --- /dev/null +++ b/bartenders/migrations/0003_auto_20241017_2029.py @@ -0,0 +1,49 @@ +# Generated by Django 3.2.4 on 2024-10-17 18:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bartenders", "0002_ballotlink_poll"), + ] + + operations = [ + migrations.AlterField( + model_name="bartender", + name="tshirt_size", + field=models.IntegerField( + blank=True, + choices=[ + (0, "XS"), + (1, "S"), + (2, "M"), + (3, "L"), + (4, "XL"), + (5, "XXL"), + (6, "XXXL"), + ], + null=True, + verbose_name="T-shirt størrelse", + ), + ), + migrations.AlterField( + model_name="bartenderapplication", + name="tshirt_size", + field=models.IntegerField( + blank=True, + choices=[ + (0, "XS"), + (1, "S"), + (2, "M"), + (3, "L"), + (4, "XL"), + (5, "XXL"), + (6, "XXXL"), + ], + null=True, + verbose_name="T-shirt størrelse", + ), + ), + ] diff --git a/bartenders/models.py b/bartenders/models.py index c0bb11b..e46fb63 100644 --- a/bartenders/models.py +++ b/bartenders/models.py @@ -2,6 +2,7 @@ from enum import IntEnum from urllib.parse import urljoin +from django import forms from django.conf import settings from django.db import models from django.db.models import Q @@ -36,13 +37,13 @@ def date_format(dt, format): # but we enforce that in BartenderApplicationForm for new applications. class BartenderCommon(models.Model): TSHIRT_SIZE_CHOICES = ( - ("XS", "XS"), - ("S", "S"), - ("M", "M"), - ("L", "L"), - ("XL", "XL"), - ("XXL", "XXL"), - ("XXXL", "XXXL"), + (0, "XS"), + (1, "S"), + (2, "M"), + (3, "L"), + (4, "XL"), + (5, "XXL"), + (6, "XXXL"), ) class Meta: @@ -59,9 +60,8 @@ class Meta: phoneNumber = models.IntegerField( blank=True, null=True, verbose_name=_("Telefonnummer") ) - tshirt_size = models.CharField( + tshirt_size = models.IntegerField( choices=TSHIRT_SIZE_CHOICES, - max_length=10, blank=True, null=True, verbose_name=_("T-shirt størrelse"), diff --git a/bartenders/templates/ballots.html b/bartenders/templates/ballots.html index 325a135..92a0903 100644 --- a/bartenders/templates/ballots.html +++ b/bartenders/templates/ballots.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load static %} -{% load bootstrap3 %} +{% load bootstrap5 %} {% block content %} diff --git a/bartenders/templates/ballots_update.html b/bartenders/templates/ballots_update.html index cbe49c1..60fac06 100644 --- a/bartenders/templates/ballots_update.html +++ b/bartenders/templates/ballots_update.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load i18n %} {% load static %} -{% load bootstrap3 %} +{% load bootstrap5 bootstrap_icons %} {% block content %} @@ -16,7 +16,9 @@

Tilføj poll

{% bootstrap_form form %} {% buttons %} {% translate "Gem" as BUTTON_TEXT %} - {% bootstrap_button BUTTON_TEXT button_type="submit" icon="floppy-disk" button_class="btn-primary" %} + {% endbuttons %} diff --git a/bartenders/templates/bartender_info.html b/bartenders/templates/bartender_info.html index 427e64a..9a05a93 100644 --- a/bartenders/templates/bartender_info.html +++ b/bartenders/templates/bartender_info.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load i18n %} {% load static %} -{% load bootstrap3 %} +{% load bootstrap5 bootstrap_icons %} {% block extrahead %} + diff --git a/web/templates/secrets_admin.html b/web/templates/secrets_admin.html index 716eb10..a292040 100644 --- a/web/templates/secrets_admin.html +++ b/web/templates/secrets_admin.html @@ -1,5 +1,8 @@ {% extends "admin/base_site.html" %} +{% load i18n %} +{% load bootstrap_icons %} {% block content %} +
@@ -22,9 +25,11 @@ {% endfor %}
Django key {% if value != None %} {{ value }} - + {% else %} - Missing from environment + {% translate "Missing from environment" %} {% endif %} @@ -37,19 +42,20 @@
- + }); + } + {% endblock %} diff --git a/web/views.py b/web/views.py index 506ab8b..f6a8ffc 100644 --- a/web/views.py +++ b/web/views.py @@ -2,7 +2,7 @@ from django.contrib import messages from django.contrib.auth import REDIRECT_FIELD_NAME, authenticate, login, logout from django.shortcuts import redirect -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.decorators.http import require_GET, require_POST from django.views.generic import TemplateView from django.views.generic.edit import FormView From 6873f6ac06d99f91c769fa15b3d942bc3af8a661 Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 00:03:45 +0200 Subject: [PATCH 4/9] Update requirements --- requirements.in | 5 +++-- requirements.txt | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/requirements.in b/requirements.in index 04a2a7d..246abf4 100644 --- a/requirements.in +++ b/requirements.in @@ -1,7 +1,8 @@ -django==3.* +django==5.* python-dotenv djangorestframework dj-config-url +django-bootstrap-icons django-bootstrap5 django-recaptcha gunicorn @@ -20,5 +21,5 @@ django-constance[database] iterfzf celery[redis] django-celery-beat -django-rosetta==0.9.9 +django-rosetta==0.10.1 lxml_html_clean diff --git a/requirements.txt b/requirements.txt index 42732f7..5ac6370 100644 --- a/requirements.txt +++ b/requirements.txt @@ -64,6 +64,8 @@ django==5.1.2 # djangorestframework django-bootstrap-datepicker-plus==5.0.5 # via -r requirements.in +django-bootstrap-icons==0.9.0 + # via -r requirements.in django-bootstrap5==24.3 # via -r requirements.in django-celery-beat==2.7.0 From 0dfd919ee18a456ddb5b99fb8aaf71f98619fa4f Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 00:08:51 +0200 Subject: [PATCH 5/9] django==4.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5ac6370..a4f59d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -46,7 +46,7 @@ decorator==5.1.1 # via ipython dj-config-url==0.1.1 # via -r requirements.in -django==5.1.2 +django==4.2 # via # -r requirements.in # django-bootstrap-datepicker-plus From c7b553df822fa2e6eca58263220f0892e973b59d Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 00:10:07 +0200 Subject: [PATCH 6/9] django-bootstrap-icons==0.8.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a4f59d0..c0f6fe7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -64,7 +64,7 @@ django==4.2 # djangorestframework django-bootstrap-datepicker-plus==5.0.5 # via -r requirements.in -django-bootstrap-icons==0.9.0 +django-bootstrap-icons==0.8.7 # via -r requirements.in django-bootstrap5==24.3 # via -r requirements.in From 4878135f96650d3a9a5111ba0314db6daeb04f08 Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 00:10:54 +0200 Subject: [PATCH 7/9] django-cors-headers==4.4.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c0f6fe7..ffbea1d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -72,7 +72,7 @@ django-celery-beat==2.7.0 # via -r requirements.in django-constance[database]==4.1.2 # via -r requirements.in -django-cors-headers==4.5.0 +django-cors-headers==4.4.0 # via -r requirements.in django-extensions==3.2.3 # via -r requirements.in From 0e4a0aea36597417322980636ad0c1a3aa585d3e Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 00:19:23 +0200 Subject: [PATCH 8/9] Fixed requirements --- requirements.in | 2 ++ requirements.txt | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/requirements.in b/requirements.in index 246abf4..3a1e962 100644 --- a/requirements.in +++ b/requirements.in @@ -23,3 +23,5 @@ celery[redis] django-celery-beat django-rosetta==0.10.1 lxml_html_clean +pydantic +importlib-metadata diff --git a/requirements.txt b/requirements.txt index ffbea1d..00f0a3b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -44,6 +44,8 @@ cssselect==1.2.0 # via pyquery decorator==5.1.1 # via ipython +defusedxml==0.7.1 + # via -r requirements.in dj-config-url==0.1.1 # via -r requirements.in django==4.2 @@ -102,6 +104,8 @@ icalendar==6.0.1 # via django-ical idna==3.10 # via requests +importlib-metadata==8.5.0 + # via -r requirements.in ipython==7.24.1 # via -r requirements.in ipython-genutils==0.2.0 @@ -128,7 +132,7 @@ pexpect==4.9.0 # via ipython pickleshare==0.7.5 # via ipython -pillow==11.0.0 +pillow==10.4.0 # via -r requirements.in polib==1.2.0 # via django-rosetta @@ -140,7 +144,9 @@ psycopg2==2.9.10 # via -r requirements.in ptyprocess==0.7.0 # via pexpect -pyee==12.0.0 +pydantic==2.9.2 + # via -r requirements.in +pyee==11.1.1 # via pyppeteer pygments==2.18.0 # via ipython @@ -189,7 +195,7 @@ traitlets==5.14.3 # matplotlib-inline tzdata==2024.2 # via celery -urllib3==2.2.3 +urllib3==1.26.20 # via # pyppeteer # requests @@ -202,7 +208,7 @@ w3lib==2.2.1 # via requests-html wcwidth==0.2.13 # via prompt-toolkit -websockets==13.1 +websockets==10.4 # via pyppeteer whitenoise==6.7.0 # via -r requirements.in From d07f64e1a53c69147fe8f0b096a3fdfaeac7d296 Mon Sep 17 00:00:00 2001 From: Anders Bruun Severinsen <202204885@post.au.dk> Date: Fri, 18 Oct 2024 00:28:34 +0200 Subject: [PATCH 9/9] Fixed requirements --- requirements.in | 1 + requirements.txt | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/requirements.in b/requirements.in index 3a1e962..81b66a7 100644 --- a/requirements.in +++ b/requirements.in @@ -25,3 +25,4 @@ django-rosetta==0.10.1 lxml_html_clean pydantic importlib-metadata +cron-descriptor diff --git a/requirements.txt b/requirements.txt index 00f0a3b..6ec64f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,8 @@ # # pip-compile requirements.in # +annotated-types==0.7.0 + # via -r requirements.in amqp==5.2.0 # via kombu appdirs==1.4.4 @@ -40,6 +42,8 @@ click-plugins==1.1.1 # via celery click-repl==0.3.0 # via celery +cron-descriptor + # via -r requirements.in cssselect==1.2.0 # via pyquery decorator==5.1.1 @@ -68,7 +72,7 @@ django-bootstrap-datepicker-plus==5.0.5 # via -r requirements.in django-bootstrap-icons==0.8.7 # via -r requirements.in -django-bootstrap5==24.3 +django-bootstrap-v5==1.0.11 # via -r requirements.in django-celery-beat==2.7.0 # via -r requirements.in @@ -146,6 +150,8 @@ ptyprocess==0.7.0 # via pexpect pydantic==2.9.2 # via -r requirements.in +pydantic-core==2.23.4 + # via pydantic pyee==11.1.1 # via pyppeteer pygments==2.18.0 @@ -193,6 +199,8 @@ traitlets==5.14.3 # via # ipython # matplotlib-inline +typing-extensions==4.12.2 + # via -r requirements.in tzdata==2024.2 # via celery urllib3==1.26.20