mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-18 21:16:27 -06:00

* Fixes #19415: Increased Circuit/WirelessLink absolute distance upper limit Also adds form validation that provides a useful message to the user rather than a 500 error with potentially little information. * Include forgotten migration files * Remove unnecessary comments * Remove more unnecessary comments * Addresses PR feedback * Gah, remove django migration header comment * Clean up new has_field_errors mechanism, fix issue with ObjectAttribute * Address PR feedback, revert changes to render_fieldset template tag
71 lines
2.3 KiB
HTML
71 lines
2.3 KiB
HTML
{% load i18n %}
|
|
{% load form_helpers %}
|
|
<div class="field-group mb-5">
|
|
{% if heading %}
|
|
<div class="row">
|
|
<h2 class="col-9 offset-3">{{ heading }}</h2>
|
|
</div>
|
|
{% endif %}
|
|
{% for layout, title, items in rows %}
|
|
|
|
{% if layout == 'field' %}
|
|
{# Single form field #}
|
|
{% render_field items.0 %}
|
|
|
|
{% elif layout == 'attribute' %}
|
|
{# A static attribute of the form's instance #}
|
|
<div class="row mb-3">
|
|
<label class="col-sm-3 col-form-label text-lg-end required">{{ title }}</label>
|
|
<div class="col">
|
|
<div class="form-control-plaintext">
|
|
{{ items.0|linkify }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% elif layout == 'inline' %}
|
|
{# Multiple form fields on the same line #}
|
|
<div class="row mb-3">
|
|
<label class="col col-3 col-form-label text-lg-end">{{ title|default:'' }}</label>
|
|
{% for field in items %}
|
|
<div class="col mb-1">
|
|
{{ field }}
|
|
<div class="form-text">{% trans field.label %}</div>
|
|
{% if field.errors %}
|
|
<div class="form-text text-danger">
|
|
{% for error in field.errors %}{{ error }}{% if not forloop.last %}<br />{% endif %}{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% elif layout == 'tabs' %}
|
|
{# Tabbed groups of fields #}
|
|
<div class="row">
|
|
<div class="col offset-3">
|
|
<ul class="nav nav-pills mb-1" role="tablist">
|
|
{% for tab in items %}
|
|
<li role="presentation" class="nav-item">
|
|
<button role="tab" type="button" id="{{ tab.id }}_tab" data-bs-toggle="tab" aria-controls="{{ tab.id }}" data-bs-target="#{{ tab.id }}" class="nav-link {% if tab.active %}active{% endif %}">
|
|
{% trans tab.title %}
|
|
</button>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="tab-content p-0 border-0">
|
|
{% for tab in items %}
|
|
<div class="tab-pane {% if tab.active %}active{% endif %}" id="{{ tab.id }}" role="tabpanel" aria-labeled-by="{{ tab.id }}_tab">
|
|
{% for field in tab.fields %}
|
|
{% render_field field %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|