From 48e83dc6f5bba8842016fdb22a75c7bc70a1fa10 Mon Sep 17 00:00:00 2001 From: Pauliina Ilmanen Date: Thu, 9 Jan 2025 13:29:14 +0200 Subject: [PATCH] Add people_capacity_upper field to Resource model Add the field `people_capacity_upper` to the `Resource` model and to the Respa admin's resource form. Refs TTVA-217 --- locale/fi/LC_MESSAGES/django.po | 3 +++ locale/sv/LC_MESSAGES/django.po | 3 +++ .../0130_resource_people_capacity_upper.py | 18 ++++++++++++++++++ resources/models/resource.py | 3 +++ respa_admin/forms.py | 1 + .../respa_admin/resources/form/_booking.html | 1 + 6 files changed, 29 insertions(+) create mode 100644 resources/migrations/0130_resource_people_capacity_upper.py diff --git a/locale/fi/LC_MESSAGES/django.po b/locale/fi/LC_MESSAGES/django.po index 4351c02db..5871022bd 100644 --- a/locale/fi/LC_MESSAGES/django.po +++ b/locale/fi/LC_MESSAGES/django.po @@ -1180,6 +1180,9 @@ msgstr "Tunnistautuminen" msgid "People capacity" msgstr "Henkilömäärä" +msgid "People capacity upper limit" +msgstr "Maksimihenkilömäärä" + msgid "Area (m2)" msgstr "Pinta-ala (m2)" diff --git a/locale/sv/LC_MESSAGES/django.po b/locale/sv/LC_MESSAGES/django.po index 19ef60a43..c3d04105f 100644 --- a/locale/sv/LC_MESSAGES/django.po +++ b/locale/sv/LC_MESSAGES/django.po @@ -1050,6 +1050,9 @@ msgstr "Autentisering" msgid "People capacity" msgstr "Kapacitet" +msgid "People capacity upper limit" +msgstr "Maximal kapacitet" + msgid "Area (m2)" msgstr "Yta (m2)" diff --git a/resources/migrations/0130_resource_people_capacity_upper.py b/resources/migrations/0130_resource_people_capacity_upper.py new file mode 100644 index 000000000..b0dc3b614 --- /dev/null +++ b/resources/migrations/0130_resource_people_capacity_upper.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.11 on 2025-01-09 11:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('resources', '0129_rename_people_capacity'), + ] + + operations = [ + migrations.AddField( + model_name='resource', + name='people_capacity_upper', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name='People capacity upper limit'), + ), + ] diff --git a/resources/models/resource.py b/resources/models/resource.py index 75d9be75b..3e9f4737c 100644 --- a/resources/models/resource.py +++ b/resources/models/resource.py @@ -335,6 +335,9 @@ class Resource(ModifiableModel, AutoIdentifiedModel): people_capacity_lower = models.PositiveIntegerField( verbose_name=_("People capacity"), null=True, blank=True ) + people_capacity_upper = models.PositiveIntegerField( + verbose_name=_("People capacity upper limit"), null=True, blank=True + ) area = models.PositiveIntegerField( verbose_name=_("Area (m2)"), null=True, blank=True ) diff --git a/respa_admin/forms.py b/respa_admin/forms.py index c9086e310..12f44bfd8 100644 --- a/respa_admin/forms.py +++ b/respa_admin/forms.py @@ -241,6 +241,7 @@ class Meta: "access_methods", "external_reservation_url", "people_capacity_lower", + "people_capacity_upper", "area", "min_period", "max_period", diff --git a/respa_admin/templates/respa_admin/resources/form/_booking.html b/respa_admin/templates/respa_admin/resources/form/_booking.html index 336f7ef2f..8bf869fb7 100644 --- a/respa_admin/templates/respa_admin/resources/form/_booking.html +++ b/respa_admin/templates/respa_admin/resources/form/_booking.html @@ -7,6 +7,7 @@

{% trans "Booking information" %}

{% include "respa_admin/forms/_input.html" with field=form.people_capacity_lower %} + {% include "respa_admin/forms/_input.html" with field=form.people_capacity_upper %} {% include "respa_admin/forms/_input.html" with field=form.area %}