ui: place connection VLANs below cable B side

This commit is contained in:
2026-08-25 12:03:45 +02:00
parent 4421000409
commit d245ae0f79
7 changed files with 135 additions and 8 deletions
@@ -1,12 +1,120 @@
{% load static %}
{% load helpers %}
{% load form_helpers %}
{% load i18n %}
{% include 'dcim/htmx/cable_edit.html' %}
{% for field in form.hidden_fields %}
{{ field }}
{% endfor %}
{% if form.utilities_vlans %}
{# A side termination #}
<div class="field-group mb-5">
<div class="row">
<h2 class="col-9 offset-3">{% trans "A Side" %}</h2>
</div>
{% render_field form.a_terminations_type %}
{% if 'termination_a_device' in form.fields %}
{% render_field form.termination_a_device %}
{% endif %}
{% if 'termination_a_powerpanel' in form.fields %}
{% render_field form.termination_a_powerpanel %}
{% endif %}
{% if 'termination_a_circuit' in form.fields %}
{% render_field form.termination_a_circuit %}
{% endif %}
{% if 'a_terminations' in form.fields %}
{% render_field form.a_terminations %}
{% endif %}
</div>
{# B side termination and connection VLANs #}
<div class="field-group mb-5">
<div class="row">
<h2 class="col-9 offset-3">{% trans "B Side" %}</h2>
</div>
{% render_field form.b_terminations_type %}
{% if 'termination_b_device' in form.fields %}
{% render_field form.termination_b_device %}
{% endif %}
{% if 'termination_b_powerpanel' in form.fields %}
{% render_field form.termination_b_powerpanel %}
{% endif %}
{% if 'termination_b_circuit' in form.fields %}
{% render_field form.termination_b_circuit %}
{% endif %}
{% if 'b_terminations' in form.fields %}
{% render_field form.b_terminations %}
{% endif %}
{% if form.utilities_vlans %}
{% render_field form.utilities_vlans %}
{% endif %}
</div>
{# Cable attributes #}
<div class="field-group mb-5">
<div class="row">
<h2 class="col-9 offset-3">{% trans "Cable" %}</h2>
</div>
{% render_field form.status %}
{% render_field form.profile %}
{% render_field form.type %}
{% render_field form.bundle %}
{% render_field form.label %}
{% render_field form.description %}
{% render_field form.color %}
<div class="row mb-3{% if form.length.errors or form.length_unit.errors %} has-errors{% endif %}">
<label class="col-sm-3 col-form-label text-lg-end">{{ form.length.label }}</label>
<div class="col-md-5">
{% render_field_with_aria form.length %}
{% if form.length.errors %}
<div class="form-text text-danger" id="{{ form.length.auto_id }}_errors" role="alert">
{% for error in form.length.errors %}{{ error }}{% if not forloop.last %}<br />{% endif %}{% endfor %}
</div>
{% endif %}
</div>
<div class="col-md-4">
{% render_field_with_aria form.length_unit %}
{% if form.length_unit.errors %}
<div class="form-text text-danger" id="{{ form.length_unit.auto_id }}_errors" role="alert">
{% for error in form.length_unit.errors %}{{ error }}{% if not forloop.last %}<br />{% endif %}{% endfor %}
</div>
{% endif %}
</div>
</div>
{% render_field form.tags %}
</div>
<div class="field-group mb-5">
<div class="row">
<h2 class="col-9 offset-3">{% trans "Tenancy" %}</h2>
</div>
{% render_field form.tenant_group %}
{% render_field form.tenant %}
</div>
<div class="field-group mb-5">
<div class="row">
<h2 class="col-9 offset-3">{% trans "Ownership" %}</h2>
</div>
{% render_field form.owner_group %}
{% render_field form.owner %}
</div>
{% if form.custom_fields %}
<div class="field-group mb-5">
<div class="row">
<h2 class="col-9 offset-3">VLANs der Verbindung</h2>
<h2 class="col-9 offset-3">{% trans "Custom Fields" %}</h2>
</div>
{% render_field form.utilities_vlans %}
{% render_custom_fields form %}
</div>
{% endif %}
<div class="field-group mb-5">
<h2 class="text-center">{% trans "Comments" %}</h2>
{% render_field form.comments %}
</div>
{# Meta fields #}
<div class="bg-primary-subtle border border-primary rounded-1 pt-3 px-3 mb-3">
{% render_field form.changelog_message %}
</div>