Update web/core/forms.py
This commit is contained in:
+24
-1
@@ -47,6 +47,28 @@ class EntryForm(forms.Form):
|
|||||||
"class": "search-input input-hero textarea-hero"
|
"class": "search-input input-hero textarea-hero"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# ---- Placeholders (requested) ----
|
||||||
|
if "subject" in self.fields:
|
||||||
|
self.fields["subject"].widget.attrs.setdefault(
|
||||||
|
"placeholder",
|
||||||
|
"Separate subjects with commas (e.g., Faith, Love, Patience)"
|
||||||
|
)
|
||||||
|
if "scripture_raw" in self.fields:
|
||||||
|
self.fields["scripture_raw"].widget.attrs.setdefault(
|
||||||
|
"placeholder",
|
||||||
|
"Use WOL abbreviations; separate refs with ; (e.g., Joh 3:16; Ps 23:1-4)"
|
||||||
|
)
|
||||||
|
if "source" in self.fields:
|
||||||
|
self.fields["source"].widget.attrs.setdefault(
|
||||||
|
"placeholder",
|
||||||
|
"Use correct WOL mnemonic for linking; otherwise Google search"
|
||||||
|
)
|
||||||
|
if "talk_title" in self.fields:
|
||||||
|
self.fields["talk_title"].widget.attrs.setdefault(
|
||||||
|
"placeholder",
|
||||||
|
"Will auto-fill when a Talk Number is selected"
|
||||||
|
)
|
||||||
|
|
||||||
if "talk_number" in self.fields:
|
if "talk_number" in self.fields:
|
||||||
self.fields["talk_number"].widget.attrs.update({
|
self.fields["talk_number"].widget.attrs.update({
|
||||||
"class": "search-input input-hero"
|
"class": "search-input input-hero"
|
||||||
@@ -62,10 +84,11 @@ class EntryForm(forms.Form):
|
|||||||
v = self.cleaned_data.get("talk_number")
|
v = self.cleaned_data.get("talk_number")
|
||||||
return v if isinstance(v, int) else None
|
return v if isinstance(v, int) else None
|
||||||
|
|
||||||
|
|
||||||
class AnnouncementForm(ModelForm):
|
class AnnouncementForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Announcement
|
model = Announcement
|
||||||
fields = ["title", "message", "is_active"]
|
fields = ["title", "message,","is_active"]
|
||||||
widgets = {
|
widgets = {
|
||||||
"message": Textarea(attrs={"rows": 6, "placeholder": "What’s new in this release…"}),
|
"message": Textarea(attrs={"rows": 6, "placeholder": "What’s new in this release…"}),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user