django-unfold 0.54.0__py3-none-any.whl → 0.55.1__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.
Files changed (71) hide show
  1. {django_unfold-0.54.0.dist-info → django_unfold-0.55.1.dist-info}/METADATA +29 -11
  2. {django_unfold-0.54.0.dist-info → django_unfold-0.55.1.dist-info}/RECORD +70 -37
  3. unfold/contrib/filters/admin/choice_filters.py +71 -32
  4. unfold/contrib/filters/admin/dropdown_filters.py +15 -1
  5. unfold/contrib/filters/admin/mixins.py +25 -0
  6. unfold/contrib/filters/forms.py +3 -3
  7. unfold/contrib/filters/static/unfold/filters/css/nouislider/LICENSE +21 -0
  8. unfold/contrib/filters/static/unfold/filters/js/nouislider/LICENSE +21 -0
  9. unfold/contrib/filters/static/unfold/filters/js/wnumb/LICENSE +9 -0
  10. unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
  11. unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
  12. unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +1 -1
  13. unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +1 -1
  14. unfold/contrib/forms/static/unfold/forms/css/trix/LICENSE +20 -0
  15. unfold/contrib/forms/static/unfold/forms/js/trix/LICENSE +20 -0
  16. unfold/contrib/forms/widgets.py +2 -2
  17. unfold/layout.py +23 -0
  18. unfold/sites.py +17 -6
  19. unfold/static/unfold/css/simplebar/LICENSE +21 -0
  20. unfold/static/unfold/css/styles.css +1 -1
  21. unfold/static/unfold/fonts/inter/LICENSE +92 -0
  22. unfold/static/unfold/fonts/material-symbols/LICENSE +202 -0
  23. unfold/static/unfold/fonts/material-symbols/Material-Symbols-Outlined.woff2 +0 -0
  24. unfold/static/unfold/js/alpine/LICENSE +21 -0
  25. unfold/static/unfold/js/alpine/alpine.js +5 -0
  26. unfold/static/unfold/js/chart/LICENSE +9 -0
  27. unfold/static/unfold/js/htmx/LICENSE +13 -0
  28. unfold/static/unfold/js/select2.init.js +4 -0
  29. unfold/static/unfold/js/simplebar/LICENSE +21 -0
  30. unfold/templates/unfold/components/button.html +1 -1
  31. unfold/templates/unfold/layouts/skeleton.html +9 -9
  32. unfold/templates/unfold/widgets/clearable_file_input.html +1 -1
  33. unfold/templates/unfold/widgets/clearable_file_input_small.html +1 -1
  34. unfold/templates/unfold_crispy/display_form.html +9 -0
  35. unfold/templates/unfold_crispy/errors.html +3 -0
  36. unfold/templates/unfold_crispy/field.html +23 -0
  37. unfold/templates/unfold_crispy/inputs.html +7 -0
  38. unfold/templates/unfold_crispy/layout/attrs.html +1 -0
  39. unfold/templates/unfold_crispy/layout/baseinput.html +9 -0
  40. unfold/templates/unfold_crispy/layout/button.html +1 -0
  41. unfold/templates/unfold_crispy/layout/buttonholder.html +3 -0
  42. unfold/templates/unfold_crispy/layout/checkbox.html +19 -0
  43. unfold/templates/unfold_crispy/layout/column.html +3 -0
  44. unfold/templates/unfold_crispy/layout/div.html +4 -0
  45. unfold/templates/unfold_crispy/layout/field_errors.html +7 -0
  46. unfold/templates/unfold_crispy/layout/fieldset.html +9 -0
  47. unfold/templates/unfold_crispy/layout/help_text.html +5 -0
  48. unfold/templates/unfold_crispy/layout/help_text_and_errors.html +3 -0
  49. unfold/templates/unfold_crispy/layout/radio_checkbox_select.html +21 -0
  50. unfold/templates/unfold_crispy/layout/row.html +3 -0
  51. unfold/templates/unfold_crispy/layout/table_inline_formset.html +100 -0
  52. unfold/templates/unfold_crispy/uni_form.html +11 -0
  53. unfold/templates/unfold_crispy/whole_uni_form.html +14 -0
  54. unfold/templatetags/unfold.py +15 -9
  55. unfold/widgets.py +86 -1
  56. unfold/static/unfold/js/alpine.js +0 -5
  57. {django_unfold-0.54.0.dist-info → django_unfold-0.55.1.dist-info}/LICENSE.md +0 -0
  58. {django_unfold-0.54.0.dist-info → django_unfold-0.55.1.dist-info}/WHEEL +0 -0
  59. /unfold/contrib/filters/static/unfold/filters/css/{nouislider.min.css → nouislider/nouislider.min.css} +0 -0
  60. /unfold/contrib/filters/static/unfold/filters/js/{nouislider.min.js → nouislider/nouislider.min.js} +0 -0
  61. /unfold/contrib/filters/static/unfold/filters/js/{wNumb.min.js → wnumb/wNumb.min.js} +0 -0
  62. /unfold/contrib/forms/static/unfold/forms/css/{trix.css → trix/trix.css} +0 -0
  63. /unfold/contrib/forms/static/unfold/forms/js/{trix.js → trix/trix.js} +0 -0
  64. /unfold/static/unfold/css/{simplebar.css → simplebar/simplebar.css} +0 -0
  65. /unfold/static/unfold/js/{alpine.anchor.js → alpine/alpine.anchor.js} +0 -0
  66. /unfold/static/unfold/js/{alpine.persist.js → alpine/alpine.persist.js} +0 -0
  67. /unfold/static/unfold/js/{alpine.resize.js → alpine/alpine.resize.js} +0 -0
  68. /unfold/static/unfold/js/{alpine.sort.js → alpine/alpine.sort.js} +0 -0
  69. /unfold/static/unfold/js/{chart.js → chart/chart.js} +0 -0
  70. /unfold/static/unfold/js/{htmx.js → htmx/htmx.js} +0 -0
  71. /unfold/static/unfold/js/{simplebar.js → simplebar/simplebar.js} +0 -0
