64 lines
2.1 KiB
HTML
64 lines
2.1 KiB
HTML
<div class="nav-item dropdown netbox-utilities-tenant">
|
|
<button
|
|
class="nav-link px-2"
|
|
type="button"
|
|
data-bs-toggle="dropdown"
|
|
aria-expanded="false"
|
|
title="Globaler Mandantenfilter"
|
|
aria-label="Globaler Mandantenfilter"
|
|
>
|
|
<i class="mdi mdi-domain" aria-hidden="true"></i>
|
|
<span class="d-none d-xl-inline ms-1 tenant-filter-label">
|
|
{% if selected_tenant %}
|
|
{{ selected_tenant }}
|
|
{% elif selected_tenant_group %}
|
|
{{ selected_tenant_group }}
|
|
{% else %}
|
|
Alle Mandanten
|
|
{% endif %}
|
|
</span>
|
|
<i class="mdi mdi-chevron-down" aria-hidden="true"></i>
|
|
</button>
|
|
<div class="dropdown-menu dropdown-menu-end p-3 tenant-filter-menu">
|
|
<form action="{% url 'plugins:netbox_utilities:select_tenant' %}" method="post">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{{ return_url }}">
|
|
<label class="form-label fw-bold">
|
|
Mandant oder Mandantengruppe
|
|
</label>
|
|
<select
|
|
class="form-select"
|
|
name="scope"
|
|
onchange="this.form.submit()"
|
|
aria-label="Mandant global auswählen"
|
|
>
|
|
<option value="">Alle Mandanten</option>
|
|
{% if tenant_groups %}
|
|
<optgroup label="Mandantengruppen">
|
|
{% for group in tenant_groups %}
|
|
<option value="group:{{ group.pk }}"{% if selected_tenant_group.pk == group.pk %} selected{% endif %}>
|
|
{{ group.name }}
|
|
</option>
|
|
{% endfor %}
|
|
</optgroup>
|
|
{% endif %}
|
|
{% if tenants %}
|
|
<optgroup label="Mandanten">
|
|
{% for tenant in tenants %}
|
|
<option value="tenant:{{ tenant.pk }}"{% if selected_tenant.pk == tenant.pk %} selected{% endif %}>
|
|
{{ tenant.name }}
|
|
</option>
|
|
{% endfor %}
|
|
</optgroup>
|
|
{% endif %}
|
|
</select>
|
|
<noscript>
|
|
<button class="btn btn-primary w-100 mt-2" type="submit">Anwenden</button>
|
|
</noscript>
|
|
<p class="text-secondary small mb-0 mt-2">
|
|
Gruppen schließen alle direkt und untergeordnet zugeordneten Mandanten ein.
|
|
</p>
|
|
</form>
|
|
</div>
|
|
</div>
|