Add "form-control" class to some form tags

This commit is contained in:
Maël Solard
2014-08-07 18:38:42 +02:00
parent 3b138f2f4f
commit ecede081b2
7 changed files with 15 additions and 9 deletions
+2 -1
View File
@@ -28,7 +28,8 @@ class DomainFormGeneral(forms.ModelForm, DynamicForm):
help_text=ugettext_lazy(
"Alias(es) of this domain. Indicate only one name per input, "
"press ENTER to add a new input."
)
),
widget=forms.TextInput(attrs={"class": "col-md-1 form-control"})
)
class Meta:
+1 -1
View File
@@ -18,7 +18,7 @@ class ExportDataForm(forms.Form):
def __init__(self, *args, **kwargs):
super(ExportDataForm, self).__init__(*args, **kwargs)
self.fields["sepchar"].widget.attrs = {"class": "span1"}
self.fields["sepchar"].widget.attrs = {"class": "col-md-1 form-control"}
def clean_sepchar(self):
if self.cleaned_data["sepchar"] == "":
+1 -1
View File
@@ -17,7 +17,7 @@ class ImportDataForm(forms.Form):
def __init__(self, *args, **kwargs):
super(ImportDataForm, self).__init__(*args, **kwargs)
self.fields["sepchar"].widget.attrs = {"class": "span1"}
self.fields["sepchar"].widget.attrs = {"class": "col-md-1 form-control"}
def clean_sepchar(self):
if self.cleaned_data["sepchar"] == "":
@@ -11,7 +11,7 @@ class ARmessageForm(forms.ModelForm):
required=False,
help_text=ugettext_lazy("Activate your auto reply from this date"),
widget=forms.TextInput(
attrs={'class': 'datefield', 'readonly': 'readonly'}
attrs={'class': 'datefield form-control', 'readonly': 'readonly'}
)
)
untildate = forms.DateTimeField(
@@ -19,7 +19,7 @@ class ARmessageForm(forms.ModelForm):
required=False,
help_text=ugettext_lazy("Activate your auto reply until this date"),
widget=forms.TextInput(
attrs={'class': 'datefield', 'readonly': 'readonly'}
attrs={'class': 'datefield form-control', 'readonly': 'readonly'}
)
)
@@ -14,14 +14,17 @@ class RelayDomainFormGeneral(forms.ModelForm, DynamicForm):
help_text=ugettext_lazy(
"Alias(es) of this relay domain. Indicate only one name per input"
", press ENTER to add a new input."
)
),
widget=forms.TextInput(attrs={'class': 'form-control'})
)
class Meta:
model = RelayDomain
exclude = ['dates']
widgets = {
'service': forms.Select(attrs={'class': 'span2'})
'service': forms.Select(attrs={'class': 'col-mg-2 form-control'}),
'target_host': forms.TextInput(attrs={'class': 'form-control'}),
'name': forms.TextInput(attrs={'class': 'form-control'})
}
def __init__(self, *args, **kwargs):
+3 -1
View File
@@ -9,7 +9,9 @@ from modoboa.extensions.admin.templatetags.admin_tags import gender
class FiltersSetForm(forms.Form):
name = forms.CharField(widget=forms.TextInput(attrs={"class": "form-control"}))
name = forms.CharField(
widget=forms.TextInput(attrs={"class": "form-control"})
)
active = forms.BooleanField(
label=gender("Active", "m"), required=False,
initial=False,
+1 -1
View File
@@ -55,7 +55,7 @@ class ParametersForm(AdminParametersForm):
("ssl", "SSL/TLS")],
initial="none",
help_text=_("Use a secured connection to access SMTP server"),
widget=InlineRadioSelect(attrs={"type": "checkbox"})
widget=forms.Select(attrs={"class": "form-control"})
)
smtp_port = forms.IntegerField(