diff --git a/wcivf/apps/hustings/context_processors.py b/wcivf/apps/hustings/context_processors.py new file mode 100644 index 000000000..4b414e03e --- /dev/null +++ b/wcivf/apps/hustings/context_processors.py @@ -0,0 +1,5 @@ +from django.conf import settings + + +def show_hustings_cta(request): + return {"SHOW_HUSTINGS_CTA": getattr(settings, "SHOW_HUSTINGS_CTA", False)} diff --git a/wcivf/apps/hustings/templates/hustings/includes/_ballot.html b/wcivf/apps/hustings/templates/hustings/includes/_ballot.html index 87399b675..51d47dd40 100644 --- a/wcivf/apps/hustings/templates/hustings/includes/_ballot.html +++ b/wcivf/apps/hustings/templates/hustings/includes/_ballot.html @@ -1,32 +1,35 @@ {% load i18n %} -
{% trans "You can meet candidates and question them at events (often known as 'hustings'). Here are some events that are taking place:" %}
- {% include "hustings/includes/_list.html" with hustings=postelection.husting_set.displayable %} -- {% trans "Events are reported by users, if you spot an error, please" %} {% trans "get in touch" %} -
-- {% trans "Do you know about any other events in the area? If so, please" %} {% trans "tell us about them" %}. -
+{% if postelection.husting_set.displayable.exists or SHOW_HUSTINGS_CTA %} +{% trans "You can meet candidates and question them at events (often known as 'hustings'). Here are some events that are taking place:" %}
+ {% include "hustings/includes/_list.html" with hustings=postelection.husting_set.displayable %} ++ {% trans "Events are reported by users, if you spot an error, please" %} {% trans "get in touch" %} +
++ {% trans "Do you know about any other events in the area? If so, please" %} {% trans "tell us about them" %}. +
- {% else %} -- {% trans "Do you know about any events (often known as 'hustings')? If so, please" %} - - {% trans "tell us about them" %} - . -
- {% endif %} + {% else %} ++ {% trans "Do you know about any events (often known as 'hustings')? If so, please" %} + + {% trans "tell us about them" %} + . +
+ {% endif %} +