Merge "Sort tenants in tenant dropdown, per #1234993"

This commit is contained in:
Jenkins 2013-10-08 22:19:44 +00:00 committed by Gerrit Code Review
commit ee3530c15d

View File

@ -21,11 +21,13 @@
{% if num_of_tenants > 1 %}
<ul id="tenant_list" class="dropdown-menu">
<li class='divider'></li>
{% for tenant in authorized_tenants %}
{% if tenant.enabled and tenant.id != request.user.tenant_id %}
<li><a href="{% url 'switch_tenants' tenant.id %}?next={{ request.horizon.dashboard.get_absolute_url }}">{{ tenant.name }}</a></li>
{% endif %}
{% endfor %}
{% with authorized_tenants_sorted=authorized_tenants|dictsort:"name" %}
{% for tenant in authorized_tenants_sorted %}
{% if tenant.enabled and tenant.id != request.user.tenant_id %}
<li><a href="{% url 'switch_tenants' tenant.id %}?next={{ request.horizon.dashboard.get_absolute_url }}">{{ tenant.name }}</a></li>
{% endif %}
{% endfor %}
{% endwith %}
</ul>
{% endif %}
{% endwith %}