mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Add teams
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
from json import dumps as json_dumps
|
||||
|
||||
from django.forms.widgets import DateTimeBaseInput, NumberInput, TextInput
|
||||
from django.forms.widgets import DateTimeBaseInput, NumberInput, TextInput, Widget
|
||||
|
||||
|
||||
class AmountInput(NumberInput):
|
||||
@ -41,6 +41,29 @@ class Autocomplete(TextInput):
|
||||
return ""
|
||||
|
||||
|
||||
class ColorWidget(Widget):
|
||||
"""
|
||||
Pulled from django-colorfield.
|
||||
Select a color.
|
||||
"""
|
||||
template_name = 'colorfield/color.html'
|
||||
|
||||
class Media:
|
||||
js = [
|
||||
'colorfield/jscolor/jscolor.min.js',
|
||||
'colorfield/colorfield.js',
|
||||
]
|
||||
|
||||
def format_value(self, value):
|
||||
if value is None:
|
||||
value = 0xFFFFFF
|
||||
return "#{:06X}".format(value)
|
||||
|
||||
def value_from_datadict(self, data, files, name):
|
||||
val = super().value_from_datadict(data, files, name)
|
||||
return int(val[1:], 16)
|
||||
|
||||
|
||||
"""
|
||||
The remaining of this file comes from the project `django-bootstrap-datepicker-plus` available on Github:
|
||||
https://github.com/monim67/django-bootstrap-datepicker-plus
|
||||
|
Reference in New Issue
Block a user