forms.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from django import forms
  2. from django.utils.translation import ugettext_lazy as _
  3. from misago.timezones import tzlist
  4. from misago.forms import Form
  5. class UserForumOptionsForm(Form):
  6. newsletters = forms.BooleanField(required=False)
  7. timezone = forms.ChoiceField(choices=tzlist())
  8. hide_activity = forms.ChoiceField(choices=(
  9. (0, _("Show my presence to everyone")),
  10. (1, _("Show my presence to people I follow")),
  11. (2, _("Show my presence to nobody")),
  12. ))
  13. subscribe_start = forms.ChoiceField(choices=(
  14. (0, _("Don't watch")),
  15. (1, _("Put on watched threads list")),
  16. (2, _("Put on watched threads list and e-mail me when somebody replies")),
  17. ))
  18. subscribe_reply = forms.ChoiceField(choices=(
  19. (0, _("Don't watch")),
  20. (1, _("Put on watched threads list")),
  21. (2, _("Put on watched threads list and e-mail me when somebody replies")),
  22. ))
  23. layout = (
  24. (
  25. _("Forum Options"),
  26. (
  27. ('hide_activity', {'label': _("Your Visibility"), 'help_text': _("If you want to, you can limit other members ability to track your presence on forums.")}),
  28. ('timezone', {'label': _("Your Current Timezone"), 'help_text': _("If dates and hours displayed by forums are inaccurate, you can fix it by adjusting timezone setting.")}),
  29. ('newsletters', {'label': _("Newsletters"), 'help_text': _("On occasion board administrator may want to send e-mail message to multiple members."), 'inline': _("Yes, I want to subscribe forum newsletter")}),
  30. )
  31. ),
  32. (
  33. _("Watching Threads"),
  34. (
  35. ('subscribe_start', {'label': _("Threads I start")}),
  36. ('subscribe_reply', {'label': _("Threads I reply to")}),
  37. )
  38. ),
  39. )