Skip to content

Commit

Permalink
Merge pull request #326 from maykinmedia/issue/879-editable-titles
Browse files Browse the repository at this point in the history
[#879] Added configuration fields for questionnaire block's (sub-)titles
  • Loading branch information
alextreme authored Nov 10, 2022
2 parents 10f5494 + c17eb67 commit 6f11dc2
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/open_inwoner/configurations/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ class SiteConfigurarionAdmin(OrderedInlineModelAdminMixin, SingletonModelAdmin):
"home_map_intro",
"theme_title",
"theme_intro",
"home_questionnaire_title",
"home_questionnaire_subtitle",
"select_questionnaire_title",
"select_questionnaire_subtitle",
),
},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 3.2.15 on 2022-11-10 13:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("configurations", "0020_siteconfiguration_login_show"),
]

operations = [
migrations.AddField(
model_name="siteconfiguration",
name="home_questionnaire_subtitle",
field=models.CharField(
default="Test met een paar simpele vragen of u recht heeft op een product",
help_text="Questionnaire sub-title on the home page.",
max_length=255,
verbose_name="Home page questionaire sub-title",
),
),
migrations.AddField(
model_name="siteconfiguration",
name="home_questionnaire_title",
field=models.CharField(
default="Waar bent u naar op zoek?",
help_text="Questionnaire title on the home page.",
max_length=255,
verbose_name="Home page questionaire title",
),
),
migrations.AddField(
model_name="siteconfiguration",
name="select_questionnaire_subtitle",
field=models.CharField(
default="Kies hieronder één van de volgende vragenlijsten om de zelfdiagnose te starten.",
help_text="Questionaire selector sub-title on the theme and profile pages.",
max_length=255,
verbose_name="Questionaire selector widget sub-title",
),
),
migrations.AddField(
model_name="siteconfiguration",
name="select_questionnaire_title",
field=models.CharField(
default="Keuze zelfdiagnose?",
help_text="Questionaire selector title on the theme and profile pages.",
max_length=255,
verbose_name="Questionaire selector widget title",
),
),
]
26 changes: 26 additions & 0 deletions src/open_inwoner/configurations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,32 @@ class SiteConfiguration(SingletonModel):
blank=True,
help_text=_("Map's intro text on the home page."),
)
home_questionnaire_title = models.CharField(
max_length=255,
default=_("Waar bent u naar op zoek?"),
verbose_name=_("Home page questionaire title"),
help_text=_("Questionnaire title on the home page."),
)
home_questionnaire_subtitle = models.CharField(
max_length=255,
default=_("Test met een paar simpele vragen of u recht heeft op een product"),
verbose_name=_("Home page questionaire sub-title"),
help_text=_("Questionnaire sub-title on the home page."),
)
select_questionnaire_title = models.CharField(
max_length=255,
default=_("Keuze zelfdiagnose?"),
verbose_name=_("Questionaire selector widget title"),
help_text=_("Questionaire selector title on the theme and profile pages."),
)
select_questionnaire_subtitle = models.CharField(
max_length=255,
default=_(
"Kies hieronder één van de volgende vragenlijsten om de zelfdiagnose te starten."
),
verbose_name=_("Questionaire selector widget sub-title"),
help_text=_("Questionaire selector sub-title on the theme and profile pages."),
)
footer_visiting_title = models.CharField(
max_length=255,
default="",
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/pages/category/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ <h1 class="h1">
<div class="grid">
<div class="column column--start-1 column--span-6 ">
<aside class="questionnaire">
<h2 class="h2">{% trans "Keuze zelfdiagnose?" %}</h2>
<p class="p">{% trans "Kies hieronder één van de volgende vragenlijsten om de zelfdiagnose te starten." %}</p>
<h2 class="h2">{{configurable_text.questionnaire_page.select_questionnaire_title}}</h2>
<p class="p">{{configurable_text.questionnaire_page.select_questionnaire_subtitle}}</p>
{% questionnaire root_nodes=questionnaire_roots %}
</aside>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ <h2 class="h2">
{% endif %}

{% if questionnaire_roots.exists %}
<h2 class="h2">{% trans "Waar bent u naar op zoek?" %}</h2>
<p class="p">{% trans "Wij helpen u graag op weg." %}</p>
<h2 class="h2">{{configurable_text.home_page.home_questionnaire_title}}</h2>
<p class="p">{{configurable_text.home_page.home_questionnaire_subtitle}}</p>

{% questionnaire root_nodes=questionnaire_roots %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions src/open_inwoner/templates/pages/profile/questionnaire.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{% load i18n questionnaire_tags %}

{% block content %}
<h1 class="h1">{% trans "Keuze zelfdiagnose" %}</h1>
<p class="p">{% trans "Kies hieronder één van de volgende vragenlijsten om de zelfdiagnose te starten." %}</p>
<h1 class="h1">{{configurable_text.questionnaire_page.select_questionnaire_title}}</h1>
<p class="p">{{configurable_text.questionnaire_page.select_questionnaire_subtitle}}</p>

{% questionnaire root_nodes=root_nodes %}
{% endblock content %}
{% endblock content %}
6 changes: 6 additions & 0 deletions src/open_inwoner/utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ def settings(request):
"home_theme_intro": config.home_theme_intro,
"home_map_title": config.home_map_title,
"home_map_intro": config.home_map_intro,
"home_questionnaire_title": config.home_questionnaire_title,
"home_questionnaire_subtitle": config.home_questionnaire_subtitle,
},
"theme_page": {
"theme_title": config.theme_title,
"theme_intro": config.theme_intro,
},
"questionnaire_page": {
"select_questionnaire_title": config.select_questionnaire_title,
"select_questionnaire_subtitle": config.select_questionnaire_subtitle,
},
"footer": {
"footer_visiting_title": config.footer_visiting_title,
"footer_visiting_intro": config.footer_visiting_intro,
Expand Down

0 comments on commit 6f11dc2

Please sign in to comment.