mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 06:13:36 -06:00
#19713: Extend render_form() template tag to support meta fields
This commit is contained in:
parent
ead8a03893
commit
99a65eedfc
@ -1,8 +1,25 @@
|
||||
{% load form_helpers %}
|
||||
|
||||
{# Hidden fields #}
|
||||
{% for field in form.hidden_fields %}
|
||||
{{ field }}
|
||||
{{ field }}
|
||||
{% endfor %}
|
||||
|
||||
{# Normal fields #}
|
||||
{% for field in form.visible_fields %}
|
||||
{% if not form.meta_fields or field.name not in form.meta_fields %}
|
||||
{% render_field field %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# Meta fields #}
|
||||
{% if form.meta_fields %}
|
||||
<div class="bg-primary-subtle border border-primary rounded-1 pt-3 px-3 mb-3">
|
||||
{% if form.changelog_message %}
|
||||
{% render_field form.changelog_message %}
|
||||
{% endif %}
|
||||
{% if form.background_job %}
|
||||
{% render_field form.background_job %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user