2016-03-01 11:23:03 -05:00
|
|
|
{% load form_helpers %}
|
2021-03-15 07:49:59 -07:00
|
|
|
{% load helpers %}
|
2016-03-01 11:23:03 -05:00
|
|
|
|
2021-03-13 02:19:42 -07:00
|
|
|
{% if field|widget_type == 'checkboxinput' %}
|
2021-07-20 01:26:45 -07:00
|
|
|
<div class="row mb-3">
|
2021-07-20 13:55:15 -04:00
|
|
|
<div class="col-sm-3"></div>
|
2021-07-20 01:26:45 -07:00
|
|
|
<div class="col">
|
|
|
|
<div class="form-check{% if field.errors %} has-error{% endif %}">
|
|
|
|
{{ field }}
|
|
|
|
<label for="{{ field.id_for_label }}" class="form-check-label">
|
|
|
|
{{ field.label }}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
{% if field.help_text %}
|
|
|
|
<span class="form-text">{{ field.help_text|safe }}</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if bulk_nullable %}
|
|
|
|
<div class="form-check my-1">
|
|
|
|
<input type="checkbox" class="form-check-input" name="_nullify" value="{{ field.name }}" />
|
|
|
|
<label class="form-check-label">Set Null</label>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-03-13 02:19:42 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif field|widget_type == 'textarea' and not field.label %}
|
2021-07-20 01:26:45 -07:00
|
|
|
<div class="row mb-3">
|
2021-08-04 10:57:01 -07:00
|
|
|
{% if label %}
|
2021-08-05 09:59:13 -07:00
|
|
|
<label class="col-sm-3 col-form-label text-lg-end{% if field.field.required %} required{% endif %}" for="{{ field.id_for_label }}">
|
2021-08-04 10:57:01 -07:00
|
|
|
{{ label }}
|
|
|
|
</label>
|
|
|
|
{% else %}
|
|
|
|
{% endif %}
|
2021-07-20 01:26:45 -07:00
|
|
|
<div class="col">
|
|
|
|
{{ field }}
|
|
|
|
{% if field.help_text %}
|
|
|
|
<span class="form-text">{{ field.help_text|safe }}</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if bulk_nullable %}
|
|
|
|
<div class="form-check my-1">
|
|
|
|
<input type="checkbox" class="form-check-input" name="_nullify" value="{{ field.name }}" />
|
|
|
|
<label class="form-check-label">Set Null</label>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-03-13 02:19:42 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif field|widget_type == 'slugwidget' %}
|
2021-07-20 00:16:13 -07:00
|
|
|
<div class="row mb-3">
|
2021-08-05 09:59:13 -07:00
|
|
|
<label class="col-sm-3 col-form-label text-lg-end{% if field.field.required %} required{% endif %}" for="{{ field.id_for_label }}">
|
2021-07-20 00:16:13 -07:00
|
|
|
{{ field.label }}
|
|
|
|
</label>
|
|
|
|
<div class="col">
|
|
|
|
<div class="input-group">
|
|
|
|
{{ field }}
|
2021-08-02 02:18:31 -07:00
|
|
|
<button id="reslug" type="button" title="Regenerate Slug" class="btn btn-outline-dark border-input">
|
|
|
|
<i class="mdi mdi-reload"></i>
|
2021-07-20 00:16:13 -07:00
|
|
|
</button>
|
|
|
|
</div>
|
2021-05-26 08:53:05 -07:00
|
|
|
</div>
|
2021-03-13 02:19:42 -07:00
|
|
|
</div>
|
|
|
|
|
2021-09-02 16:48:54 -04:00
|
|
|
{% 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>
|
|
|
|
|
|
|
|
{% elif field|widget_type == 'clearablefileinput' %}
|
|
|
|
<div class="row mb-3">
|
|
|
|
<label for="{{ field.id_for_label }}" class="form-label col col-md-3 text-lg-end{% if field.field.required %} required{% endif %}">
|
|
|
|
{{ field.label }}
|
|
|
|
</label>
|
|
|
|
<div class="col col-md-9">
|
|
|
|
{{ field }}
|
|
|
|
</div>
|
2021-05-26 08:53:05 -07:00
|
|
|
</div>
|
|
|
|
|
2021-04-14 17:05:10 -07:00
|
|
|
{% elif field|widget_type == 'selectmultiple' %}
|
2021-08-24 14:51:12 -04:00
|
|
|
<div class="row mb-3">
|
2021-08-05 09:59:13 -07:00
|
|
|
<label for="{{ field.id_for_label }}" class="form-label col col-md-3 text-lg-end{% if field.field.required %} required{% endif %}">
|
2021-05-26 08:53:05 -07:00
|
|
|
{{ field.label }}
|
|
|
|
</label>
|
|
|
|
<div class="col col-md-9">
|
|
|
|
{{ field }}
|
2021-07-20 01:26:45 -07:00
|
|
|
{% if bulk_nullable %}
|
|
|
|
<div class="form-check my-1">
|
|
|
|
<input type="checkbox" class="form-check-input" name="_nullify" value="{{ field.name }}" />
|
|
|
|
<label class="form-check-label">Set Null</label>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-05-26 08:53:05 -07:00
|
|
|
</div>
|
2021-04-14 17:05:10 -07:00
|
|
|
</div>
|
2021-05-26 08:53:05 -07:00
|
|
|
|
2021-03-13 02:19:42 -07:00
|
|
|
{% else %}
|
2021-07-20 00:16:13 -07:00
|
|
|
<div class="row mb-3">
|
2021-08-05 09:59:13 -07:00
|
|
|
<label for="{{ field.id_for_label }}" class="col-sm-3 col-form-label text-lg-end{% if field.field.required %} required{% endif %}">
|
2021-03-13 02:19:42 -07:00
|
|
|
{{ field.label }}
|
|
|
|
</label>
|
2021-07-20 00:16:13 -07:00
|
|
|
<div class="col">
|
|
|
|
{{ field }}
|
|
|
|
{% if field.help_text %}
|
|
|
|
<span class="form-text">{{ field.help_text|safe }}</span>
|
|
|
|
{% endif %}
|
|
|
|
<div class="invalid-feedback">
|
|
|
|
{% if field.field.required %}
|
|
|
|
<strong>{{ field.label }}</strong> field is required.
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2021-07-20 01:26:45 -07:00
|
|
|
{% if bulk_nullable %}
|
|
|
|
<div class="form-check my-1">
|
|
|
|
<input type="checkbox" class="form-check-input" name="_nullify" value="{{ field.name }}" />
|
|
|
|
<label class="form-check-label">Set Null</label>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-07-20 00:16:13 -07:00
|
|
|
</div>
|
2021-03-13 02:19:42 -07:00
|
|
|
</div>
|
2021-05-26 08:53:05 -07:00
|
|
|
{% endif %}
|
|
|
|
|