Skip to content

Commit

Permalink
Merge pull request #1783 from DemocracyClub/fix-email-display
Browse files Browse the repository at this point in the history
Fix template logic to show email address
  • Loading branch information
symroe authored Feb 27, 2024
2 parents fd82fcd + c03e657 commit f9d1978
Showing 1 changed file with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,24 @@ <h2 class="ds-candidate-name ds-h3">
</div>
{% endif %}

{% if object.email and object.current_or_future_candidacies %}
<div>
<dt>{% trans "Email" %}</dt>
<dd>
<a href="mailto:{{ object.email }}" title="{% blocktrans trimmed with person_name=object.name%}{{ person_name }}'s email{% endblocktrans%}">{{ object.email }}</a>
</dd>
</div>
{% else %}
<div>
{% blocktrans trimmed with person_name=object.name %}<dt>We don't know {{ person_name }}'s email address.</dt>{% endblocktrans %}
<dd>
<a href="{{ object.get_ynr_url }}">{% trans "Can you add it?" %}</a>
</dd>
</div>
{% if object.current_or_future_candidacies %}
{% if object.email %}
<div>
<dt>{% trans "Email" %}</dt>
<dd>
<a href="mailto:{{ object.email }}" title="{% blocktrans trimmed with person_name=object.name%}{{ person_name }}'s email{% endblocktrans%}">{{ object.email }}</a>
</dd>
</div>
{% else %}
<div>
{% blocktrans trimmed with person_name=object.name %}<dt>We don't know {{ person_name }}'s email address.</dt>{% endblocktrans %}
<dd>
<a href="{{ object.get_ynr_url }}">{% trans "Can you add it?" %}</a>
</dd>
</div>
{% endif %}
{% endif %}

</dl>
</div>
</section>

0 comments on commit f9d1978

Please sign in to comment.