From 00dea28169f5bd21ae32db56b1d3ac0309a12b28 Mon Sep 17 00:00:00 2001 From: Hlamalani Date: Thu, 6 Feb 2025 14:20:24 +0200 Subject: [PATCH 1/4] add helper texts for ordered content sets --- home/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home/models.py b/home/models.py index 6417cc95..b5fa6891 100644 --- a/home/models.py +++ b/home/models.py @@ -1190,7 +1190,10 @@ def latest_draft_profile_fields(self): blocks.StructBlock( [ ("contentpage", blocks.PageChooserBlock()), - ("time", blocks.IntegerBlock(min_value=0, required=False)), + ("time", blocks.IntegerBlock( + min_value=0, + required=False, + help_text="When should this message be sent? Set the number of hours, days, months or year.")), ( "unit", blocks.ChoiceBlock( @@ -1200,6 +1203,7 @@ def latest_draft_profile_fields(self): ("days", "Days"), ("months", "Months"), ], + help_text="Choose the unit of time to use.", required=False, ), ), @@ -1210,12 +1214,14 @@ def latest_draft_profile_fields(self): ("after", "After"), ("before", "Before"), ], + help_text="Is it ‘before’ or ‘after’ the reference point for your timings, which is set in the contact field below.", required=False, ), ), ( "contact_field", blocks.CharBlock( + help_text="This is the reference point used to base the timing of message on. For example, edd (estimated date of birth) or dob (date of birth).", required=False, ), ), From 7b2ee331e737a2934f61b85cd4129c1195542eb7 Mon Sep 17 00:00:00 2001 From: Hlamalani Date: Mon, 17 Feb 2025 09:42:27 +0200 Subject: [PATCH 2/4] add helper texts to ordered content sets --- .../0090_alter_orderedcontentset_pages.py | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 home/migrations/0090_alter_orderedcontentset_pages.py diff --git a/home/migrations/0090_alter_orderedcontentset_pages.py b/home/migrations/0090_alter_orderedcontentset_pages.py new file mode 100644 index 00000000..1d6075a1 --- /dev/null +++ b/home/migrations/0090_alter_orderedcontentset_pages.py @@ -0,0 +1,73 @@ +# Generated by Django 4.2.17 on 2025-02-17 07:41 + +from django.db import migrations +import wagtail.blocks +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("home", "0089_alter_assessment_options"), + ] + + operations = [ + migrations.AlterField( + model_name="orderedcontentset", + name="pages", + field=wagtail.fields.StreamField( + [ + ( + "pages", + wagtail.blocks.StructBlock( + [ + ("contentpage", wagtail.blocks.PageChooserBlock()), + ( + "time", + wagtail.blocks.IntegerBlock( + help_text="When should this message be sent? Set the number of hours, days, months or year.", + min_value=0, + required=False, + ), + ), + ( + "unit", + wagtail.blocks.ChoiceBlock( + choices=[ + ("minutes", "Minutes"), + ("hours", "Hours"), + ("days", "Days"), + ("months", "Months"), + ], + help_text="Choose the unit of time to use.", + required=False, + ), + ), + ( + "before_or_after", + wagtail.blocks.ChoiceBlock( + choices=[ + ("after", "After"), + ("before", "Before"), + ], + help_text="Is it ‘before’ or ‘after’ the reference point for your timings, which is set in the contact field below.", + required=False, + ), + ), + ( + "contact_field", + wagtail.blocks.CharBlock( + help_text="This is the reference point used to base the timing of message on. For example, edd (estimated date of birth) or dob (date of birth).", + required=False, + ), + ), + ] + ), + ) + ], + blank=True, + null=True, + use_json_field=True, + ), + ), + ] From 3092a88bd76d78494d75c60889e34fe4801e6b8b Mon Sep 17 00:00:00 2001 From: Hlamalani Date: Mon, 17 Feb 2025 09:50:38 +0200 Subject: [PATCH 3/4] add helper texts to ordered content sets --- home/models.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/home/models.py b/home/models.py index d38cb505..0041c2cc 100644 --- a/home/models.py +++ b/home/models.py @@ -1207,10 +1207,14 @@ def latest_draft_profile_fields(self): blocks.StructBlock( [ ("contentpage", blocks.PageChooserBlock()), - ("time", blocks.IntegerBlock( - min_value=0, - required=False, - help_text="When should this message be sent? Set the number of hours, days, months or year.")), + ( + "time", + blocks.IntegerBlock( + min_value=0, + required=False, + help_text="When should this message be sent? Set the number of hours, days, months or year.", + ), + ), ( "unit", blocks.ChoiceBlock( From 5102c7f926f37fe30ebd35cd68a7e53a66d814c0 Mon Sep 17 00:00:00 2001 From: Hlamalani Date: Mon, 17 Feb 2025 09:59:13 +0200 Subject: [PATCH 4/4] add to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d3a9ab..7588d12c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Error message when list_items is broken - Consistent labelling on import forms - Fix class_name warning: RemovedInWagtail60Warning +- Helper texts for some ordered content sets ### Removed - Locale field on exports -->