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"),
  29. help_text=_("Switch branding in forum's navbar."),
  30. )
  31. forum_branding_text = forms.CharField(
  32. label=_("Branding text"),
  33. help_text=_("Optional text displayed besides brand image in navbar."),
  34. max_length=255,
  35. required=False,
  36. )
  37. email_footer = forms.CharField(
  38. label=_("E-mails footer"),
  39. help_text=_("Optional short message included at the end of e-mails sent by forum."),
  40. max_length=255,
  41. required=False,
  42. )