summaryrefslogtreecommitdiff
path: root/horizon/templates/horizon/common/_sidebar.html
blob: b5367674f48d49ef43863cd038a2c62b70b16083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{% load branding horizon i18n %}
{% load url from future %}

<div class='sidebar'>
  <h1 class="brand clearfix"><a href="{% url 'horizon:user_home' %}">{% site_branding %}</a></h1>

  {% horizon_main_nav %}

  {% if request.horizon.dashboard.supports_tenants %}
  <div id="tenant_switcher" class="dropdown switcher_bar" tabindex="1">
    {% with num_of_tenants=authorized_tenants|length %}
      {% if num_of_tenants > 1 %}
        <a class="dropdown-toggle" data-toggle="dropdown" href="#tenant_switcher">
      {% endif %}
        <h4>{% trans "Current Project" %}</h4>
        <h3>{{ request.user.tenant_name }}</h3>
      {% if num_of_tenants > 1 %}
      </a>
      {% endif %}

      {% 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 %}
        </ul>
      {% endif %}
    {% endwith %}
  </div>
  {% endif %}

  {% with num_of_regions=request.user.available_services_regions|length %}
  {% if num_of_regions > 1 %}
  <div id="services_region_switcher" class="dropdown switcher_bar" tabindex="1">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#services_region_switcher">
        <h4>{% trans "Managing Region" %}</h4>
        <h3>{{ request.user.services_region }}</h3>
    </a>

    <ul id="services_regions_list" class="dropdown-menu">
        <li class='divider'></li>
        {% for region in request.user.available_services_regions %}
        <li><a href="{% url 'switch_services_region' region %}?next={{ request.horizon.panel.get_absolute_url }}">{{ region }}</a></li>
        {% endfor %}
    </ul>
  </div>
  {% endif %}
  {% endwith %}

  {% horizon_dashboard_nav %}
</div>