From f17002b571954e82cfb2c33284bd52e9a847bed7 Mon Sep 17 00:00:00 2001 From: Paul Schilling Date: Wed, 11 Oct 2023 10:13:21 +0200 Subject: [PATCH] [#1788] Make title text for Mijn aanvragen configurable --- src/open_inwoner/cms/cases/views/cases.py | 3 +++ src/open_inwoner/openzaak/admin.py | 1 + .../0025_openzaakconfig_title_text.py | 22 +++++++++++++++++++ src/open_inwoner/openzaak/models.py | 10 +++++++++ .../scss/components/Cases/Cases.scss | 5 +++++ .../templates/pages/cases/list_inner.html | 1 + 6 files changed, 42 insertions(+) create mode 100644 src/open_inwoner/openzaak/migrations/0025_openzaakconfig_title_text.py diff --git a/src/open_inwoner/cms/cases/views/cases.py b/src/open_inwoner/cms/cases/views/cases.py index 5c00245545..663d46edba 100644 --- a/src/open_inwoner/cms/cases/views/cases.py +++ b/src/open_inwoner/cms/cases/views/cases.py @@ -7,6 +7,7 @@ from open_inwoner.htmx.mixins import RequiresHtmxMixin from open_inwoner.openzaak.formapi import fetch_open_submissions +from open_inwoner.openzaak.models import OpenZaakConfig from open_inwoner.utils.views import CommonPageMixin from .mixins import CaseAccessMixin, CaseListMixin, OuterCaseAccessMixin @@ -55,6 +56,8 @@ def get_cases(self): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) + config = OpenZaakConfig.get_solo() context["hxget"] = reverse("cases:cases_content") + context["title_text"] = config.title_text return context diff --git a/src/open_inwoner/openzaak/admin.py b/src/open_inwoner/openzaak/admin.py index f273648fc9..f5c8b1663d 100644 --- a/src/open_inwoner/openzaak/admin.py +++ b/src/open_inwoner/openzaak/admin.py @@ -43,6 +43,7 @@ class OpenZaakConfigAdmin(SingletonModelAdmin): "document_max_confidentiality", "max_upload_size", "allowed_file_extensions", + "title_text", ], }, ), diff --git a/src/open_inwoner/openzaak/migrations/0025_openzaakconfig_title_text.py b/src/open_inwoner/openzaak/migrations/0025_openzaakconfig_title_text.py new file mode 100644 index 0000000000..ad6a75cbab --- /dev/null +++ b/src/open_inwoner/openzaak/migrations/0025_openzaakconfig_title_text.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.20 on 2023-10-11 07:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("openzaak", "0024_zaaktypeconfig_contact_subject_code"), + ] + + operations = [ + migrations.AddField( + model_name="openzaakconfig", + name="title_text", + field=models.TextField( + default="Hier vindt u een overzicht van al uw lopende an afgeronde aanvragen.", + help_text="The title/introductory text shown on the list view of 'Mijn aanvragen'.", + verbose_name="Title text", + ), + ), + ] diff --git a/src/open_inwoner/openzaak/models.py b/src/open_inwoner/openzaak/models.py index 282e884b30..08df46a2b5 100644 --- a/src/open_inwoner/openzaak/models.py +++ b/src/open_inwoner/openzaak/models.py @@ -129,6 +129,16 @@ class OpenZaakConfig(SingletonModel): default=False, ) + title_text = models.TextField( + verbose_name=_("Title text"), + help_text=_( + "The title/introductory text shown on the list view of 'Mijn aanvragen'." + ), + default=_( + "Hier vindt u een overzicht van al uw lopende an afgeronde aanvragen." + ), + ) + class Meta: verbose_name = _("Open Zaak configuration") diff --git a/src/open_inwoner/scss/components/Cases/Cases.scss b/src/open_inwoner/scss/components/Cases/Cases.scss index ffb5d9e17c..6b083a2a26 100644 --- a/src/open_inwoner/scss/components/Cases/Cases.scss +++ b/src/open_inwoner/scss/components/Cases/Cases.scss @@ -11,6 +11,11 @@ a:hover { cursor: pointer; } + + &__title_text { + padding-top: var(--spacing-medium); + padding-bottom: var(--spacing-extra-large); + } } #document-upload { diff --git a/src/open_inwoner/templates/pages/cases/list_inner.html b/src/open_inwoner/templates/pages/cases/list_inner.html index c3d71b6b93..2fb071f71b 100644 --- a/src/open_inwoner/templates/pages/cases/list_inner.html +++ b/src/open_inwoner/templates/pages/cases/list_inner.html @@ -5,6 +5,7 @@

{{ page_title }} ({{ paginator.count }})

+

{{ title_text }}

{% render_grid %} {% for case in cases %}