diff --git a/breccia_mapper/settings.py b/breccia_mapper/settings.py index 9a3edb3..2c74594 100644 --- a/breccia_mapper/settings.py +++ b/breccia_mapper/settings.py @@ -125,7 +125,8 @@ SETTINGS_EXPORT = [ 'GOOGLE_MAPS_API_KEY', ] -PARENT_PROJECT_NAME = config('PARENT_PROJECT_NAME', default='Parent Project Name') +PARENT_PROJECT_NAME = config('PARENT_PROJECT_NAME', + default='Parent Project Name') PROJECT_LONG_NAME = config('PROJECT_LONG_NAME', default='Project Long Name') PROJECT_SHORT_NAME = config('PROJECT_SHORT_NAME', default='shortname') @@ -340,16 +341,23 @@ logger = logging.getLogger(__name__) # pylint: disable=invalid-name # Admin panel variables -CONSTANCE_CONFIG = collections.OrderedDict([ - ('NOTICE_TEXT', - ('', - 'Text to be displayed in a notice banner at the top of every page.')), - ('NOTICE_CLASS', ('alert-warning', - 'CSS class to use for background of notice banner.')), - ('CONSENT_TEXT', - ('This is template consent text and should have been replaced. Please contact an admin.', - 'Text to be displayed to ask for consent for data collection.')) -]) +CONSTANCE_CONFIG = { + 'NOTICE_TEXT': ( + '', + 'Text to be displayed in a notice banner at the top of every page.'), + 'NOTICE_CLASS': ( + 'alert-warning', + 'CSS class to use for background of notice banner.'), + 'CONSENT_TEXT': ( + 'This is template consent text and should have been replaced. Please contact an admin.', + 'Text to be displayed to ask for consent for data collection.'), + 'PERSON_LIST_HELP': ( + '', + 'Help text to display at the top of the people list.'), + 'ORGANISATION_LIST_HELP': ( + '', + 'Help text to display at the top of the organisaton list.'), +} # yapf: disable CONSTANCE_CONFIG_FIELDSETS = { 'Notice Banner': ( @@ -357,17 +365,16 @@ CONSTANCE_CONFIG_FIELDSETS = { 'NOTICE_CLASS', ), 'Data Collection': ('CONSENT_TEXT', ), + 'Help Text': ('PERSON_LIST_HELP', 'ORGANISATION_LIST_HELP'), } CONSTANCE_BACKEND = 'constance.backends.database.DatabaseBackend' - # Django Hijack settings # See https://django-hijack.readthedocs.io/en/stable/ HIJACK_USE_BOOTSTRAP = True - # Bootstrap settings # See https://django-bootstrap4.readthedocs.io/en/latest/settings.html diff --git a/people/templates/people/organisation/list.html b/people/templates/people/organisation/list.html index 03ba938..b0dfc24 100644 --- a/people/templates/people/organisation/list.html +++ b/people/templates/people/organisation/list.html @@ -14,6 +14,14 @@ New Organisation + {% with config.ORGANISATION_LIST_HELP as help_text %} + {% if help_text %} +
+ {{ help_text|linebreaks }} +
+ {% endif %} + {% endwith %} + {% for country, organisations in orgs_by_country.items %} diff --git a/people/templates/people/person/list.html b/people/templates/people/person/list.html index bca5628..77502bd 100644 --- a/people/templates/people/person/list.html +++ b/people/templates/people/person/list.html @@ -14,6 +14,14 @@ New Person + {% with config.PERSON_LIST_HELP as help_text %} + {% if help_text %} +
+ {{ help_text|linebreaks }} +
+ {% endif %} + {% endwith %} +