forms.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import floppyforms as forms
  2. from django.utils.translation import ugettext_lazy as _
  3. from misago.forms import Form
  4. from misago.utils.timezones import tzlist
  5. class UserForumOptionsForm(Form):
  6. newsletters = forms.BooleanField(label=_("Newsletters"),
  7. help_text=_("On occasion board administrator may want to send e-mail message to multiple members."),
  8. required=False)
  9. timezone = forms.ChoiceField(label=_("Your Current Timezone"),
  10. help_text=_("If dates and hours displayed by forums are inaccurate, you can fix it by adjusting timezone setting."),
  11. choices=tzlist())
  12. hide_activity = forms.TypedChoiceField(label=_("Your Visibility"),
  13. help_text=_("If you want to, you can limit other members ability to track your presence on forums."),
  14. choices=(
  15. (0, _("Show my presence to everyone")),
  16. (1, _("Show my presence to people I follow")),
  17. (2, _("Show my presence to nobody")),
  18. ), coerce=int)
  19. subscribe_start = forms.TypedChoiceField(label=_("Threads I start"),
  20. choices=(
  21. (0, _("Don't watch")),
  22. (1, _("Put on watched threads list")),
  23. (2, _("Put on watched threads list and e-mail me when somebody replies")),
  24. ), coerce=int)
  25. subscribe_reply = forms.TypedChoiceField(label=_("Threads I reply to"),
  26. choices=(
  27. (0, _("Don't watch")),
  28. (1, _("Put on watched threads list")),
  29. (2, _("Put on watched threads list and e-mail me when somebody replies")),
  30. ), coerce=int)
  31. allow_pds = forms.TypedChoiceField(label=_("Allow Private Threads Invitations"),
  32. help_text=_("If you wish, you can restrict who can invite you to private threads. Keep in mind some groups or members may be allowed to override this preference."),
  33. choices=(
  34. (0, _("From everyone")),
  35. (1, _("From everyone but not members I ignore")),
  36. (2, _("From members I follow")),
  37. (2, _("From nobody")),
  38. ), coerce=int)