Update web/core/forms.py
This commit is contained in:
parent
1cee4c1beb
commit
92ca457577
@ -9,12 +9,14 @@ class EntryForm(forms.Form):
|
||||
scripture_raw = forms.CharField(required=False)
|
||||
source = forms.CharField(required=False)
|
||||
talk_title = forms.CharField(required=False)
|
||||
talk_number = forms.IntegerField(required=False)
|
||||
talk_number = forms.ChoiceField(
|
||||
required=False,
|
||||
choices=[("", "—")] + [(str(i), str(i)) for i in range(1, 201)], # blank + 1-200
|
||||
)
|
||||
entry_code = forms.CharField(required=False)
|
||||
date_added = forms.DateField(required=False, widget=forms.DateInput(attrs={"type": "date"}))
|
||||
date_edited = forms.DateField(required=False, widget=forms.DateInput(attrs={"type": "date"}))
|
||||
|
||||
# Assign the “search-input” look to these fields
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@ -24,7 +26,7 @@ class EntryForm(forms.Form):
|
||||
for name in big_inputs:
|
||||
if name in self.fields:
|
||||
self.fields[name].widget.attrs.update({
|
||||
"class": "search-input input-hero" # same base class as your search box
|
||||
"class": "search-input input-hero"
|
||||
})
|
||||
|
||||
for name in textareas:
|
||||
@ -33,9 +35,11 @@ class EntryForm(forms.Form):
|
||||
"class": "search-input input-hero textarea-hero"
|
||||
})
|
||||
|
||||
# Smaller controls that still match the style
|
||||
if "talk_number" in self.fields:
|
||||
self.fields["talk_number"].widget.attrs.update({"class": "search-input input-hero"})
|
||||
self.fields["talk_number"].widget.attrs.update({
|
||||
"class": "search-input input-hero"
|
||||
})
|
||||
|
||||
if "date_added" in self.fields:
|
||||
self.fields["date_added"].widget.attrs.update({"class": "search-input input-hero"})
|
||||
if "date_edited" in self.fields:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user