crispy-daisyui 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crispy_daisyui/__init__.py +0 -1
- crispy_daisyui/daisyui.py +1 -0
- crispy_daisyui/templates/daisyui/field.html +12 -5
- crispy_daisyui/templates/daisyui/layout/checkbox.html +15 -0
- crispy_daisyui/templates/daisyui/layout/checkboxselectmultiple.html +11 -5
- crispy_daisyui/templates/daisyui/layout/toggle.html +10 -0
- crispy_daisyui/templatetags/daisyui_field.py +6 -2
- crispy_daisyui-0.7.0.dist-info/LICENSE +201 -0
- crispy_daisyui-0.7.0.dist-info/METADATA +64 -0
- {crispy_daisyui-0.5.0.dist-info → crispy_daisyui-0.7.0.dist-info}/RECORD +12 -10
- {crispy_daisyui-0.5.0.dist-info → crispy_daisyui-0.7.0.dist-info}/WHEEL +1 -1
- crispy_daisyui-0.5.0.dist-info/LICENSE.txt +0 -22
- crispy_daisyui-0.5.0.dist-info/METADATA +0 -91
- {crispy_daisyui-0.5.0.dist-info → crispy_daisyui-0.7.0.dist-info}/top_level.txt +0 -0
crispy_daisyui/__init__.py
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.5.0"
|
crispy_daisyui/daisyui.py
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
{# Opening Div and Label first #}
|
|
7
7
|
|
|
8
8
|
<{% 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 %}">
|
|
9
|
-
{% if field.label and form_show_labels %}
|
|
9
|
+
{% if field.label and form_show_labels and not field|is_toggle and not field|is_checkbox %}
|
|
10
10
|
<label for="{{ field.id_for_label }}" class="{% if label_class %}{{ label_class }}{% endif %}">
|
|
11
11
|
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
|
|
12
12
|
</label>
|
|
@@ -15,17 +15,24 @@
|
|
|
15
15
|
{# if field has a special template then use this #}
|
|
16
16
|
{% if field|is_select %}
|
|
17
17
|
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
|
18
|
-
|
|
19
18
|
{% include 'daisyui/layout/select.html' %}
|
|
19
|
+
</div>
|
|
20
20
|
{% elif field|is_checkboxselectmultiple %}
|
|
21
21
|
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
|
22
|
-
|
|
23
22
|
{% include 'daisyui/layout/checkboxselectmultiple.html' %}
|
|
23
|
+
</div>
|
|
24
|
+
{% elif field|is_toggle %}
|
|
25
|
+
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
|
26
|
+
{% include 'daisyui/layout/toggle.html' %}
|
|
27
|
+
</div>
|
|
28
|
+
{% elif field|is_checkbox %}
|
|
29
|
+
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
|
30
|
+
{% include 'daisyui/layout/checkbox.html' %}
|
|
31
|
+
</div>
|
|
24
32
|
{% elif field|is_radioselect %}
|
|
25
33
|
<div class="{% if field_class %}{{ field_class }}{% else %}mb-3{% endif %}"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}>
|
|
26
|
-
|
|
27
34
|
{% include 'daisyui/layout/radioselect.html' %}
|
|
28
|
-
|
|
35
|
+
</div>
|
|
29
36
|
{% else %}
|
|
30
37
|
|
|
31
38
|
{# otherwise use django rendering with additional classes added #}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{% load crispy_forms_filters %}
|
|
2
|
+
|
|
3
|
+
<div class="form-control">
|
|
4
|
+
<label class="label cursor-pointer">
|
|
5
|
+
<span class="label-text">{{ field.label }}</span>
|
|
6
|
+
<input type="checkbox"
|
|
7
|
+
class="checkbox {{ field.css_classes }}"
|
|
8
|
+
name="{{ field.html_name }}"
|
|
9
|
+
id="{{ field.auto_id }}"
|
|
10
|
+
{% if field.value %}checked="checked"{% endif %}
|
|
11
|
+
{{ field.field.widget.attrs|flatatt }}>
|
|
12
|
+
</label>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
{% include 'daisyui/layout/help_text_and_errors.html' %}
|
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
{% for choice in field.field.choices %}
|
|
5
5
|
<div class="form-control">
|
|
6
|
-
<label class="label cursor-pointer"
|
|
7
|
-
<input type="checkbox" class="checkbox"
|
|
6
|
+
<label class="label cursor-pointer">
|
|
7
|
+
<input type="checkbox" class="checkbox"
|
|
8
|
+
{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|default_if_none:""|stringformat:"s" %} checked="checked"{% endif %}
|
|
9
|
+
name="{{ field.html_name }}"
|
|
10
|
+
id="id_{{ field.html_name }}_{{ forloop.counter }}"
|
|
11
|
+
value="{{ choice.0|unlocalize }}"
|
|
12
|
+
{{ field.field.widget.attrs|flatatt }}>
|
|
8
13
|
<span class="label-text">{{ choice.1|unlocalize }}</span>
|
|
9
14
|
</label>
|
|
10
|
-
{% if field.errors and forloop.last and not inline_class %}
|
|
11
|
-
{# include 'daisyui/layout/field_errors_block.html' <-- bs4 template adds this here. Currently this pack adds it in field.html #}
|
|
12
|
-
{% endif %}
|
|
13
15
|
</div>
|
|
14
16
|
{% endfor %}
|
|
17
|
+
|
|
18
|
+
{% if field.errors and not inline_class %}
|
|
19
|
+
{% include 'daisyui/layout/field_errors_block.html' %}
|
|
20
|
+
{% endif %}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{% load crispy_forms_filters %}
|
|
2
|
+
{% load l10n %}
|
|
3
|
+
|
|
4
|
+
<div class="form-control">
|
|
5
|
+
<label class="label cursor-pointer" for="{{ field.id_for_label }}">
|
|
6
|
+
<span class="label-text">{{ field.label }}</span>
|
|
7
|
+
<input type="checkbox" class="toggle" name="{{ field.html_name }}" id="{{ field.id_for_label }}"
|
|
8
|
+
{% if field.value %}checked="checked"{% endif %} {{ field.field.widget.attrs|flatatt }}>
|
|
9
|
+
</label>
|
|
10
|
+
</div>
|
|
@@ -18,6 +18,9 @@ register = template.Library()
|
|
|
18
18
|
def is_checkbox(field):
|
|
19
19
|
return isinstance(field.field.widget, forms.CheckboxInput)
|
|
20
20
|
|
|
21
|
+
@register.filter
|
|
22
|
+
def is_toggle(field):
|
|
23
|
+
return isinstance(field.field.widget, forms.CheckboxInput) and 'toggle' in field.field.widget.attrs.get('class', '')
|
|
21
24
|
|
|
22
25
|
@register.filter
|
|
23
26
|
def is_password(field):
|
|
@@ -97,16 +100,17 @@ class CrispyDaisyUiFieldNode(template.Node):
|
|
|
97
100
|
"date": base_input,
|
|
98
101
|
"datetime": base_input,
|
|
99
102
|
"time": base_input,
|
|
100
|
-
"checkbox": "",
|
|
103
|
+
"checkbox": "checkbox",
|
|
101
104
|
"select": "select select-bordered w-full",
|
|
102
105
|
"nullbooleanselect": "",
|
|
103
106
|
"selectmultiple": "",
|
|
104
|
-
"checkboxselectmultiple": "",
|
|
107
|
+
"checkboxselectmultiple": "checkbox",
|
|
105
108
|
"multi": "",
|
|
106
109
|
"splitdatetime": base_input,
|
|
107
110
|
"splithiddendatetime": "",
|
|
108
111
|
"selectdate": "",
|
|
109
112
|
"error_border": "border-red-500",
|
|
113
|
+
"toggle": "toggle",
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
default_container = CSSContainer(default_styles)
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: crispy-daisyui
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: A DaisyUI package for Django Crispy Forms
|
|
5
|
+
Author: Fabian Geiger
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/fabge/crispy-daisyui
|
|
8
|
+
Project-URL: Changelog, https://github.com/fabge/crispy-daisyui/releases
|
|
9
|
+
Project-URL: Issues, https://github.com/fabge/crispy-daisyui/issues
|
|
10
|
+
Project-URL: CI, https://github.com/fabge/crispy-daisyui/actions
|
|
11
|
+
Keywords: forms,django,crispy,tailwind,daisyui
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Requires-Python: >=3.7
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: django-crispy-forms >=1.11.2
|
|
17
|
+
Requires-Dist: django >=3.2
|
|
18
|
+
|
|
19
|
+
# crispy-daisyui
|
|
20
|
+
|
|
21
|
+
A [`daisyUI`](https://daisyui.com) template pack for the wonderful [django-crispy-forms](https://github.com/django-crispy-forms/django-crispy-forms).
|
|
22
|
+
|
|
23
|
+
This repository is a fork of [`crispy-tailwind`](https://github.com/django-crispy-forms/crispy-tailwind) and has been modified just enough to suit my needs.
|
|
24
|
+
It works well for the most common forms elements.
|
|
25
|
+
|
|
26
|
+
## How to install
|
|
27
|
+
|
|
28
|
+
Install via pip:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install crispy-daisyui
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
You will need to update your project's settings file to add ``crispy_forms``
|
|
35
|
+
and ``crispy_daisyui`` to your project's ``INSTALLED_APPS`` setting. Also set
|
|
36
|
+
``daisyui`` as an allowed template pack and as the default template pack
|
|
37
|
+
for your project:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
INSTALLED_APPS = [
|
|
41
|
+
# ...
|
|
42
|
+
'crispy_forms',
|
|
43
|
+
'crispy_daisyui',
|
|
44
|
+
# ...
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
CRISPY_ALLOWED_TEMPLATE_PACKS = 'daisyui'
|
|
48
|
+
CRISPY_TEMPLATE_PACK = 'daisyui'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## How to use
|
|
52
|
+
|
|
53
|
+
Current functionality allows the ``|crispy`` filter to be used to style your
|
|
54
|
+
form. In your template:
|
|
55
|
+
|
|
56
|
+
1. Load the filter: ``{% load daisyui_filters %}``
|
|
57
|
+
2. Apply the crispy filter: ``{{ form|crispy }}``
|
|
58
|
+
|
|
59
|
+
We can also use the ``{% crispy %}`` tag to allow usage of crispy-forms'
|
|
60
|
+
``FormHelper`` and ``Layout``. In your template:
|
|
61
|
+
|
|
62
|
+
1. Load the crispy tag: ``{% load crispy_forms_tags %}``
|
|
63
|
+
2. Add ``FormHelper`` to your form and use crispy-forms to set-up your form
|
|
64
|
+
3. Use the crispy tag ``{% crispy form %}`` in your template
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
crispy_daisyui/__init__.py,sha256=
|
|
2
|
-
crispy_daisyui/daisyui.py,sha256=
|
|
1
|
+
crispy_daisyui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
crispy_daisyui/daisyui.py,sha256=KXCSsVN07et9UNcfLUHJoCFP-rk94bSlHCEcbtM-Sog,2303
|
|
3
3
|
crispy_daisyui/layout.py,sha256=sJ7yFExo5nL1cvQ_fiSR7uY4I7mHjq_YJdP5KXXHVd0,2135
|
|
4
4
|
crispy_daisyui/templates/daisyui/display_form.html,sha256=lOFZD53-Icz4Vklld4U1psoR8isugZZmhn_Br5bcy3Y,258
|
|
5
5
|
crispy_daisyui/templates/daisyui/errors.html,sha256=uM4Couvg7B1JK0m1WD0N9u27tKBL3TGx98ZVwM7mAx8,410
|
|
6
6
|
crispy_daisyui/templates/daisyui/errors_formset.html,sha256=NTkCR5p2FQ8RFm8KttVtMeQKuQ6E8140E0JEK5y_Pa8,386
|
|
7
|
-
crispy_daisyui/templates/daisyui/field.html,sha256=
|
|
7
|
+
crispy_daisyui/templates/daisyui/field.html,sha256=yzCirUsvD61AKiO1Kqps3eRzQlxCDvxPNTIABDz03U4,2208
|
|
8
8
|
crispy_daisyui/templates/daisyui/inputs.html,sha256=kw5acssJGx29WtPRDYP6fj7vOHwMGfrIm94yM0zRdVs,407
|
|
9
9
|
crispy_daisyui/templates/daisyui/table_inline_formset.html,sha256=EI31XC0NJ28qN2LHomqzB42RVPuwTCghjrXRPfzQ-Qs,1872
|
|
10
10
|
crispy_daisyui/templates/daisyui/uni_form.html,sha256=xNfQ7GCtW9mW55GK4tSiFkx8wyB0bltx5A8BISVoTxg,306
|
|
@@ -14,7 +14,8 @@ crispy_daisyui/templates/daisyui/whole_uni_formset.html,sha256=SAb7RaEUpI8Sd5j5b
|
|
|
14
14
|
crispy_daisyui/templates/daisyui/layout/alert.html,sha256=bFc1e4UQCG4bVN8K9HpBQaZsNAMnld1Yj6HEDplgd58,766
|
|
15
15
|
crispy_daisyui/templates/daisyui/layout/baseinput.html,sha256=YayTE-BqUKdb7k1M6FrAuuwpDduTbkyfOrke0jEeAW4,428
|
|
16
16
|
crispy_daisyui/templates/daisyui/layout/button.html,sha256=ZW5R0kxa3PvkXSYcKgl-hW8vuv3TfdkCGB3YvekIRTI,84
|
|
17
|
-
crispy_daisyui/templates/daisyui/layout/
|
|
17
|
+
crispy_daisyui/templates/daisyui/layout/checkbox.html,sha256=akTc8zae6VFYwotUYukUQGtZnl8ISC-0ALcfPx8hzxQ,495
|
|
18
|
+
crispy_daisyui/templates/daisyui/layout/checkboxselectmultiple.html,sha256=igqqVFrAcxmGnL1Q_TjdorUXpjXX7r9b6EZHBV66264,863
|
|
18
19
|
crispy_daisyui/templates/daisyui/layout/column.html,sha256=PJPuIJhyqgLKFGtYnx5ueYtge-FsemSk21168ghfXAs,161
|
|
19
20
|
crispy_daisyui/templates/daisyui/layout/div.html,sha256=BAN5QbRtm3lmxi5gpKKBwLu2-5L05ZCN9JD7nYNHWWw,182
|
|
20
21
|
crispy_daisyui/templates/daisyui/layout/field_errors.html,sha256=5tZz6oxlA0-8CDpdsyhCjTn73zTZAjETc4oAfFUUDM0,241
|
|
@@ -31,11 +32,12 @@ crispy_daisyui/templates/daisyui/layout/radioselect_inline.html,sha256=vQxTJBN7m
|
|
|
31
32
|
crispy_daisyui/templates/daisyui/layout/row.html,sha256=qGv5hSu1_QDZTqQDKhEwry4eJCBqei7m4yARuDVNEmM,169
|
|
32
33
|
crispy_daisyui/templates/daisyui/layout/select.html,sha256=-_xw2lGdNfBVAE0SD-i2cHrN3rC9iGw91UgNK0LQP8E,525
|
|
33
34
|
crispy_daisyui/templates/daisyui/layout/select_option.html,sha256=c5oNLFw_hYICvixovxbd6o1EI_8aqYT38DudWlaDOmg,237
|
|
35
|
+
crispy_daisyui/templates/daisyui/layout/toggle.html,sha256=i8F7a9Wx-rkuQ6QEvFRXo2h4CngfQMOYifrNt6kmYWQ,418
|
|
34
36
|
crispy_daisyui/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
crispy_daisyui/templatetags/daisyui_field.py,sha256=
|
|
37
|
+
crispy_daisyui/templatetags/daisyui_field.py,sha256=FQz008pHvHN2w5dOe5FCIpJIPnWhBbYaGw8CdWt97yA,7680
|
|
36
38
|
crispy_daisyui/templatetags/daisyui_filters.py,sha256=4RCNLV-fS6Pe3fwdMgqnExFtAHYGdtMB016nzt9fdno,3708
|
|
37
|
-
crispy_daisyui-0.
|
|
38
|
-
crispy_daisyui-0.
|
|
39
|
-
crispy_daisyui-0.
|
|
40
|
-
crispy_daisyui-0.
|
|
41
|
-
crispy_daisyui-0.
|
|
39
|
+
crispy_daisyui-0.7.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
40
|
+
crispy_daisyui-0.7.0.dist-info/METADATA,sha256=hbrQ3hiuC8i02AopTJrDtpwkZ8RHk5HHrHsFAOxWyCI,2099
|
|
41
|
+
crispy_daisyui-0.7.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
42
|
+
crispy_daisyui-0.7.0.dist-info/top_level.txt,sha256=iUfAwww7rFyMb7SijKgjBe3vui_xvSHOovH4tPtPjTo,15
|
|
43
|
+
crispy_daisyui-0.7.0.dist-info/RECORD,,
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2023 Fabian Geiger and contributors.
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person
|
|
4
|
-
obtaining a copy of this software and associated documentation
|
|
5
|
-
files (the "Software"), to deal in the Software without
|
|
6
|
-
restriction, including without limitation the rights to use,
|
|
7
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the
|
|
9
|
-
Software is furnished to do so, subject to the following
|
|
10
|
-
conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be
|
|
13
|
-
included in all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
17
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
20
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: crispy-daisyui
|
|
3
|
-
Version: 0.5.0
|
|
4
|
-
Summary: A DaisyUI package for Django Crispy Forms
|
|
5
|
-
Home-page: https://github.com/fabge/crispy-daisyui
|
|
6
|
-
Author: Fabian Geiger
|
|
7
|
-
Author-email: geiger.fabian@outlook.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Keywords: forms,django,crispy,tailwind,daisyui
|
|
10
|
-
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
-
Classifier: Environment :: Web Environment
|
|
12
|
-
Classifier: Framework :: Django
|
|
13
|
-
Classifier: Framework :: Django :: 3.2
|
|
14
|
-
Classifier: Framework :: Django :: 4.0
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: JavaScript
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
-
Classifier: Topic :: Internet :: WWW/HTTP
|
|
24
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
25
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
-
Requires-Python: >=3.7
|
|
27
|
-
License-File: LICENSE.txt
|
|
28
|
-
Requires-Dist: django-crispy-forms >=1.11.2
|
|
29
|
-
Requires-Dist: django >=3.2
|
|
30
|
-
|
|
31
|
-
===============
|
|
32
|
-
crispy-daisyui
|
|
33
|
-
===============
|
|
34
|
-
|
|
35
|
-
A `daisyUI`_ template pack for the wonderful django-crispy-forms_.
|
|
36
|
-
|
|
37
|
-
This repository is a fork of `crispy-tailwind`_ and has been modified just enough to suit my needs.
|
|
38
|
-
It works well for the most common forms elements.
|
|
39
|
-
|
|
40
|
-
**WARNING**
|
|
41
|
-
|
|
42
|
-
This project is still in its early stages of development. Any contributions to
|
|
43
|
-
the package would be very welcomed.
|
|
44
|
-
|
|
45
|
-
Currently the template pack allows the use of the ``|crispy`` filter to style
|
|
46
|
-
your form. Here is an example image.
|
|
47
|
-
|
|
48
|
-
How to install
|
|
49
|
-
--------------
|
|
50
|
-
|
|
51
|
-
Install via pip. ::
|
|
52
|
-
|
|
53
|
-
pip install crispy-daisyui
|
|
54
|
-
|
|
55
|
-
You will need to update your project's settings file to add ``crispy_forms``
|
|
56
|
-
and ``crispy_daisyui`` to your project's ``INSTALLED_APPS`` setting. Also set
|
|
57
|
-
``daisyui`` as an allowed template pack and as the default template pack
|
|
58
|
-
for your project::
|
|
59
|
-
|
|
60
|
-
INSTALLED_APPS = (
|
|
61
|
-
...
|
|
62
|
-
"crispy_forms",
|
|
63
|
-
"crispy_daisyui",
|
|
64
|
-
...
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
CRISPY_ALLOWED_TEMPLATE_PACKS = "daisyui"
|
|
68
|
-
|
|
69
|
-
CRISPY_TEMPLATE_PACK = "daisyui"
|
|
70
|
-
|
|
71
|
-
How to use
|
|
72
|
-
----------
|
|
73
|
-
|
|
74
|
-
This project is still in its early stages.
|
|
75
|
-
|
|
76
|
-
Current functionality allows the ``|crispy`` filter to be used to style your
|
|
77
|
-
form. In your template:
|
|
78
|
-
|
|
79
|
-
1. Load the filter: ``{% load daisyui_filters %}``
|
|
80
|
-
2. Apply the crispy filter: ``{{ form|crispy }}``
|
|
81
|
-
|
|
82
|
-
We can also use the ``{% crispy %}`` tag to allow usage of crispy-forms'
|
|
83
|
-
``FormHelper`` and ``Layout``. In your template:
|
|
84
|
-
|
|
85
|
-
1. Load the crispy tag: ``{% load crispy_forms_tags %}``
|
|
86
|
-
2. Add ``FormHelper`` to your form and use crispy-forms to set-up your form
|
|
87
|
-
3. Use the crispy tag ``{% crispy form %}`` in your template
|
|
88
|
-
|
|
89
|
-
.. _daisyUI: https://daisyui.com
|
|
90
|
-
.. _crispy-tailwind: https://github.com/django-crispy-forms/crispy-tailwind
|
|
91
|
-
.. _django-crispy-forms: https://github.com/django-crispy-forms/django-crispy-forms
|
|
File without changes
|