diff --git a/people/forms.py b/people/forms.py index d0f397b..4d3b1a4 100644 --- a/people/forms.py +++ b/people/forms.py @@ -76,7 +76,8 @@ class DynamicAnswerSetBase(forms.Form): widget=field_widget, required=(self.field_required and not question.allow_free_text), - initial=initial.get(field_name, None)) + initial=initial.get(field_name, None), + help_text=question.help_text if not as_filters else '') self.fields[field_name] = field field_order.append(field_name) diff --git a/people/migrations/0045_question_help_text.py b/people/migrations/0045_question_help_text.py new file mode 100644 index 0000000..2d87317 --- /dev/null +++ b/people/migrations/0045_question_help_text.py @@ -0,0 +1,53 @@ +# Generated by Django 2.2.10 on 2021-03-10 09:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('people', '0044_themes_to_admin_question'), + ] + + operations = [ + migrations.AddField( + model_name='organisationquestion', + name='help_text', + field=models.CharField(blank=True, help_text='Additional hint text to be displayed with the question', max_length=255), + ), + migrations.AddField( + model_name='organisationrelationshipquestion', + name='help_text', + field=models.CharField(blank=True, help_text='Additional hint text to be displayed with the question', max_length=255), + ), + migrations.AddField( + model_name='personquestion', + name='help_text', + field=models.CharField(blank=True, help_text='Additional hint text to be displayed with the question', max_length=255), + ), + migrations.AddField( + model_name='relationshipquestion', + name='help_text', + field=models.CharField(blank=True, help_text='Additional hint text to be displayed with the question', max_length=255), + ), + migrations.AlterField( + model_name='organisationquestion', + name='filter_text', + field=models.CharField(blank=True, help_text='Alternative text to be displayed in network filters - 3rd person', max_length=255), + ), + migrations.AlterField( + model_name='organisationrelationshipquestion', + name='filter_text', + field=models.CharField(blank=True, help_text='Alternative text to be displayed in network filters - 3rd person', max_length=255), + ), + migrations.AlterField( + model_name='personquestion', + name='filter_text', + field=models.CharField(blank=True, help_text='Alternative text to be displayed in network filters - 3rd person', max_length=255), + ), + migrations.AlterField( + model_name='relationshipquestion', + name='filter_text', + field=models.CharField(blank=True, help_text='Alternative text to be displayed in network filters - 3rd person', max_length=255), + ), + ] diff --git a/people/models/question.py b/people/models/question.py index 8bdb245..d0daa2c 100644 --- a/people/models/question.py +++ b/people/models/question.py @@ -27,12 +27,19 @@ class Question(models.Model): #: Text of question - 1st person text = models.CharField(max_length=255, blank=False, null=False) - #: Text to be displayed in network filters - 3rd person + #: Alternative text to be displayed in network filters - 3rd person filter_text = models.CharField( max_length=255, blank=True, null=False, - help_text='Text to be displayed in network filters - 3rd person') + help_text='Alternative text to be displayed in network filters - 3rd person') + + help_text = models.CharField( + help_text='Additional hint text to be displayed with the question', + max_length=255, + blank=True, + null=False + ) #: Should answers to this question be considered public? answer_is_public = models.BooleanField(