Skip to content

Commit

Permalink
Fix party conditional
Browse files Browse the repository at this point in the history
I've also fixed an error with the conditional in the templates that was causing two
regional manifestos to appear in some cases.

This also adds the missing Welsh Conservative manifesto.
  • Loading branch information
VirginiaDooley authored and Virginia Dooley committed Jun 25, 2024
1 parent 6b973ae commit 3611f95
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions wcivf/apps/parties/templates/parties/regional_manifesto.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,51 @@
{% load i18n %}

{% if party_name == "Labour Party" or "Labour and Co-operative Party" %}
{% if object.featured_candidacy.party_name == "Labour Party" or object.featured_candidacy.party_name == "Labour and Co-operative Party" %}
{% if object.featured_candidacy.post_election.post.nice_territory == "Scotland" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
{% blocktrans trimmed with party_name=object.featured_candidacy.party_name %}
The {{ party_name }} have also released a <a href="https://labour.org.uk/change/scotland/">manifesto for Scotland</a>.
{% endblocktrans %}
</li>
{% endif %}

{% if object.featured_candidacy.post_election.post.nice_territory == "Wales" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
{% blocktrans trimmed with party_name=object.featured_candidacy.party_name %}
The {{ party_name }} have also released a <a href="https://labour.org.uk/change/wales/">manifesto for Wales</a>.
{% endblocktrans %}
</li>
{% endif %}
{% endif %}

{% if party_name == "Conservative and Unionist Party" or "Conservative Party" %}
{% if object.featured_candidacy.party_name == "Conservative and Unionist Party" or object.featured_candidacy.party_name == "Conservative Party" %}
{% if object.featured_candidacy.post_election.post.nice_territory == "Scotland" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
{% blocktrans trimmed with party_name=object.featured_candidacy.party_name %}
The {{ party_name }} have also released a <a href="https://www.scottishconservatives.com/manifestos/2024-general-election-manifesto/">manifesto for Scotland</a>.
{% endblocktrans %}
</li>
{% endif %}
{% comment %} {% if object.featured_candidacy.post_election.post.nice_territory == "Wales" %}
{% if object.featured_candidacy.post_election.post.nice_territory == "Wales" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
The {{ party_name }} have also released a <a href="">manifesto for Wales</a>.
The {{ party_name }} have also released a <a href="https://www.conservatives.wales/manifesto24">manifesto for Wales</a>.
{% endblocktrans %}
</li>
{% endif %} {% endcomment %}
{% endif %}
{% endif %}

{% if object.featured_candidacy.party_name == "Liberal Democrats" %}
{% if object.featured_candidacy.post_election.post.nice_territory == "Scotland" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
{% blocktrans trimmed with party_name=object.featured_candidacy.party_name %}
The {{ party_name }} have also released a <a href="https://www.scotlibdems.org.uk/fairdeal">manifesto for Scotland</a>.
{% endblocktrans %}
</li>
{% endif %}

{% if object.featured_candidacy.post_election.post.nice_territory == "Wales" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
{% blocktrans trimmed with party_name=object.featured_candidacy.party_name %}
The {{ party_name }} have also released a <a href="https://www.libdems.wales/fairdeal">manifesto for Wales</a>.
{% endblocktrans %}
</li>
Expand All @@ -55,7 +54,7 @@
{% if object.featured_candidacy.party_name == "Green Party" %}
{% if object.featured_candidacy.post_election.post.nice_territory == "Wales" %}
<li>
{% blocktrans trimmed with party_name=party_name %}
{% blocktrans trimmed with party_name=object.featured_candidacy.party_name %}
The {{ party_name }} have also released a <a href="https://wales.greenparty.org.uk/manifesto-2024-2/">manifesto for Wales</a>.
{% endblocktrans %}
</li>
Expand Down

0 comments on commit 3611f95

Please sign in to comment.