Fix create trade offer flow and other related bugs
This commit is contained in:
parent
f3a1366269
commit
65ca344582
40 changed files with 867 additions and 278 deletions
37
theme/templates/tailwind/field.html
Normal file
37
theme/templates/tailwind/field.html
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{% load tailwind_field %}
|
||||
|
||||
{% if field.is_hidden %}
|
||||
{{ field }}
|
||||
{% else %}
|
||||
{# Opening Div and Label first #}
|
||||
|
||||
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="{% if wrapper_class %}{{ wrapper_class }} {% endif %}{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}">
|
||||
{% if field.label and form_show_labels %}
|
||||
<label for="{{ field.id_for_label }}" class="{% if label_class %}{{ label_class }}{% else %}block text-base-content bg-base-100 text-sm font-bold mb-2{% endif %}">
|
||||
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
|
||||
{# if field has a special template then use this #}
|
||||
{% if field|is_select %}
|
||||
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
||||
{% include 'tailwind/layout/select.html' %}
|
||||
</div>
|
||||
{% elif field|is_checkboxselectmultiple %}
|
||||
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
||||
{% include 'tailwind/layout/checkboxselectmultiple.html' %}
|
||||
</div>
|
||||
{% elif field|is_radioselect %}
|
||||
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
||||
{% include 'tailwind/layout/radioselect.html' %}
|
||||
</div>
|
||||
{% else %}
|
||||
{# otherwise use django rendering with additional classes added #}
|
||||
{% tailwind_field field %}
|
||||
{% endif %}
|
||||
|
||||
{% include 'tailwind/layout/help_text_and_errors.html' %}
|
||||
|
||||
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
|
||||
|
||||
{% endif %}
|
||||
7
theme/templates/tailwind/layout/help_text.html
Normal file
7
theme/templates/tailwind/layout/help_text.html
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{% if field.help_text %}
|
||||
{% if help_text_inline %}
|
||||
<p {% if field.id_for_label %}id="{{ field.id_for_label }}_helptext" {% endif %}class="text-base-content bg-base-100">{{ field.help_text|safe }}</p>
|
||||
{% else %}
|
||||
<small {% if field.id_for_label %}id="{{ field.id_for_label }}_helptext" {% endif %}class="text-base-content bg-base-100">{{ field.help_text|safe }}</small>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue