Skip to content

Commit

Permalink
Add location to minutes (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
frcroth authored Feb 13, 2024
1 parent 6ea2cd8 commit b610f2e
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 117 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 17 additions & 0 deletions myhpi/core/migrations/0010_minutes_location.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
2 changes: 2 additions & 0 deletions myhpi/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[])
Expand All @@ -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"),
Expand Down
6 changes: 6 additions & 0 deletions myhpi/core/templates/core/minutes.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ <h1 class="side-panel-title">{% translate "Guests" %}</h1>
<i>{% translate "No guests" %}</i>
{% endif %}
</aside>
{% if page.location %}
<aside class="side-panel border-accent">
<h1 class="side-panel-title">{% translate "Location" %}</h1>
<p>{{ page.location }}</p>
</aside>
{% endif %}
<aside class="side-panel border-accent">
<h1 class="side-panel-title">{% translate "Labels" %}</h1>
{% if page.labels.all %}
Expand Down
Loading

0 comments on commit b610f2e

Please sign in to comment.