mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Initial push to public repo
This commit is contained in:
52
netbox/templates/utilities/render_field.html
Normal file
52
netbox/templates/utilities/render_field.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{% load form_helpers %}
|
||||
|
||||
<div class="form-group{% if field.errors %} has-error{% endif %}">
|
||||
{% if field|widget_type == 'checkboxinput' %}
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<div class="checkbox{% if field.errors %} has-error{% endif %}">
|
||||
<label for="{{ field.id_for_label }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% elif field|widget_type == 'radioselect' %}
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<div class="radio{% if field.errors %} has-error{% endif %}">
|
||||
<label for="{{ field.id_for_label }}">
|
||||
{{ field }}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{% elif field|widget_type == 'textarea' %}
|
||||
<div class="col-md-12">
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text|safe }}</span>
|
||||
{% endif %}
|
||||
{% if field.errors %}
|
||||
<ul>
|
||||
{% for error in field.errors %}
|
||||
<li class="text-danger">{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<label class="col-md-3 control-label{% if field.field.required %} required{% endif %}" for="{{ field.id_for_label }}">{{ field.label }}</label>
|
||||
<div class="col-md-9">
|
||||
{{ field }}
|
||||
{% if field.help_text %}
|
||||
<span class="help-block">{{ field.help_text|safe }}</span>
|
||||
{% endif %}
|
||||
{% if field.errors %}
|
||||
<ul>
|
||||
{% for error in field.errors %}
|
||||
<li class="text-danger">{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
Reference in New Issue
Block a user