Skip to content

Commit

Permalink
Rename inclusion tag
Browse files Browse the repository at this point in the history
For better readability
  • Loading branch information
podliashanyk committed Oct 8, 2024
1 parent c965f5a commit 39d1272
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions python/nav/django/templatetags/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ def is_checkbox(field):
return isinstance(field.field.widget, forms.CheckboxInput)


@register.inclusion_tag('foundation-5/field.html', name='field')
@register.inclusion_tag('foundation-5/field.html')
def show_field(field):
"""Renders a form field using a predefined template.
Usage::
{% load forms %}
{% field form.my_field %}
{% show_field form.my_field %}
:param field: The form field to be rendered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% include 'custom_crispy_templates/_form_fields.html' with fields=form.attrs.form_fields %}
{% else %}
{% for field in form %}
{% field field %}
{% show_field field %}
{% endfor %}
{% endif %}
{% if form.attrs.submit_field %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
{% elif field.input_type == 'helpfield' %}
{% include 'custom_crispy_templates/field_helptext_as_icon.html' with field=field.field %}
{% else %}
{% field field %}
{% show_field field %}
{% endif %}
24 changes: 12 additions & 12 deletions python/nav/web/templates/seeddb/_seeddb_netbox_form_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<div class="columns large-4">
<fieldset>
<legend>Inventory</legend>
{% field form.ip %}
{% show_field form.ip %}
<div id="verify-address-feedback"></div>
{% field form.room %}
{% field form.category %}
{% field form.organization %}
{% show_field form.room %}
{% show_field form.category %}
{% show_field form.organization %}
</fieldset>
</div>

<div class="columns large-4">
<fieldset>
<legend>Management profiles</legend>
{% field form.profiles %}
{% show_field form.profiles %}
<input
type="button"
name="check_connectivity"
Expand All @@ -30,25 +30,25 @@
<fieldset>
<legend>Collected info</legend>
<div id="real_collected_fields" class="hide">
{% field form.sysname %}
{% field form.type %}
{% show_field form.sysname %}
{% show_field form.type %}
</div>
</fieldset>
</div>

<div class="columns large-4">
<fieldset>
<legend>Meta information</legend>
{% field form.function %}
{% field form.groups %}
{% field form.data %}
{% show_field form.function %}
{% show_field form.groups %}
{% show_field form.data %}
<a class='advanced-toggle'>
<i class='fa fa-caret-square-o-right'>&nbsp;</i>Advanced options
</a>
<div class="advanced">
<small class="alert-box">NB: An IP Device cannot both have a master and have virtual instances</small>
{% field form.master %}
{% field form.virtual_instance %}
{% show_field form.master %}
{% show_field form.virtual_instance %}
</div>
</fieldset>
</div>
Expand Down

0 comments on commit 39d1272

Please sign in to comment.