-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'django-crispy-forms:main' into main
- Loading branch information
Showing
13 changed files
with
652 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
{% load crispy_forms_filters %} | ||
{% load tailwind_filters %} | ||
{% load l10n %} | ||
|
||
<div class="relative"> | ||
<select class="{% if field.errors %}border border-red-500 {% endif %}{% if field.field.disabled %}bg-gray-100{% else %}bg-white{% endif %} focus:outline-none border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700" | ||
name="{{ field.html_name }}" {{ field.field.widget.attrs|flatatt }} | ||
{% if field.field.disabled %}disabled{% endif %}> | ||
{% for value, label in field.field.choices %} | ||
{% include "tailwind/layout/select_option.html" with value=value label=label %} | ||
{% endfor %} | ||
</select> | ||
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | ||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/></svg> | ||
<select class="bg-white focus:outline-none border {% if field.errors %}border-red-500 {% else %}border-gray-300 {% endif %}rounded-lg py-2 px-4 block w-full appearance-none leading-normal text-gray-700" name="{{ field.html_name }}" {{ field|build_attrs }}> | ||
{% for group, options, index in field|optgroups %} | ||
{% if group %}<optgroup label="{{ group }}">{% endif %} | ||
{% for option in options %} | ||
{% include "tailwind/layout/select_option.html" %} | ||
{% endfor %} | ||
{% if group %}</optgroup>{% endif %} | ||
{% endfor %} | ||
</select> | ||
{% if not field.field.widget.allow_multiple_selected %} | ||
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700"> | ||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/></svg> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% load crispy_forms_filters %} | ||
{% load l10n %} | ||
|
||
<option value="{{ value|stringformat:'s' }}" {{ field.field.widget.attrs|flatatt }}{% if field.value|stringformat:'s' == value|stringformat:'s' %} selected{% endif %}>{{ label }}</option> | ||
<option value="{{ option.value|stringformat:'s' }}" {% include "tailwind/layout/attrs.html" with widget=option %} >{{ option.label }}</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,12 @@ version = {attr = "crispy_tailwind.__version__"} | |
"Issues" = "https://github.com/django-crispy-forms/crispy-tailwind/issues" | ||
"Changelog" = "https://github.com/django-crispy-forms/crispy-tailwind/releases" | ||
|
||
[tool.autopub] | ||
project-name = "Crispy-Tailwind" | ||
git-username = "botpub" | ||
git-email = "[email protected]" | ||
append-github-contributor = true | ||
|
||
[tool.black] | ||
line-length = 119 | ||
target-version = ['py38'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.