Hide linking button on profile frontend if the user is already linked (fixes #11328).

This commit is contained in:
Mikaël Ates 2016-06-13 17:15:06 +02:00
parent b4f0b51777
commit 40ff5afd57
1 changed files with 17 additions and 16 deletions

View File

@ -6,22 +6,23 @@
<div id="fc-linking">
<div class="fc">
<div class="cadre">
<p>
<div id="fc-button-wrapper">
<div id="fc-button">
<a id="fc-button" href="{% url 'fc-login-or-link' %}?next={% url 'account_management' %}" title="{% trans 'Link with a FranceConnect account' %}" class="connexion"><div>{% trans "Link with a FranceConnect account" %}<img src="{% static 'authentic2_auth_fc/img/fc_logo_mini.png' %}"></img></div></a>
</div>
</div>
</p>
{% if user.fc_accounts.all %}
<p class="centrer">
{% trans "Linked FranceConnect accounts" %}
</p>
<ul class="fond">
{% for fc_account in user.fc_accounts.all %}
<li class="picto utilisateur"><p class="lien">{{ fc_account }}{% if unlink %} <a href="{% url 'fc-unlink' pk=fc_account.pk %}">{% trans 'Delete link'%}</a>{% endif %}</p></li>
{% endfor %}
</ul>
{% if user.fc_accounts.exists %}
<p class="centrer">
{% trans "Linked FranceConnect accounts" %}
</p>
<ul class="fond">
{% for fc_account in user.fc_accounts.all %}
<li class="picto utilisateur"><p class="lien">{{ fc_account }}{% if unlink %} <a href="{% url 'fc-unlink' pk=fc_account.pk %}">{% trans 'Delete link'%}</a>{% endif %}</p></li>
{% endfor %}
</ul>
{% else %}
<p>
<div id="fc-button-wrapper">
<div id="fc-button">
<a id="fc-button" href="{% url 'fc-login-or-link' %}?next={% url 'account_management' %}" title="{% trans 'Link with a FranceConnect account' %}" class="connexion"><div>{% trans "Link with a FranceConnect account" %}<img src="{% static 'authentic2_auth_fc/img/fc_logo_mini.png' %}"></img></div></a>
</div>
</div>
</p>
{% endif %}
</div>
</div>