1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

customize file upload field

This commit is contained in:
checktheroads
2021-03-15 07:49:59 -07:00
parent 3f1714f076
commit 61f137866e

View File

@ -1,4 +1,5 @@
{% load form_helpers %} {% load form_helpers %}
{% load helpers %}
{% if field|widget_type == 'checkboxinput' %} {% if field|widget_type == 'checkboxinput' %}
<div class="mb-3"> <div class="mb-3">
@ -79,7 +80,19 @@
</ul> </ul>
</div> </div>
</div> </div>
{% elif field|widget_type == 'fileinput' %}
<div class="input-group mb-3">
<input
class="form-control"
type="file"
name="{{ field.name }}"
placeholder="{{ field.placeholder }}"
id="id_{{ field.name }}"
accept="{{ field.field.widget.attrs.accept }}"
{% if field.is_required %}required{% endif %}
/>
<label for="{{ field.id_for_label }}" class="input-group-text">{{ field.label|bettertitle }}</label>
</div>
{% else %} {% else %}
<div class="form-floating mb-3"> <div class="form-floating mb-3">
{{ field }} {{ field }}