forms.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from django import forms
  2. from django.utils.translation import gettext_lazy as _
  3. from ...admin.forms import YesNoSwitch
  4. from ...conf.admin.forms import ChangeSettingsForm
  5. class ChangeGeneralSettingsForm(ChangeSettingsForm):
  6. settings = [
  7. "forum_name",
  8. "forum_index_title",
  9. "forum_index_meta_description",
  10. "forum_branding_display",
  11. "forum_branding_text",
  12. "email_footer",
  13. ]
  14. forum_name = forms.CharField(label=_("Forum name"), min_length=2, max_length=255)
  15. forum_index_title = forms.CharField(
  16. label=_("Title"),
  17. help_text=_("You may set a custom title on forum index by typing it here."),
  18. max_length=255,
  19. required=False,
  20. )
  21. forum_index_meta_description = forms.CharField(
  22. label=_("Meta Description"),
  23. help_text=_("Short description of your forum for internet crawlers."),
  24. max_length=255,
  25. required=False,
  26. )
  27. forum_branding_display = YesNoSwitch(
  28. label=_("Display branding"), help_text=_("Switch branding in forum's navbar.")
  29. )
  30. forum_branding_text = forms.CharField(
  31. label=_("Branding text"),
  32. help_text=_("Optional text displayed besides brand image in navbar."),
  33. max_length=255,
  34. required=False,
  35. )
  36. email_footer = forms.CharField(
  37. label=_("E-mails footer"),
  38. help_text=_(
  39. "Optional short message included at the end of e-mails sent by forum."
  40. ),
  41. max_length=255,
  42. required=False,
  43. )