mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-27 19:17:12 +02:00
feat: automated replacement
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
{% load crispy_forms_field %}
|
||||
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
<div id="div_{{ field.auto_id }}" class="tw:mb-3{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_group_wrapper_class %} {{ form_group_wrapper_class }}{% endif %}{% if form_show_errors and field.errors %} tw:has-error{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
|
||||
|
||||
{% if field.label and form_show_labels %}
|
||||
<label for="{{ field.id_for_label }}" class="tw:label{{ label_class }}{% if field.field.required %} requiredField{% endif %}">
|
||||
<span class="tw:label-text">{{ field.label }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}</span>
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
<div {% if field_class %}class="{{ field_class }}"{% endif %}>
|
||||
<label class="tw:input tw:input-bordered tw:flex tw:items-center tw:gap-2{% if input_size %} {{ input_size }}{% endif %}{% if field.errors %} tw:input-error{% endif %}">
|
||||
{# prepend #}
|
||||
{% if crispy_prepended_text %}
|
||||
<span>{{ crispy_prepended_text }}</span>
|
||||
{% endif %}
|
||||
|
||||
{# input #}
|
||||
{% if field|is_select %}
|
||||
{% if field.errors %}
|
||||
{% crispy_field field 'class' 'tw:select tw:select-bordered tw:select-error tw:w-full' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'tw:select tw:select-bordered tw:w-full' %}
|
||||
{% endif %}
|
||||
{% elif field.errors %}
|
||||
{% crispy_field field 'class' 'tw:grow' %}
|
||||
{% else %}
|
||||
{% crispy_field field 'class' 'tw:grow' %}
|
||||
{% endif %}
|
||||
|
||||
{# append #}
|
||||
{% if crispy_appended_text %}
|
||||
<span>{{ crispy_appended_text }}</span>
|
||||
{% endif %}
|
||||
</label>
|
||||
{% if error_text_inline %}
|
||||
{% include 'crispy-daisyui/layout/field_errors.html' %}
|
||||
{% else %}
|
||||
{% include 'crispy-daisyui/layout/field_errors_block.html' %}
|
||||
{% endif %}
|
||||
{% if not help_text_inline %}
|
||||
{% include 'crispy-daisyui/layout/help_text.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user