From b610f2ec6c3c0659a010e6696256d144c9207e06 Mon Sep 17 00:00:00 2001 From: frcroth Date: Tue, 13 Feb 2024 13:13:45 +0100 Subject: [PATCH] Add location to minutes (#475) --- README.md | 2 +- .../core/migrations/0010_minutes_location.py | 17 ++ myhpi/core/models.py | 2 + myhpi/core/templates/core/minutes.html | 6 + myhpi/locale/de/LC_MESSAGES/django.po | 240 +++++++++--------- tools/create_test_data.py | 1 + 6 files changed, 151 insertions(+), 117 deletions(-) create mode 100644 myhpi/core/migrations/0010_minutes_location.py diff --git a/README.md b/README.md index 9c36f543..a0fdc48d 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ If you want to do that manually, run `pre-commit run --all-files`. Next to that, ## Tips -- To create translations, run `django-admin makemessages -l de` in the myhpi directory. +- To create translations, run `python manage.py makemessages -l de -i venv`. ### Reset database diff --git a/myhpi/core/migrations/0010_minutes_location.py b/myhpi/core/migrations/0010_minutes_location.py new file mode 100644 index 00000000..da10cbc4 --- /dev/null +++ b/myhpi/core/migrations/0010_minutes_location.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.9 on 2024-01-27 21:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("core", "0009_alter_minuteslabel_slug"), + ] + + operations = [ + migrations.AddField( + model_name="minutes", + name="location", + field=models.CharField(blank=True, max_length=255), + ), + ] diff --git a/myhpi/core/models.py b/myhpi/core/models.py index 96d49338..aeb6d6ba 100644 --- a/myhpi/core/models.py +++ b/myhpi/core/models.py @@ -205,6 +205,7 @@ class Minutes(BasePage): User, blank=True, null=True, on_delete=models.PROTECT, related_name="author" ) participants = ParentalManyToManyField(User, related_name="minutes") + location = CharField(max_length=255, blank=True) labels = ClusterTaggableManager(through=TaggedMinutes, blank=True) body = CustomMarkdownField() guests = models.JSONField(blank=True, default=[]) @@ -215,6 +216,7 @@ class Minutes(BasePage): FieldPanel("moderator", widget=UserSelectWidget({"data-width": "100%"})), FieldPanel("author", widget=UserSelectWidget({"data-width": "100%"})), FieldPanel("participants", widget=UserSelectMultipleWidget({"data-width": "100%"})), + FieldPanel("location"), FieldPanel("labels"), FieldPanel("body"), FieldPanel("guests"), diff --git a/myhpi/core/templates/core/minutes.html b/myhpi/core/templates/core/minutes.html index 5db9013d..3b4909a9 100644 --- a/myhpi/core/templates/core/minutes.html +++ b/myhpi/core/templates/core/minutes.html @@ -46,6 +46,12 @@

{% translate "Guests" %}

{% translate "No guests" %} {% endif %} + {% if page.location %} + + {% endif %}