|
@@ -1,9 +1,16 @@
|
|
|
-from django import forms
|
|
|
import re
|
|
|
+
|
|
|
+from django import forms
|
|
|
+
|
|
|
+
|
|
|
class LogoForm(forms.Form):
|
|
|
- namesystem = forms.CharField(max_length=30, label="Название системы", required=False)
|
|
|
- logo = forms.FileField(label="Логотип", required=False)
|
|
|
- logo.widget.attrs.update({'accept':'.png, .svg, .ico'})
|
|
|
+ namesystem = forms.CharField(
|
|
|
+ max_length=30,
|
|
|
+ label="Название системы", required=False)
|
|
|
+ logo = forms.FileField(
|
|
|
+ label="Логотип", required=False)
|
|
|
+ logo.widget.attrs.update({'accept': '.png, .svg, .ico'})
|
|
|
+
|
|
|
|
|
|
class ColorsForm(forms.Form):
|
|
|
def __init__(self, *args, **kwargs):
|
|
@@ -14,16 +21,103 @@ class ColorsForm(forms.Form):
|
|
|
super(ColorsForm, self).__init__(*args, **kwargs)
|
|
|
|
|
|
# Create form fields with initial color values
|
|
|
- self.fields['btnBg'] = forms.CharField(label='Цвет кнопок', initial=colors[0], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnTxt'] = forms.CharField(label='Цвет текста кнопок', initial=colors[1], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnHover'] = forms.CharField(label='Цвет наведения у кнопок', initial=colors[2], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['pillsBg'] = forms.CharField(label='Цвет плашек в меню', initial=colors[3], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['pillsTxt'] = forms.CharField(label='Цвет текста плашек в меню', initial=colors[4], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['linksTxt'] = forms.CharField(label='Цвет текста ссылок', initial=colors[5], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['linksHover'] = forms.CharField(label='Цвет наведения у ссылок', initial=colors[6], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnSuccessBg'] = forms.CharField(label='Цвет кнопок успеха', initial=colors[7], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnSuccessTxt'] = forms.CharField(label='Цвет текста кнопок успеха', initial=colors[8], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnSuccessHover'] = forms.CharField(label='Цвет наведения у кнопок успеха', initial=colors[9], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnDangerBg'] = forms.CharField(label='Цвет текста кнопок предупреждения', initial=colors[10], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnDangerTxt'] = forms.CharField(label='Цвет текста кнопок предупреждения', initial=colors[11], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
- self.fields['btnDangerHover'] = forms.CharField(label='Цвет наведения у кнопок предупреждения', initial=colors[12], max_length=7, widget=forms.TextInput(attrs={'type': 'color'}))
|
|
|
+ self.fields['btnBg'] = forms.CharField(
|
|
|
+ label='Цвет кнопок',
|
|
|
+ initial=colors[0],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnTxt'] = forms.CharField(
|
|
|
+ label='Цвет текста кнопок',
|
|
|
+ initial=colors[1],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnHover'] = forms.CharField(
|
|
|
+ label='Цвет наведения у кнопок',
|
|
|
+ initial=colors[2],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['pillsBg'] = forms.CharField(
|
|
|
+ label='Цвет плашек в меню',
|
|
|
+ initial=colors[3],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['pillsTxt'] = forms.CharField(
|
|
|
+ label='Цвет текста плашек в меню',
|
|
|
+ initial=colors[4],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['linksTxt'] = forms.CharField(
|
|
|
+ label='Цвет текста ссылок',
|
|
|
+ initial=colors[5],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['linksHover'] = forms.CharField(
|
|
|
+ label='Цвет наведения у ссылок',
|
|
|
+ initial=colors[6],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnSuccessBg'] = forms.CharField(
|
|
|
+ label='Цвет кнопок успеха',
|
|
|
+ initial=colors[7],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnSuccessTxt'] = forms.CharField(
|
|
|
+ label='Цвет текста кнопок успеха',
|
|
|
+ initial=colors[8],
|
|
|
+ max_length=7, widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnSuccessHover'] = forms.CharField(
|
|
|
+ label='Цвет наведения у кнопок успеха',
|
|
|
+ initial=colors[9],
|
|
|
+ max_length=7, widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnDangerBg'] = forms.CharField(
|
|
|
+ label='Цвет текста кнопок предупреждения',
|
|
|
+ initial=colors[10],
|
|
|
+ max_length=7, widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnDangerTxt'] = forms.CharField(
|
|
|
+ label='Цвет текста кнопок предупреждения',
|
|
|
+ initial=colors[11],
|
|
|
+ max_length=7, widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|
|
|
+ self.fields['btnDangerHover'] = forms.CharField(
|
|
|
+ label='Цвет наведения у кнопок предупреждения',
|
|
|
+ initial=colors[12],
|
|
|
+ max_length=7,
|
|
|
+ widget=forms.TextInput(attrs={
|
|
|
+ 'type': 'color'
|
|
|
+ })
|
|
|
+ )
|