diff --git a/aleksis/apps/paweljong/forms.py b/aleksis/apps/paweljong/forms.py index 4376595e942efc0c56ee64c4335c3e03fafc36b9..3122199e11bcccfd8cd8f534baac50950f70d495 100644 --- a/aleksis/apps/paweljong/forms.py +++ b/aleksis/apps/paweljong/forms.py @@ -62,7 +62,7 @@ class EditEventForm(ExtensibleForm): Row("display_name", "slug", "description"), Row("place", "published"), Fieldset(_("Date data"), Row("date_event", "date_registration", "date_retraction")), - Fieldset(_("Event details"), Row("cost", "max_participants"), "information", "additional_fields", "contact_information_visible_fields"), + Fieldset(_("Event details"), Row("cost", "min_cost", "max_cost", "max_participants"), "information", "additional_fields", "contact_information_visible_fields"), Fieldset(_("Terms"), "terms"), Fieldset(_("Info mailings"), "info_mailings"), ), @@ -81,6 +81,8 @@ class EditEventForm(ExtensibleForm): "date_registration", "date_retraction", "cost", + "min_cost", + "max_cost", "max_participants", "terms", "information", diff --git a/aleksis/apps/paweljong/migrations/0031_event_max_cost_event_min_cost.py b/aleksis/apps/paweljong/migrations/0031_event_max_cost_event_min_cost.py new file mode 100644 index 0000000000000000000000000000000000000000..c52e0616aae2fb1b4f9db74a443e24d2af004b8d --- /dev/null +++ b/aleksis/apps/paweljong/migrations/0031_event_max_cost_event_min_cost.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.4 on 2025-02-10 14:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('paweljong', '0030_event_contact_information_visible_fields'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='max_cost', + field=models.IntegerField(blank=True, default=None, null=True, verbose_name='Maximum cost in €'), + ), + migrations.AddField( + model_name='event', + name='min_cost', + field=models.IntegerField(default=0, verbose_name='Minimum cost in €'), + ), + ] diff --git a/aleksis/apps/paweljong/models.py b/aleksis/apps/paweljong/models.py index a8978132797f4e79b6348a8f7bda8d4e0517d224..bc7b59e3e25613fc9782dd17239d214cb3c31485 100644 --- a/aleksis/apps/paweljong/models.py +++ b/aleksis/apps/paweljong/models.py @@ -167,6 +167,8 @@ class Event(ExtensibleModel): # Other details cost = models.IntegerField(verbose_name=_("Cost in €")) + min_cost = models.IntegerField(verbose_name=_("Minimum cost in €"), default=0) + max_cost = models.IntegerField(verbose_name=_("Maximum cost in €"), default=None, null=True, blank=True) max_participants = models.PositiveSmallIntegerField(verbose_name=_("Maximum participants")) information = RichTextField(verbose_name=_("Information about the event")) terms = models.ManyToManyField(Terms, verbose_name=_("Terms"), related_name="event", blank=True) diff --git a/aleksis/apps/paweljong/templates/templated_email/event_created.email b/aleksis/apps/paweljong/templates/templated_email/event_created.email index ff4816364cccb6f08f5cdb91b304cbfda43d3603..6e2ac2de4cb4d44add2c22282b21987be475528f 100644 --- a/aleksis/apps/paweljong/templates/templated_email/event_created.email +++ b/aleksis/apps/paweljong/templates/templated_email/event_created.email @@ -13,6 +13,8 @@ * {% trans "Registration deadline" %}: {{ new_event.date_registration }} * {% trans "Retraction deadline" %}: {{ new_event.date_retraction }} * {% trans "Cost" %}: {{ new_event.cost }} + * {% trans "Minimum cost" %}: {{ new_event.min_cost }} + * {% trans "Maximum cost" %}: {{ new_event.max_cost }} * {% trans "Max. participants" %}: {{ new_event.max_participants }} * {% trans "Owners" %}: {% for owner in new_event.group.owners.all %} @@ -41,6 +43,8 @@ <li> {% trans "Registration deadline" %}: {{ new_event.date_registration }}</li> <li> {% trans "Retraction deadline" %}: {{ new_event.date_retraction }}</li> <li> {% trans "Cost" %}: {{ new_event.cost }}</li> + <li> {% trans "Minimum cost" %}: {{ new_event.min_cost }}</li> + <li> {% trans "Maximum cost" %}: {{ new_event.max_cost }}</li> <li> {% trans "Max. participants" %}: {{ new_event.max_participants }}</li> <li> {% trans "Owners" %}</li> <ul>