feat: add configurable help text for relationships

Displayed at the top of relationship forms
This commit is contained in:
James Graham
2021-05-10 13:21:37 +01:00
parent 4f1dfe16cd
commit c57392e83c
3 changed files with 28 additions and 3 deletions

View File

@@ -357,6 +357,9 @@ CONSTANCE_CONFIG = {
'ORGANISATION_LIST_HELP': (
'',
'Help text to display at the top of the organisaton list.'),
'RELATIONSHIP_FORM_HELP': (
'',
'Help text to display at the top of relationship forms.'),
} # yapf: disable
CONSTANCE_CONFIG_FIELDSETS = {
@@ -364,9 +367,15 @@ CONSTANCE_CONFIG_FIELDSETS = {
'NOTICE_TEXT',
'NOTICE_CLASS',
),
'Data Collection': ('CONSENT_TEXT', ),
'Help Text': ('PERSON_LIST_HELP', 'ORGANISATION_LIST_HELP'),
}
'Data Collection': (
'CONSENT_TEXT',
),
'Help Text': (
'PERSON_LIST_HELP',
'ORGANISATION_LIST_HELP',
'RELATIONSHIP_FORM_HELP',
),
} # yapf: disable
CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend'

View File

@@ -15,6 +15,14 @@
<h1>Add Relationship</h1>
{% with config.RELATIONSHIP_FORM_HELP as help_text %}
{% if help_text %}
<div class="alert alert-info mt-3 pb-0">
{{ help_text|linebreaks }}
</div>
{% endif %}
{% endwith %}
<hr>
<form class="form"

View File

@@ -18,6 +18,14 @@
<h1>Update Relationship</h1>
{% with config.RELATIONSHIP_FORM_HELP as help_text %}
{% if help_text %}
<div class="alert alert-info mt-3 pb-0">
{{ help_text|linebreaks }}
</div>
{% endif %}
{% endwith %}
<hr>
<form class="form"