@@ -0,0 +1,20 @@
1
+ Copyright (c) 37signals, LLC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -95,9 +95,9 @@ class WysiwygWidget(Widget):
95
95
  template_name = "unfold/forms/wysiwyg.html"
96
96
 
97
97
  class Media:
98
- css = {"all": ("unfold/forms/css/trix.css",)}
98
+ css = {"all": ("unfold/forms/css/trix/trix.css",)}
99
99
  js = (
100
- "unfold/forms/js/trix.js",
100
+ "unfold/forms/js/trix/trix.js",
101
101
  "unfold/forms/js/trix.config.js",
102
102
  )
103
103
 
unfold/layout.py ADDED
@@ -0,0 +1,23 @@
1
+ from crispy_forms.layout import BaseInput
2
+
3
+ from unfold.widgets import BUTTON_CLASSES
4
+
5
+
6
+ class ButtonClassesMixin:
7
+ def __init__(self, *args, css_class=None, **kwargs):
8
+ classes = BUTTON_CLASSES
9
+
10
+ if css_class:
11
+ classes.append(css_class)
12
+
13
+ self.field_classes = " ".join(classes)
14
+
15
+ super().__init__(*args, **kwargs)
16
+
17
+
18
+ class Submit(ButtonClassesMixin, BaseInput):
19
+ input_type = "submit"
20
+
21
+
22
+ class Button(ButtonClassesMixin, BaseInput):
23
+ input_type = "button"
unfold/sites.py CHANGED
@@ -24,9 +24,16 @@ except ImportError:
24
24
  return func
25
25
 
26
26
 
27
- from .settings import get_config
28
- from .utils import hex_to_rgb
29
- from .widgets import CHECKBOX_CLASSES, INPUT_CLASSES
27
+ from unfold.settings import get_config
28
+ from unfold.utils import hex_to_rgb
29
+ from unfold.widgets import (
30
+ BUTTON_CLASSES,
31
+ CHECKBOX_CLASSES,
32
+ FILE_CLASSES,
33
+ INPUT_CLASSES,
34
+ RADIO_CLASSES,
35
+ SWITCH_CLASSES,
36
+ )
30
37
 
31
38
 
32
39
  class UnfoldAdminSite(AdminSite):
@@ -34,7 +41,7 @@ class UnfoldAdminSite(AdminSite):
34
41
  settings_name = "UNFOLD"
35
42
 
36
43
  def __init__(self, name: str = "admin") -> None:
37
- from .forms import AuthenticationForm
44
+ from unfold.forms import AuthenticationForm
38
45
 
39
46
  super().__init__(name)
40
47
 
@@ -68,8 +75,12 @@ class UnfoldAdminSite(AdminSite):
68
75
  sidebar_config = self._get_config("SIDEBAR", request)
69
76
  data = {
70
77
  "form_classes": {
71
- "text_input": INPUT_CLASSES,
72
- "checkbox": CHECKBOX_CLASSES,
78
+ "text_input": " ".join(INPUT_CLASSES),
79
+ "checkbox": " ".join(CHECKBOX_CLASSES),
80
+ "button": " ".join(BUTTON_CLASSES),
81
+ "radio": " ".join(RADIO_CLASSES),
82
+ "switch": " ".join(SWITCH_CLASSES),
83
+ "file": " ".join(FILE_CLASSES),
73
84
  },
74
85
  "site_title": self._get_config("SITE_TITLE", request) or self.site_title,
75
86
  "site_header": self._get_config("SITE_HEADER", request) or self.site_header,
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Jonathan Nicol
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.