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 "Election events" %} -

- {% if postelection.husting_set.displayable.exists %} -

{% 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 "Election events" %} +

+ {% if postelection.husting_set.displayable.exists %} +

{% 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 %} +
-
+ +{% endif %} diff --git a/wcivf/settings/base.py b/wcivf/settings/base.py index dae3e8646..de801a295 100644 --- a/wcivf/settings/base.py +++ b/wcivf/settings/base.py @@ -156,6 +156,7 @@ def get_ec2_ip(): "core.context_processors.postcode_form", "core.context_processors.referer_postcode", "core.context_processors.use_i18n", + "hustings.context_processors.show_hustings_cta", "feedback.context_processors.feedback_form", "dealer.contrib.django.context_processor", ] @@ -328,6 +329,7 @@ def get_ec2_ip(): POSTCODE_LOGGER = DCWidePostcodeLoggingClient(**firehose_args) SHOW_PARL_BOUNDARY_CHANGES = os.environ.get("SHOW_PARL_BOUNDARY_CHANGES", False) +SHOW_HUSTINGS_CTA = False ENABLE_LAYERS_OF_STATE_FEATURE = os.environ.get( "ENABLE_LAYERS_OF_STATE_FEATURE", False )