{% load materializecss %}


    {% if field|is_checkbox %}
    <div class="col {{ classes.label }}">
        <div class="{{ classes.single_value }} {% if field.field.required and form.required_css_class %}{{ form.required_css_class }}{% endif %}">
            <label>
                    {% if field.auto_id %}
                        {{ field }}

                        <span>{{ field.label }}</span>
                    {% endif %}
                    {% for error in field.errors %}
                        <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
                    {% endfor %}

                </div>
            </label>
            {% if field.help_text %}
                <p class="help-block">
                    {{ field.help_text|safe }}
                </p>
            {% endif %}
        </div>
    </div>
    {% elif field|is_radio %}
    <div class="col {{ classes.label }}">
        <div class="{{ classes.single_value }} {% if field.field.required and form.required_css_class %}{{ form.required_css_class }}{% endif %}">
            <label>
                    {% if field.auto_id %}
                        {{ field }}
                        <span>{{ field.label }}</span>
                    {% endif %}
                    {% for error in field.errors %}
                        <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
                    {% endfor %}

                </div>
            </label>
            {% if field.help_text %}
                <p class="help-block">
                    {{ field.help_text|safe }}
                </p>
            {% endif %}
        </div>
    </div>
    {% elif field|is_date_input or field|is_datetime_input %}
    <div class="col {{ classes.label }}">

        <label for="{{ field.id_for_label }}">{{ field.label }}</label>
        <input type="date" id="{{ field.auto_id }}" name="{{ field.name }}" class="datepicker" value="{% if field.value %}{{ field.value }}{% endif %}">

            {% for error in field.errors %}
                <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
            {% endfor %}

            {% if field.help_text %}
            <p class="help-block">
                {{ field.help_text|safe }}
            </p>
            {% endif %}
    </div>
    {% elif field|is_select %}
    <div class="col input-field {{ classes.label }} {{ classes.value }}">
            {% if field|is_checkbox_select_multiple %}
                <div class="input-field {{ classes.value }}">
                    <select multiple>
                        {% for choice in field %}
                              {{ choice.tag }}
                        {% endfor %}
                    </select>
                    {% if field.auto_id %}
                        <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label>
                    {% endif %}

                    {% for error in field.errors %}
                        <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
                    {% endfor %}

                    {% if field.help_text %}
                    <p class="help-block">
                        {{ field.help_text|safe }}
                    </p>
                    {% endif %}
                </div>

            {% else %}
                    <select>
                        {% for choice in field %}
                              {{ choice.tag }}
                        {% endfor %}
                    </select>
                    {% if field.auto_id %}
                    <label class="control-label {{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}">{{ field.label }}</label>
                    {% endif %}

                    {% for error in field.errors %}
                        <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
                    {% endfor %}

                    {% if field.help_text %}
                    <p class="help-block">
                        {{ field.help_text|safe }}
                    </p>
                    {% endif %}

            {% endif %}

    </div>

    {% elif field|is_textarea %}
        <div class="input-field col {{ classes.label }}">
            <textarea id="{{ field.auto_id }}" class="materialize-textarea" name="{{field.name}}">{% if field.value %}{{ field.value }}{% endif %}</textarea>
            {% if field.auto_id %}
                <label class="{{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label>
            {% endif %}

            {% for error in field.errors %}
                <p class="help-block orange-text {{ form.error_css_class }}">{{ error }}</p>
                {% endfor %}

            {% if field.help_text %}
                <p>
                    {{ field.help_text|safe }}
                </p>
            {% endif %}
        </div>

    {% elif field|is_file %}
        <div class="col {{ classes.label }}">

            {% for error in field.errors %}
                <p class="help-block orange-text {{ form.error_css_class }}">{{ error }}</p>
            {% endfor %}

            <div class="file-field input-field">
                <div class="btn">
                    <span>{{ field.label }}</span>
                    {{ field }}
                </div>
                <div class="file-path-wrapper">
                    <input class="file-path validate" type="text">
                </div>
            </div>

        </div>
    {% else %}

        <div class="input-field col {{ classes.label }}">
            {{ field }}
            {% if field.auto_id %}
                <label class="{{ classes.label }} {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.auto_id }}">{{ field.label }}</label>
            {% endif %}

            {% for error in field.errors %}
                <p class="help-block orange-text {{ form.error_css_class }}">{{ error }}</p>
                {% endfor %}

            {% if field.help_text %}
                <p>
                    {{ field.help_text|safe }}
                </p>
            {% endif %}
        </div>

    {% endif %}
