diff --git a/src/open_inwoner/conf/base.py b/src/open_inwoner/conf/base.py index e99485a02a..d108d7e430 100644 --- a/src/open_inwoner/conf/base.py +++ b/src/open_inwoner/conf/base.py @@ -204,6 +204,7 @@ "formtools", "django_setup_configuration", "django_yubin", + "tinymce", # Project applications. "open_inwoner.components", "open_inwoner.kvk", diff --git a/src/open_inwoner/ssd/migrations/0006_alter_ssdconfig_mijn_uitkeringen_text.py b/src/open_inwoner/ssd/migrations/0006_alter_ssdconfig_mijn_uitkeringen_text.py new file mode 100644 index 0000000000..bff1d93610 --- /dev/null +++ b/src/open_inwoner/ssd/migrations/0006_alter_ssdconfig_mijn_uitkeringen_text.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2.11 on 2024-06-24 14:07 + +from django.db import migrations + +import ckeditor.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("ssd", "0005_fix_translations_typo"), + ] + + operations = [ + migrations.AlterField( + model_name="ssdconfig", + name="mijn_uitkeringen_text", + field=ckeditor.fields.RichTextField( + blank=True, + help_text="The text displayed as overview of the 'Mijn Uitkeringen' section.", + verbose_name="Overview text", + ), + ), + ] diff --git a/src/open_inwoner/ssd/models.py b/src/open_inwoner/ssd/models.py index 27c0091da9..617247e0ed 100644 --- a/src/open_inwoner/ssd/models.py +++ b/src/open_inwoner/ssd/models.py @@ -1,6 +1,7 @@ from django.db import models from django.utils.translation import gettext_lazy as _ +import ckeditor.fields as ckeditor_fields from solo.models import SingletonModel from ..configurations.models import SiteConfiguration @@ -55,7 +56,7 @@ class SSDConfig(SingletonModel): validators=[validate_digits], blank=True, ) - mijn_uitkeringen_text = models.TextField( + mijn_uitkeringen_text = ckeditor_fields.RichTextField( _("Overview text"), blank=True, help_text=_( diff --git a/src/open_inwoner/templates/pages/ssd/monthly_reports_list.html b/src/open_inwoner/templates/pages/ssd/monthly_reports_list.html index ea83909209..ed71cdcf91 100644 --- a/src/open_inwoner/templates/pages/ssd/monthly_reports_list.html +++ b/src/open_inwoner/templates/pages/ssd/monthly_reports_list.html @@ -1,54 +1,41 @@ -{% extends 'master.html' %} +{% extends 'pages/ssd/reports_base.html' %} {% load i18n grid_tags dropdown_tags form_tags button_tags ssd_tags %} -{% block content %} - {% render_grid %} - {% render_column span=9 %} -

- {% trans "Mijn uitkeringen" %} -

-

- {% blocktrans with mijn_uitkeringen_text=client.config.mijn_uitkeringen_text %} - {{ mijn_uitkeringen_text }} - {% endblocktrans %} -

-
-
- - {% if client.config.maandspecificatie_enabled is True %} -
- {# Note: Mijn uitkeringen tab-content styles need to be independent from the URL, unlike the Tabs of the Login page #} - {# URL-dependent styles would be coming from src/open_inwoner/js/components/tab-panels #} - {# Setting class to 'tab__contents' instead of 'tab__content' is a quick-fix #} -
-

- {% blocktrans with display_text=client.config.maandspecificatie_display_text %} - {{ display_text }} - {% endblocktrans %} -

- {% render_form form=form method="POST" id="monthlyreports-form" show_required=False submit_text=_('Download') %} - {% csrf_token %} - {% input form.report_date icon="expand_more" icon_position="after" icon_outlined=True %} - {% form_actions primary_text=_("Download") primary_icon="file_download" icon_position="before" extra_classes="ssd" %} - {% endrender_form %} -
- {% if report_not_found %} - {% blocktrans with time_period=report_not_found|date:"F Y" %} - Geen uitkeringsspecificatie gevonden voor {{ time_period }}. - {% endblocktrans %} - {% endif %} -
-
+{% block report %} +
+
+ + {% if client.config.maandspecificatie_enabled is True %} +
+ {# Note: Mijn uitkeringen tab-content styles need to be independent from the URL, unlike the Tabs of the Login page #} + {# URL-dependent styles would be coming from src/open_inwoner/js/components/tab-panels #} + {# Setting class to 'tab__contents' instead of 'tab__content' is a quick-fix #} +
+

+ {% blocktrans with display_text=client.config.maandspecificatie_display_text %} + {{ display_text }} + {% endblocktrans %} +

+ {% render_form form=form method="POST" id="monthlyreports-form" show_required=False submit_text=_('Download') %} + {% csrf_token %} + {% input form.report_date icon="expand_more" icon_position="after" icon_outlined=True %} + {% form_actions primary_text=_("Download") primary_icon="file_download" icon_position="before" extra_classes="ssd" %} + {% endrender_form %} +
+ {% if report_not_found %} + {% blocktrans with time_period=report_not_found|date:"F Y" %} + Geen uitkeringsspecificatie gevonden voor {{ time_period }}. + {% endblocktrans %} + {% endif %}
- {% else %} -
{% trans "Download of monthly reports not supported." %}
- {% endif %} +
-
- - {% endrender_column %} - {% endrender_grid %} -{% endblock content %} + {% else %} +
{% trans "Download of monthly reports not supported." %}
+ {% endif %} +
+
+{% endblock report %} diff --git a/src/open_inwoner/templates/pages/ssd/reports_base.html b/src/open_inwoner/templates/pages/ssd/reports_base.html new file mode 100644 index 0000000000..8aec874106 --- /dev/null +++ b/src/open_inwoner/templates/pages/ssd/reports_base.html @@ -0,0 +1,20 @@ +{% extends 'master.html' %} +{% load i18n grid_tags dropdown_tags form_tags button_tags ssd_tags %} + +{% block content %} + {% render_grid %} + {% render_column span=9 %} +

+ {% trans "Mijn uitkeringen" %} +

+
+ {% blocktrans with mijn_uitkeringen_text=client.config.mijn_uitkeringen_text|safe %} + {{ mijn_uitkeringen_text }} + {% endblocktrans %} +
+ + {% block report %}{% endblock report %} + + {% endrender_column %} + {% endrender_grid %} +{% endblock content %} diff --git a/src/open_inwoner/templates/pages/ssd/yearly_reports_list.html b/src/open_inwoner/templates/pages/ssd/yearly_reports_list.html index 8133373c14..7c052e36af 100644 --- a/src/open_inwoner/templates/pages/ssd/yearly_reports_list.html +++ b/src/open_inwoner/templates/pages/ssd/yearly_reports_list.html @@ -1,17 +1,7 @@ -{% extends 'master.html' %} +{% extends 'pages/ssd/reports_base.html' %} {% load i18n grid_tags form_tags button_tags icon_tags ssd_tags %} -{% block content %} - {% render_grid %} - {% render_column span=9 %} -

- {% trans "Mijn uitkeringen" %} -

-

- {% blocktrans with mijn_uitkeringen_text=client.config.mijn_uitkeringen_text %} - {{ mijn_uitkeringen_text }} - {% endblocktrans %} -

+{% block report %}
    @@ -50,7 +40,4 @@

    {% endif %}

- - {% endrender_column %} - {% endrender_grid %} -{% endblock content %} +{% endblock report %}