filter students
This commit is contained in:
17
crispy_forms/templates/bootstrap4/accordion-group.html
Normal file
17
crispy_forms/templates/bootstrap4/accordion-group.html
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="card mb-2">
|
||||
<div class="card-header" role="tab">
|
||||
<h5 class="mb-0">
|
||||
<a data-toggle="collapse" href="#{{ div.css_id }}" aria-expanded="true"
|
||||
aria-controls="{{ div.css_id }}">
|
||||
{{ div.name }}
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="{{ div.css_id }}" class="collapse{% if div.active %} show{% endif %}" role="tabpanel"
|
||||
aria-labelledby="{{ div.css_id }}" data-parent="#{{ div.data_parent }}">
|
||||
<div class="card-body">
|
||||
{{ fields }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
3
crispy_forms/templates/bootstrap4/accordion.html
Normal file
3
crispy_forms/templates/bootstrap4/accordion.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div id="{{ accordion.css_id }}" role="tablist">
|
||||
{{ content }}
|
||||
</div>
|
22
crispy_forms/templates/bootstrap4/betterform.html
Normal file
22
crispy_forms/templates/bootstrap4/betterform.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% for fieldset in form.fieldsets %}
|
||||
<fieldset class="fieldset-{{ forloop.counter }} {{ fieldset.classes }}">
|
||||
{% if fieldset.legend %}
|
||||
<legend>{{ fieldset.legend }}</legend>
|
||||
{% endif %}
|
||||
|
||||
{% if fieldset.description %}
|
||||
<p class="description">{{ fieldset.description }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% for field in fieldset %}
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
{% include "bootstrap4/field.html" %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if not forloop.last or not fieldset_open %}
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
9
crispy_forms/templates/bootstrap4/display_form.html
Normal file
9
crispy_forms/templates/bootstrap4/display_form.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% if form.form_html %}
|
||||
{% if include_media %}{{ form.media }}{% endif %}
|
||||
{% if form_show_errors %}
|
||||
{% include "bootstrap4/errors.html" %}
|
||||
{% endif %}
|
||||
{{ form.form_html }}
|
||||
{% else %}
|
||||
{% include "bootstrap4/uni_form.html" %}
|
||||
{% endif %}
|
8
crispy_forms/templates/bootstrap4/errors.html
Normal file
8
crispy_forms/templates/bootstrap4/errors.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-block alert-danger">
|
||||
{% if form_error_title %}<h4 class="alert-heading">{{ form_error_title }}</h4>{% endif %}
|
||||
<ul class="m-0">
|
||||
{{ form.non_field_errors|unordered_list }}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
9
crispy_forms/templates/bootstrap4/errors_formset.html
Normal file
9
crispy_forms/templates/bootstrap4/errors_formset.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% if formset.non_form_errors %}
|
||||
<div class="alert alert-block alert-danger">
|
||||
{% if formset_error_title %}<h4 class="alert-heading">{{ formset_error_title }}</h4>{% endif %}
|
||||
<ul class="m-0">
|
||||
{{ formset.non_form_errors|unordered_list }}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
81
crispy_forms/templates/bootstrap4/field.html
Normal file
81
crispy_forms/templates/bootstrap4/field.html
Normal file
@ -0,0 +1,81 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
{% if field|is_checkbox %}
|
||||
<div class="form-group{% if 'form-horizontal' in form_class %} row{% endif %}">
|
||||
{% if label_class %}
|
||||
<div class="{% for offset in bootstrap_checkbox_offsets %}{{ offset }} {% endfor %}{{ field_class }}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="{% if not field|is_checkbox %}form-group{% if 'form-horizontal' in form_class %} row{% endif %}{% else %}{%if use_custom_control%}{% if tag != 'td' %}custom-control {%endif%} custom-checkbox{% else %}form-check{% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
||||
{% if field.label and not field|is_checkbox and form_show_labels %}
|
||||
{# not field|is_radioselect in row below can be removed once Django 3.2 is no longer supported #}
|
||||
<label {% if field.id_for_label and not field|is_radioselect %}for="{{ field.id_for_label }}" {% endif %}class="{% if 'form-horizontal' in form_class %}col-form-label {% endif %}{{ label_class }}{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% if field|is_checkboxselectmultiple %}
|
||||
{% include 'bootstrap4/layout/checkboxselectmultiple.html' %}
|
||||
{% endif %}
|
||||
|
||||
{% if field|is_radioselect %}
|
||||
{% include 'bootstrap4/layout/radioselect.html' %}
|
||||
{% endif %}
|
||||
|
||||
{% if not field|is_checkboxselectmultiple and not field|is_radioselect %}
|
||||
{% if field|is_checkbox and form_show_labels %}
|
||||
{%if use_custom_control%}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'custom-control-input is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'custom-control-input' %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'form-check-input is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'form-check-input' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<label for="{{ field.id_for_label }}" class="{%if use_custom_control%}custom-control-label{% else %}form-check-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% include 'bootstrap4/layout/help_text_and_errors.html' %}
|
||||
{% elif field|is_file and use_custom_control %}
|
||||
{% include 'bootstrap4/layout/field_file.html' %}
|
||||
{% else %}
|
||||
<div{% if field_class %} class="{{ field_class }}"{% endif %}>
|
||||
{% if field|is_select and use_custom_control %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'custom-select is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'custom-select' %}
|
||||
{% endif %}
|
||||
{% elif field|is_file %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'form-control-file is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'form-control-file' %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'form-control is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'form-control' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% include 'bootstrap4/layout/help_text_and_errors.html' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
|
||||
{% if field|is_checkbox %}
|
||||
{% if label_class %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
13
crispy_forms/templates/bootstrap4/inputs.html
Normal file
13
crispy_forms/templates/bootstrap4/inputs.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% if inputs %}
|
||||
<div class="form-group{% if 'form-horizontal' in form_class %} row{% endif %}">
|
||||
{% if label_class %}
|
||||
<div class="aab {{ label_class }}"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ field_class }}">
|
||||
{% for input in inputs %}
|
||||
{% include "bootstrap4/layout/baseinput.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
4
crispy_forms/templates/bootstrap4/layout/alert.html
Normal file
4
crispy_forms/templates/bootstrap4/layout/alert.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div{% if alert.css_id %} id="{{ alert.css_id }}"{% endif %}{% if alert.css_class %} class="{{ alert.css_class }}"{% endif %}>
|
||||
{% if dismiss %}<button type="button" class="close" data-dismiss="alert">×</button>{% endif %}
|
||||
{{ content }}
|
||||
</div>
|
1
crispy_forms/templates/bootstrap4/layout/attrs.html
Normal file
1
crispy_forms/templates/bootstrap4/layout/attrs.html
Normal file
@ -0,0 +1 @@
|
||||
{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %}
|
9
crispy_forms/templates/bootstrap4/layout/baseinput.html
Normal file
9
crispy_forms/templates/bootstrap4/layout/baseinput.html
Normal file
@ -0,0 +1,9 @@
|
||||
<input type="{{ input.input_type }}"
|
||||
name="{% if input.name|wordcount > 1 %}{{ input.name|slugify }}{% else %}{{ input.name }}{% endif %}"
|
||||
value="{{ input.value }}"
|
||||
{% if input.input_type != "hidden" %}
|
||||
class="{{ input.field_classes }}"
|
||||
id="{{ input.id }}"
|
||||
{% endif %}
|
||||
{{ input.flat_attrs }}
|
||||
/>
|
1
crispy_forms/templates/bootstrap4/layout/button.html
Normal file
1
crispy_forms/templates/bootstrap4/layout/button.html
Normal file
@ -0,0 +1 @@
|
||||
<button {{ button.flat_attrs }}>{{ button.content }}</button>
|
@ -0,0 +1,4 @@
|
||||
<div {% if buttonholder.css_id %}id="{{ buttonholder.css_id }}"{% endif %}
|
||||
class="buttonHolder{% if buttonholder.css_class %} {{ buttonholder.css_class }}{% endif %}">
|
||||
{{ fields_output }}
|
||||
</div>
|
@ -0,0 +1,29 @@
|
||||
{% load crispy_forms_filters %}
|
||||
{% load l10n %}
|
||||
|
||||
<div {% if field_class %}class="{{ field_class }}"{% endif %}{% if flat_attrs %} {{ flat_attrs }}{% endif %}>
|
||||
|
||||
{% for group, options, index in field|optgroups %}
|
||||
{% if group %}<strong>{{ group }}</strong>{% endif %}
|
||||
{% for option in options %}
|
||||
<div class="{%if use_custom_control%}custom-control custom-checkbox{% if inline_class %} custom-control-inline{% endif %}{% else %}form-check{% if inline_class %} form-check-inline{% endif %}{% endif %}">
|
||||
<input type="checkbox" class="{%if use_custom_control%}custom-control-input{% else %}form-check-input{% endif %}{% if field.errors %} is-invalid{% endif %}" name="{{ field.html_name }}" value="{{ option.value|unlocalize }}" {% include "bootstrap4/layout/attrs.html" with widget=option %}>
|
||||
<label class="{%if use_custom_control%}custom-control-label{% else %}form-check-label{% endif %}" for="{{ option.attrs.id }}">
|
||||
{{ option.label|unlocalize }}
|
||||
</label>
|
||||
{% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %}
|
||||
{% include 'bootstrap4/layout/field_errors_block.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% if field.errors and inline_class %}
|
||||
<div class="w-100 {%if use_custom_control%}custom-control custom-checkbox{% if inline_class %} custom-control-inline{% endif %}{% else %}form-check{% if inline_class %} form-check-inline{% endif %}{% endif %}">
|
||||
{# the following input is only meant to allow boostrap to render the error message as it has to be after an invalid input. As the input has no name, no data will be sent. #}
|
||||
<input type="checkbox" class="custom-control-input {% if field.errors %}is-invalid{%endif%}">
|
||||
{% include 'bootstrap4/layout/field_errors_block.html' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include 'bootstrap4/layout/help_text.html' %}
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
<div id="div_{{ field.auto_id }}" class="form-group{% if 'form-horizontal' in form_class %} row{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
||||
|
||||
{% if field.label %}
|
||||
<label {% if field.id_for_label %}for="{{ field.id_for_label }}" {% endif %} class="{{ label_class }}{% if not inline_class %} col-form-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% include 'bootstrap4/layout/checkboxselectmultiple.html' %}
|
||||
</div>
|
||||
{% endif %}
|
6
crispy_forms/templates/bootstrap4/layout/column.html
Normal file
6
crispy_forms/templates/bootstrap4/layout/column.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div {% if div.css_id %}id="{{ div.css_id }}"{% endif %}
|
||||
class="{% if 'col' in div.css_class %}{{ div.css_class|default:'' }}{% else %}col-md {{ div.css_class|default:'' }}{% endif %}" {{ div.flat_attrs }}>
|
||||
{{ fields }}
|
||||
</div>
|
||||
|
||||
|
4
crispy_forms/templates/bootstrap4/layout/div.html
Normal file
4
crispy_forms/templates/bootstrap4/layout/div.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div {% if div.css_id %}id="{{ div.css_id }}"{% endif %}
|
||||
{% if div.css_class %}class="{{ div.css_class }}"{% endif %} {{ div.flat_attrs }}>
|
||||
{{ fields }}
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
{% if form_show_errors and field.errors %}
|
||||
{% for error in field.errors %}
|
||||
<span id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="invalid-feedback"><strong>{{ error }}</strong></span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
@ -0,0 +1,5 @@
|
||||
{% if form_show_errors and field.errors %}
|
||||
{% for error in field.errors %}
|
||||
<p id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="invalid-feedback"><strong>{{ error }}</strong></p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
52
crispy_forms/templates/bootstrap4/layout/field_file.html
Normal file
52
crispy_forms/templates/bootstrap4/layout/field_file.html
Normal file
@ -0,0 +1,52 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
<div class="{{ field_class }} mb-2">
|
||||
{% for widget in field.subwidgets %}
|
||||
{% if widget.data.is_initial %}
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">{{ widget.data.initial_text }}</span>
|
||||
</div>
|
||||
<div class="form-control d-flex h-auto">
|
||||
<span class="text-break" style="flex-grow:1;min-width:0">
|
||||
<a href="{{ field.value.url }}">{{ field.value }}</a>
|
||||
</span>
|
||||
{% if not widget.data.required %}
|
||||
<span class="align-self-center ml-2">
|
||||
<span class="custom-control custom-checkbox">
|
||||
<input type="checkbox" name="{{ widget.data.checkbox_name }}" id="{{ widget.data.checkbox_id }}" class="custom-control-input"{% if field.field.disabled %} disabled{% endif %} >
|
||||
<label class="custom-control-label mb-0" for="{{ widget.data.checkbox_id }}">{{ widget.data.clear_checkbox_label }}</label>
|
||||
</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-0">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">{{ widget.data.input_text }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form-control custom-file{% if field.errors %} is-invalid{%endif%}" style="border:0">
|
||||
<input type="{{ widget.data.type }}" name="{{ widget.data.name }}" class="custom-file-input{% if widget.data.attrs.class %} {{ widget.data.attrs.class }}{% endif %}{% if field.errors %} is-invalid{%endif%}"{% if field.field.disabled %} disabled{% endif %}{% for name, value in widget.data.attrs.items %}{% if value is not False and name != 'class' %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %}>
|
||||
<label class="custom-file-label text-truncate" for="{{ field.id_for_label }}">---</label>
|
||||
<script type="text/javascript" id="script-{{ field.id_for_label }}">
|
||||
document.getElementById("script-{{ field.id_for_label }}").parentNode.querySelector('.custom-file-input').onchange = function (e){
|
||||
var filenames = "";
|
||||
for (let i=0;i<e.target.files.length;i++){
|
||||
filenames+=(i>0?", ":"")+e.target.files[i].name;
|
||||
}
|
||||
e.target.parentNode.querySelector('.custom-file-label').textContent=filenames;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
{% if not widget.data.is_initial %}
|
||||
{% include 'bootstrap4/layout/help_text_and_errors.html' %}
|
||||
{% endif %}
|
||||
{% if widget.data.is_initial %}
|
||||
</div>
|
||||
<div class="input-group mb-0">
|
||||
{% include 'bootstrap4/layout/help_text_and_errors.html' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
@ -0,0 +1,17 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
<div{% if div.css_id %} id="{{ div.css_id }}"{% endif %} class="form-group{% if 'form-horizontal' in form_class %} row{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}{% if div.css_class %} {{ div.css_class }}{% endif %}" {{ div.flat_attrs }}>
|
||||
{% if field.label and form_show_labels %}
|
||||
<label for="{{ field.id_for_label }}" class="{% if 'form-horizontal' in form_class %}col-form-label {% endif %}{{ label_class }}{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ field_class }}">
|
||||
<div class="input-group {% if div.input_size %} {{ div.input_size }}{% endif %}">
|
||||
{% crispy_field field 'class' 'form-control' %}
|
||||
<span class="input-group-append{% if active %} active{% endif %}">{{ buttons }}</span>
|
||||
</div>
|
||||
{% include 'bootstrap4/layout/help_text_and_errors.html' %}
|
||||
</div>
|
||||
</div>
|
6
crispy_forms/templates/bootstrap4/layout/fieldset.html
Normal file
6
crispy_forms/templates/bootstrap4/layout/fieldset.html
Normal file
@ -0,0 +1,6 @@
|
||||
<fieldset {% if fieldset.css_id %}id="{{ fieldset.css_id }}"{% endif %}
|
||||
{% if fieldset.css_class%}class="{{ fieldset.css_class }}"{% endif %}
|
||||
{{ fieldset.flat_attrs }}>
|
||||
{% if legend %}<legend>{{ legend }}</legend>{% endif %}
|
||||
{{ fields }}
|
||||
</fieldset>
|
@ -0,0 +1,9 @@
|
||||
<div{% if formactions.flat_attrs %} {{ formactions.flat_attrs }}{% endif %} class="form-group{% if 'form-horizontal' in form_class %} row{% endif %} {{ formactions.css_class }}" {% if formactions.id %} id="{{ formactions.id }}"{% endif %}>
|
||||
{% if label_class %}
|
||||
<div class="aab {{ label_class }}"></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ field_class }}">
|
||||
{{ fields_output }}
|
||||
</div>
|
||||
</div>
|
7
crispy_forms/templates/bootstrap4/layout/help_text.html
Normal file
7
crispy_forms/templates/bootstrap4/layout/help_text.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% if field.help_text %}
|
||||
{% if help_text_inline %}
|
||||
<span id="hint_{{ field.auto_id }}" class="text-muted">{{ field.help_text|safe }}</span>
|
||||
{% else %}
|
||||
<small id="hint_{{ field.auto_id }}" class="form-text text-muted">{{ field.help_text|safe }}</small>
|
||||
{% endif %}
|
||||
{% endif %}
|
@ -0,0 +1,13 @@
|
||||
{% if help_text_inline and not error_text_inline %}
|
||||
{% include 'bootstrap4/layout/help_text.html' %}
|
||||
{% endif %}
|
||||
|
||||
{% if error_text_inline %}
|
||||
{% include 'bootstrap4/layout/field_errors.html' %}
|
||||
{% else %}
|
||||
{% include 'bootstrap4/layout/field_errors_block.html' %}
|
||||
{% endif %}
|
||||
|
||||
{% if not help_text_inline %}
|
||||
{% include 'bootstrap4/layout/help_text.html' %}
|
||||
{% endif %}
|
29
crispy_forms/templates/bootstrap4/layout/inline_field.html
Normal file
29
crispy_forms/templates/bootstrap4/layout/inline_field.html
Normal file
@ -0,0 +1,29 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
{% if field|is_checkbox %}
|
||||
<div id="div_{{ field.auto_id }}" class="form-check form-check-inline{% if wrapper_class %} {{ wrapper_class }}{% endif %}">
|
||||
<label for="{{ field.id_for_label }}" class="form-check-label{% if field.field.required %} requiredField{% endif %}">
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'form-check-input is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'form-check-input' %}
|
||||
{% endif %}
|
||||
{{ field.label }}
|
||||
</label>
|
||||
</div>
|
||||
{% else %}
|
||||
<div id="div_{{ field.auto_id }}" class="input-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}">
|
||||
<label for="{{ field.id_for_label }}" class="sr-only{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'placeholder' field.label 'class' 'form-control is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'placeholder' field.label 'class' 'form-control' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
15
crispy_forms/templates/bootstrap4/layout/modal.html
Normal file
15
crispy_forms/templates/bootstrap4/layout/modal.html
Normal file
@ -0,0 +1,15 @@
|
||||
<div id="{{ modal.css_id }}" class="modal fade {{ modal.css_class }}" {{ modal.flat_attrs }}>
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title {{ modal.title_class }}" id="{{ modal.title_id }}">{{ modal.title }}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true" style="float: left">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ fields }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
27
crispy_forms/templates/bootstrap4/layout/multifield.html
Normal file
27
crispy_forms/templates/bootstrap4/layout/multifield.html
Normal file
@ -0,0 +1,27 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
|
||||
{% if field.label %}
|
||||
<label for="{{ field.id_for_label }}"{% if labelclass %} class="{{ labelclass }}"{% endif %}>
|
||||
{% endif %}
|
||||
|
||||
{% if field|is_checkbox %}
|
||||
{% crispy_field field %}
|
||||
{% endif %}
|
||||
|
||||
{% if field.label %}
|
||||
{{ field.label }}
|
||||
{% endif %}
|
||||
|
||||
{% if not field|is_checkbox %}
|
||||
{% crispy_field field %}
|
||||
{% endif %}
|
||||
|
||||
{% if field.label %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
@ -0,0 +1,51 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
<div id="div_{{ field.auto_id }}" class="form-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if 'form-horizontal' in form_class %} row{% endif %}{% if form_group_wrapper_class %} {{ form_group_wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
||||
|
||||
{% if field.label and form_show_labels %}
|
||||
<label for="{{ field.id_for_label }}" class="{% if 'form-horizontal' in form_class %}col-form-label {% endif %}{{ label_class }}{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ field_class }}">
|
||||
<div class="input-group{% if input_size %} {{ input_size }}{% endif %}">
|
||||
{% if crispy_prepended_text %}
|
||||
<div class="input-group-prepend{% if active %} active{% endif %}">
|
||||
<span class="input-group-text">{{ crispy_prepended_text }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if field|is_select and use_custom_control %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'custom-select is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'custom-select' %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'form-control is-invalid' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'form-control' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if crispy_appended_text %}
|
||||
<div class="input-group-append{% if active %} active{% endif %}">
|
||||
<span class="input-group-text">{{ crispy_appended_text }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if error_text_inline %}
|
||||
{% include 'bootstrap4/layout/field_errors.html' %}
|
||||
{% else %}
|
||||
{% include 'bootstrap4/layout/field_errors_block.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not help_text_inline %}
|
||||
{% include 'bootstrap4/layout/help_text.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
29
crispy_forms/templates/bootstrap4/layout/radioselect.html
Normal file
29
crispy_forms/templates/bootstrap4/layout/radioselect.html
Normal file
@ -0,0 +1,29 @@
|
||||
{% load crispy_forms_filters %}
|
||||
{% load l10n %}
|
||||
|
||||
<div {% if field_class %}class="{{ field_class }}"{% endif %}{% if flat_attrs %} {{ flat_attrs }}{% endif %}>
|
||||
|
||||
{% for group, options, index in field|optgroups %}
|
||||
{% if group %}<strong>{{ group }}</strong>{% endif %}
|
||||
{% for option in options %}
|
||||
<div class="{%if use_custom_control%}custom-control custom-radio{% if inline_class %} custom-control-inline{% endif %}{% else %}form-check{% if inline_class %} form-check-inline{% endif %}{% endif %}">
|
||||
<input type="radio" class="{%if use_custom_control%}custom-control-input{% else %}form-check-input{% endif %}{% if field.errors %} is-invalid{% endif %}" name="{{ field.html_name }}" value="{{ option.value|unlocalize }}" {% include "bootstrap4/layout/attrs.html" with widget=option %}>
|
||||
<label class="{%if use_custom_control%}custom-control-label{% else %}form-check-label{% endif %}" for="{{ option.attrs.id }}">
|
||||
{{ option.label|unlocalize }}
|
||||
</label>
|
||||
{% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %}
|
||||
{% include 'bootstrap4/layout/field_errors_block.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% if field.errors and inline_class %}
|
||||
<div class="w-100 {%if use_custom_control%}custom-control custom-radio{% if inline_class %} custom-control-inline{% endif %}{% else %}form-check{% if inline_class %} form-check-inline{% endif %}{% endif %}">
|
||||
{# the following input is only meant to allow boostrap to render the error message as it has to be after an invalid input. As the input has no name, no data will be sent. #}
|
||||
<input type="checkbox" class="custom-control-input {% if field.errors %}is-invalid{%endif%}">
|
||||
{% include 'bootstrap4/layout/field_errors_block.html' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include 'bootstrap4/layout/help_text.html' %}
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
<div id="div_{{ field.auto_id }}" class="form-group{% if 'form-horizontal' in form_class %} row{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
||||
|
||||
{% if field.label %}
|
||||
<label {% if field.id_for_label %}for="{{ field.id_for_label }}" {% endif %}class="{{ label_class }}{% if not inline_class %} col-form-label{% endif %}{% if field.field.required %} requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{% include 'bootstrap4/layout/radioselect.html' %}
|
||||
</div>
|
||||
{% endif %}
|
3
crispy_forms/templates/bootstrap4/layout/row.html
Normal file
3
crispy_forms/templates/bootstrap4/layout/row.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div {% if div.css_id %}id="{{ div.css_id }}"{% endif %} class="form-row {{ div.css_class|default:'' }}" {{ div.flat_attrs }}>
|
||||
{{ fields }}
|
||||
</div>
|
1
crispy_forms/templates/bootstrap4/layout/tab-link.html
Normal file
1
crispy_forms/templates/bootstrap4/layout/tab-link.html
Normal file
@ -0,0 +1 @@
|
||||
<li class="nav-item"><a class="nav-link{% if 'active' in link.css_class %} active{% endif %}" href="#{{ link.css_id }}" data-toggle="tab">{{ link.name|capfirst }}{% if tab.errors %}!{% endif %}</a></li>
|
6
crispy_forms/templates/bootstrap4/layout/tab.html
Normal file
6
crispy_forms/templates/bootstrap4/layout/tab.html
Normal file
@ -0,0 +1,6 @@
|
||||
<ul{% if tabs.css_id %} id="{{ tabs.css_id }}"{% endif %} class="nav nav-tabs">
|
||||
{{ links }}
|
||||
</ul>
|
||||
<div class="tab-content card-body">
|
||||
{{ content }}
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
{% load crispy_forms_field %}
|
||||
<div id="div_{{ field.auto_id }}" class="form-group{% if 'form-horizontal' in form_class %} row{% endif %}{% if form_show_errors and field.errors %} error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
||||
<label class="{% if 'form-horizontal' in form_class %}col-form-label {% endif %}{{ label_class }}{% if field.field.required %} requiredField{% endif %}">{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}</label>
|
||||
<div class="{{ field_class }}">
|
||||
{% if field|is_select and use_custom_control %}
|
||||
{% crispy_field field 'class' 'custom-select' 'disabled' 'disabled' %}
|
||||
{% elif field|is_file %}
|
||||
{% crispy_field field 'class' 'form-control-file' 'disabled' 'disabled' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'form-control' 'disabled' 'disabled' %}
|
||||
{% endif %}
|
||||
{% include 'bootstrap4/layout/help_text.html' %}
|
||||
</div>
|
||||
</div>
|
57
crispy_forms/templates/bootstrap4/table_inline_formset.html
Normal file
57
crispy_forms/templates/bootstrap4/table_inline_formset.html
Normal file
@ -0,0 +1,57 @@
|
||||
{% load crispy_forms_tags %}
|
||||
{% load crispy_forms_utils %}
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
{% specialspaceless %}
|
||||
{% if formset_tag %}
|
||||
<form {{ flat_attrs }} method="{{ form_method }}" {% if formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
|
||||
{% endif %}
|
||||
{% if formset_method|lower == 'post' and not disable_csrf %}
|
||||
{% csrf_token %}
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{{ formset.management_form|crispy }}
|
||||
</div>
|
||||
|
||||
<table{% if form_id %} id="{{ form_id }}_table"{% endif%} class="table table-striped table-sm">
|
||||
<thead>
|
||||
{% if formset.readonly and not formset.queryset.exists %}
|
||||
{% else %}
|
||||
<tr>
|
||||
{% for field in formset.forms.0 %}
|
||||
{% if field.label and not field.is_hidden %}
|
||||
<th for="{{ field.auto_id }}" class="col-form-label {% if field.field.required %}requiredField{% endif %}">
|
||||
{{ field.label }}{% if field.field.required and not field|is_checkbox %}<span class="asteriskField">*</span>{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr class="d-none empty-form">
|
||||
{% for field in formset.empty_form %}
|
||||
{% include 'bootstrap4/field.html' with tag="td" form_show_labels=False %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
|
||||
{% for form in formset %}
|
||||
{% if form_show_errors and not form.is_extra %}
|
||||
{% include "bootstrap4/errors.html" %}
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
{% for field in form %}
|
||||
{% include 'bootstrap4/field.html' with tag="td" form_show_labels=False %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% include "bootstrap4/inputs.html" %}
|
||||
|
||||
{% if formset_tag %}</form>{% endif %}
|
||||
{% endspecialspaceless %}
|
11
crispy_forms/templates/bootstrap4/uni_form.html
Normal file
11
crispy_forms/templates/bootstrap4/uni_form.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% load crispy_forms_utils %}
|
||||
|
||||
{% specialspaceless %}
|
||||
{% if include_media %}{{ form.media }}{% endif %}
|
||||
{% if form_show_errors %}
|
||||
{% include "bootstrap4/errors.html" %}
|
||||
{% endif %}
|
||||
{% for field in form %}
|
||||
{% include field_template %}
|
||||
{% endfor %}
|
||||
{% endspecialspaceless %}
|
8
crispy_forms/templates/bootstrap4/uni_formset.html
Normal file
8
crispy_forms/templates/bootstrap4/uni_formset.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% with formset.management_form as form %}
|
||||
{% include 'bootstrap4/uni_form.html' %}
|
||||
{% endwith %}
|
||||
{% for form in formset %}
|
||||
<div class="multiField">
|
||||
{% include 'bootstrap4/uni_form.html' %}
|
||||
</div>
|
||||
{% endfor %}
|
14
crispy_forms/templates/bootstrap4/whole_uni_form.html
Normal file
14
crispy_forms/templates/bootstrap4/whole_uni_form.html
Normal file
@ -0,0 +1,14 @@
|
||||
{% load crispy_forms_utils %}
|
||||
|
||||
{% specialspaceless %}
|
||||
{% if form_tag %}<form {{ flat_attrs }} method="{{ form_method }}" {% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>{% endif %}
|
||||
{% if form_method|lower == 'post' and not disable_csrf %}
|
||||
{% csrf_token %}
|
||||
{% endif %}
|
||||
|
||||
{% include "bootstrap4/display_form.html" %}
|
||||
|
||||
{% include "bootstrap4/inputs.html" %}
|
||||
|
||||
{% if form_tag %}</form>{% endif %}
|
||||
{% endspecialspaceless %}
|
30
crispy_forms/templates/bootstrap4/whole_uni_formset.html
Normal file
30
crispy_forms/templates/bootstrap4/whole_uni_formset.html
Normal file
@ -0,0 +1,30 @@
|
||||
{% load crispy_forms_tags %}
|
||||
{% load crispy_forms_utils %}
|
||||
|
||||
{% specialspaceless %}
|
||||
{% if formset_tag %}
|
||||
<form {{ flat_attrs }} method="{{ form_method }}" {% if formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
|
||||
{% endif %}
|
||||
{% if formset_method|lower == 'post' and not disable_csrf %}
|
||||
{% csrf_token %}
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{{ formset.management_form|crispy }}
|
||||
</div>
|
||||
|
||||
{% include "bootstrap4/errors_formset.html" %}
|
||||
|
||||
{% for form in formset %}
|
||||
{% include "bootstrap4/display_form.html" %}
|
||||
{% endfor %}
|
||||
|
||||
{% if inputs %}
|
||||
<div class="form-actions">
|
||||
{% for input in inputs %}
|
||||
{% include "bootstrap4/layout/baseinput.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if formset_tag %}</form>{% endif %}
|
||||
{% endspecialspaceless %}
|
Reference in New Issue
Block a user