User profile page: only display providers if there are some

Someone uses uMap with classic auth username/password, and they
don't want those empty HTML elements
This commit is contained in:
Yohan Boniface 2023-08-21 17:16:34 +02:00
parent 25b3a66351
commit a89e6622ed

View file

@ -19,30 +19,32 @@
<input type="submit" value="{% trans 'Save' %}" /> <input type="submit" value="{% trans 'Save' %}" />
</form> </form>
</div> </div>
<div class="row"> {% if backends.backends|length %}
<h3>{% trans "Your current providers" %}</h3> <div class="row">
<ul> <h3>{% trans "Your current providers" %}</h3>
{% for name in providers %}<li>{{ name|title }}</li>{% endfor %} <ul>
</ul> {% for name in providers %}<li>{{ name|title }}</li>{% endfor %}
</div>
<div class="row">
<h3>{% trans "Connect to another provider" %}</h3>
<p>
{% blocktrans %}It's a good habit to connect your account to more than one provider, in case one provider becomes unavailable, temporarily or even permanently.{% endblocktrans %}
</p>
<div>
<ul class="login-grid block-grid">
{% for name in backends.backends %}
{% if name not in providers %}
<li>
<a href="{% url "social:begin" name %}"
class="umap-login-popup login-{{ name }}"
title="{{ name|title }}"></a>
</li>
{% endif %}
{% endfor %}
</ul> </ul>
</div> </div>
</div> <div class="row">
<h3>{% trans "Connect to another provider" %}</h3>
<p>
{% blocktrans %}It's a good habit to connect your account to more than one provider, in case one provider becomes unavailable, temporarily or even permanently.{% endblocktrans %}
</p>
<div>
<ul class="login-grid block-grid">
{% for name in backends.backends %}
{% if name not in providers %}
<li>
<a href="{% url "social:begin" name %}"
class="umap-login-popup login-{{ name }}"
title="{{ name|title }}"></a>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div> </div>
{% endblock maincontent %} {% endblock maincontent %}