feat(transactions): update cuelume; bring back improved volume user setting

This commit is contained in:
Herculino Trotta
2026-09-13 01:24:37 -03:00
parent 82211567d0
commit a2ee0b4ae6
9 changed files with 102 additions and 8 deletions
+17
View File
@@ -3,3 +3,20 @@ from crispy_forms.layout import Field
class Switch(Field):
template = "crispy-daisyui/layout/switch.html"
class Range(Field):
template = "crispy-daisyui/layout/range.html"
def render(self, form, context, extra_context=None, **kwargs):
extra_context = extra_context or {}
# Build the measure (ticks + labels) from the field's min/max/step
attrs = form.fields[self.fields[0]].widget.attrs
if "min" in attrs and "max" in attrs:
step = attrs.get("step") or 1
extra_context["range_steps"] = list(
range(int(attrs["min"]), int(attrs["max"]) + 1, int(step))
)
return super().render(form, context, extra_context=extra_context, **kwargs)
+5
View File
@@ -0,0 +1,5 @@
from django import forms
class RangeInput(forms.NumberInput):
input_type = "range"