Skip to content

Commit

Permalink
Add people_capacity_upper field to Resource model
Browse files Browse the repository at this point in the history
Add the field `people_capacity_upper` to the `Resource` model and to
the Respa admin's resource form.

Refs TTVA-217
  • Loading branch information
japauliina committed Jan 14, 2025
1 parent 7012940 commit 48e83dc
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions locale/fi/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
3 changes: 3 additions & 0 deletions locale/sv/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand Down
18 changes: 18 additions & 0 deletions resources/migrations/0130_resource_people_capacity_upper.py
Original file line number Diff line number Diff line change
@@ -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'),
),
]
3 changes: 3 additions & 0 deletions resources/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions respa_admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class Meta:
"access_methods",
"external_reservation_url",
"people_capacity_lower",
"people_capacity_upper",
"area",
"min_period",
"max_period",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ <h2>{% trans "Booking information" %}</h2>
</div>
<div class="input-row">
{% 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 %}
</div>
<div class="input-row dropdown-row">
Expand Down

0 comments on commit 48e83dc

Please sign in to comment.