mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
feat: add configurable help text to questions
This commit is contained in:
@@ -76,7 +76,8 @@ class DynamicAnswerSetBase(forms.Form):
|
|||||||
widget=field_widget,
|
widget=field_widget,
|
||||||
required=(self.field_required
|
required=(self.field_required
|
||||||
and not question.allow_free_text),
|
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
|
self.fields[field_name] = field
|
||||||
field_order.append(field_name)
|
field_order.append(field_name)
|
||||||
|
|
||||||
|
|||||||
53
people/migrations/0045_question_help_text.py
Normal file
53
people/migrations/0045_question_help_text.py
Normal file
@@ -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),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -27,12 +27,19 @@ class Question(models.Model):
|
|||||||
#: Text of question - 1st person
|
#: Text of question - 1st person
|
||||||
text = models.CharField(max_length=255, blank=False, null=False)
|
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(
|
filter_text = models.CharField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=False,
|
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?
|
#: Should answers to this question be considered public?
|
||||||
answer_is_public = models.BooleanField(
|
answer_is_public = models.BooleanField(
|
||||||
|
|||||||
Reference in New Issue
Block a user