Skip to content

Commit

Permalink
[#2578] Add optional help text field for monthly benefits reports
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-sigma committed Jun 25, 2024
1 parent a2906c1 commit 4379039
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/open_inwoner/ssd/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class SSDConfigAdmin(SingletonModelAdmin):
"maandspecificatie_delta",
"maandspecificatie_available_from",
"maandspecificatie_display_text",
"maandspecificatie_comments",
)
},
),
Expand Down
5 changes: 4 additions & 1 deletion src/open_inwoner/ssd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ def get_reports(
)
pdf = render_pdf(
self.html_template,
context={"reports": uitkeringen},
context={
"reports": uitkeringen,
"comments": self.config.maandspecificatie_comments,
},
base_url=request_base_url,
)
return pdf
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.11 on 2024-06-25 07:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("ssd", "0005_fix_translations_typo"),
]

operations = [
migrations.AddField(
model_name="ssdconfig",
name="maandspecificatie_comments",
field=models.TextField(
blank=True,
help_text="Information about the maandspecificatie document",
verbose_name="PDF help text",
),
),
]
5 changes: 5 additions & 0 deletions src/open_inwoner/ssd/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ class SSDConfig(SingletonModel):
blank=True,
help_text=_("The text displayed as overview of the 'Maandspecificatie' tab"),
)
maandspecificatie_comments = models.TextField(
_("PDF help text"),
blank=True,
help_text=_("Information about the maandspecificatie document"),
)

@property
def logo(self):
Expand Down
9 changes: 8 additions & 1 deletion src/open_inwoner/ssd/templates/maandspecificatie.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load ssd_tags l10n %}
{% load ssd_tags utils static l10n %}

<!DOCTYPE html>
<html lang="nl">
Expand Down Expand Up @@ -157,6 +157,13 @@ <h2 class="utrecht-heading-2 section-title">Inkomstenkorting</h2>
<p class="monthly-report__p extra-margin">Op de 25e van de maand krijgt u het bedrag ad. &euro; {% format_currency last.bedrag.waarde_bedrag %} uitbetaald.</p>
</div>
{% endif %}

{# Optional comments/help text #}
{% if comments %}
<section class="section">
{{ comments|markdown|safe }}
</section>
{% endif %}
</div>
</body>
<p style="page-break-after: always;">&nbsp;</p>
Expand Down

0 comments on commit 4379039

Please sign in to comment.