Ultron/ultron/profiles/forms.py

27 lines
836 B
Python
Raw Normal View History

2021-12-09 16:53:44 +01:00
# coding=UTF-8
from django import forms
from datetime import date
from .models import Profile
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
fields = (
2021-12-19 09:30:51 +01:00
"template_color",
"sidebar_color",
"is_sidebar_minified",
2021-12-09 16:53:44 +01:00
)
widgets = {
2021-12-19 09:30:51 +01:00
"template_color": forms.Select(attrs={"class": "form-control"}),
"sidebar_color": forms.Select(attrs={"class": "form-control"}),
"is_sidebar_minified": forms.CheckboxInput(
2021-12-09 16:53:44 +01:00
attrs={
2021-12-19 09:30:51 +01:00
"class": "bootstrap-switch mt-0",
"data-on-label": '<i class="tim-icons icon-check-2 text-success"></i>',
"data-off-label": '<i class="tim-icons icon-simple-remove text-danger"></i>',
2021-12-09 16:53:44 +01:00
}
),
}