Skip to content

Commit

Permalink
Sort tenants in tenant dropdown, per #1234993
Browse files Browse the repository at this point in the history
Change-Id: I6e2fd3868ac3b0b0d1704bf034e6546726fda5c3
Closes-Bug: #1234993
  • Loading branch information
Dan Reif committed Oct 8, 2013
1 parent 9c08d88 commit 03383e7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions horizon/templates/horizon/common/_sidebar.html
Expand Up @@ -21,11 +21,13 @@ <h3>{{ request.user.tenant_name }}</h3>
{% 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 %}
Expand Down

0 comments on commit 03383e7

Please sign in to comment.