-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2108 from DemocracyClub/feature-flag-hustings
Feature flag the hustings CTA
- Loading branch information
Showing
3 changed files
with
37 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.conf import settings | ||
|
||
|
||
def show_hustings_cta(request): | ||
return {"SHOW_HUSTINGS_CTA": getattr(settings, "SHOW_HUSTINGS_CTA", False)} |
57 changes: 30 additions & 27 deletions
57
wcivf/apps/hustings/templates/hustings/includes/_ballot.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
{% load i18n %} | ||
<div class="ds-card" id="hustings"> | ||
<div class="ds-card-body"> | ||
<h3> | ||
<span aria-hidden="true">📅</span> | ||
{% trans "Election events" %} | ||
</h3> | ||
{% if postelection.husting_set.displayable.exists %} | ||
<p>{% trans "You can meet candidates and question them at events (often known as 'hustings'). Here are some events that are taking place:" %}</p> | ||
{% include "hustings/includes/_list.html" with hustings=postelection.husting_set.displayable %} | ||
<p><small> | ||
{% trans "Events are reported by users, if you spot an error, please" %} <a | ||
href="https://democracyclub.org.uk/contact/">{% trans "get in touch" %}</a> | ||
</small></p> | ||
<hr> | ||
<p> | ||
{% trans "Do you know about any other events in the area? If so, please" %} <a | ||
href="{% url 'hustings:add-husting' ballot_paper_id=postelection.ballot_paper_id %}">{% trans "tell us about them" %}</a>. | ||
</p> | ||
{% if postelection.husting_set.displayable.exists or SHOW_HUSTINGS_CTA %} | ||
<div class="ds-card" id="hustings"> | ||
<div class="ds-card-body"> | ||
<h3> | ||
<span aria-hidden="true">📅</span> | ||
{% trans "Election events" %} | ||
</h3> | ||
{% if postelection.husting_set.displayable.exists %} | ||
<p>{% trans "You can meet candidates and question them at events (often known as 'hustings'). Here are some events that are taking place:" %}</p> | ||
{% include "hustings/includes/_list.html" with hustings=postelection.husting_set.displayable %} | ||
<p><small> | ||
{% trans "Events are reported by users, if you spot an error, please" %} <a | ||
href="https://democracyclub.org.uk/contact/">{% trans "get in touch" %}</a> | ||
</small></p> | ||
<hr> | ||
<p> | ||
{% trans "Do you know about any other events in the area? If so, please" %} <a | ||
href="{% url 'hustings:add-husting' ballot_paper_id=postelection.ballot_paper_id %}">{% trans "tell us about them" %}</a>. | ||
</p> | ||
|
||
|
||
{% else %} | ||
<p> | ||
{% trans "Do you know about any events (often known as 'hustings')? If so, please" %} | ||
<a href="{% url 'hustings:add-husting' ballot_paper_id=postelection.ballot_paper_id %}"> | ||
{% trans "tell us about them" %} | ||
</a>. | ||
</p> | ||
{% endif %} | ||
{% else %} | ||
<p> | ||
{% trans "Do you know about any events (often known as 'hustings')? If so, please" %} | ||
<a href="{% url 'hustings:add-husting' ballot_paper_id=postelection.ballot_paper_id %}"> | ||
{% trans "tell us about them" %} | ||
</a>. | ||
</p> | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters