Skip to content

Help text for foundation Meeting model fields #1945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions foundation/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ class BusinessInline(admin.StackedInline):

class ActionItemInline(admin.StackedInline):
model = models.ActionItem
verbose_name_plural = _(
"Action Items (aka todos. "
"Combine the last meeting's remaining action items, "
"and add any new ones)"
)


@admin.register(models.Meeting)
class MeetingAdmin(admin.ModelAdmin):
change_form_template = "admin/foundation/meeting/change_form.html"
fieldsets = (
(
"Metadata",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.1.5 on 2025-03-05 10:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('foundation', '0006_hardcode_currency_choices'),
]

operations = [
migrations.AlterField(
model_name='business',
name='body',
field=models.TextField(help_text="Supports reStructuredText. See <a href='https://www.djangoproject.com/styleguide/content/'>supported formatting</a>."),
),
migrations.AlterField(
model_name='meeting',
name='board_attendees',
field=models.ManyToManyField(help_text='Make sure to choose the correct year', related_name='meetings_attended', to='foundation.boardmember'),
),
]
13 changes: 11 additions & 2 deletions foundation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ class Meeting(models.Model):
BoardMember, related_name="meetings_led", on_delete=models.CASCADE
)
board_attendees = models.ManyToManyField(
BoardMember, related_name="meetings_attended"
BoardMember,
related_name="meetings_attended",
help_text=_("Make sure to choose the correct year"),
)
non_board_attendees = models.ManyToManyField(
NonBoardAttendee, related_name="meetings_attended", blank=True
Expand Down Expand Up @@ -201,7 +203,14 @@ class Business(models.Model):
)

title = models.CharField(max_length=255)
body = models.TextField()
body = models.TextField(
help_text=_(
"Supports reStructuredText. "
"See <a href='https://www.djangoproject.com/styleguide/content/'>"
"supported formatting</a>."
)
)

body_html = models.TextField(editable=False)
business_type = models.CharField(max_length=25, choices=TYPE_CHOICES)
meeting = models.ForeignKey(
Expand Down
25 changes: 25 additions & 0 deletions foundation/templates/admin/foundation/meeting/change_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends "admin/change_form.html" %} {% load i18n %} \ {% block extrastyle %}
{{ block.super }}
<style>
.meeting-warning {
background: #fff3cd;
border: 2px solid #ffeeba;
Comment on lines +5 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it render in light theme?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

border-radius: 4px;
color: #856404;
margin: 1em 0;
padding: 1em;
font-size: 1.1em;
font-weight: 500;
}
.meeting-warning::before {
content: "⚠️ ";
}
Comment on lines +4 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have this in the dedicated style folder instead? or this will not work?

Copy link
Author

@FarhanAliRaza FarhanAliRaza May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will not work because I am overriding the admin template form.For it to work, I think I will have to add compiled SCSS to the base admin template. That may break other styles as well because now, SCSS is compiled to one big output.css file.

</style>
{% endblock %} {% block content %}
<div class="messagelist">
<div class="meeting-warning">
Note: Meeting notes go live and on RSS on Save, make sure to complete all
relevant fields.
</div>
</div>
{{ block.super }} {% endblock %}