]> git.openstreetmap.org Git - osqa.git/blob - forum/settings/users.py
Adds optional status diamonds next to the usernames.
[osqa.git] / forum / settings / users.py
1 from forms import CommaStringListWidget
2 from django.forms import CheckboxSelectMultiple
3 from base import Setting, SettingSet
4 from django.utils.translation import ugettext as _
5
6 USERS_SET = SettingSet('users', _('Users settings'), _("General settings for the OSQA users."), 20)
7
8 EDITABLE_SCREEN_NAME = Setting('EDITABLE_SCREEN_NAME', False, USERS_SET, dict(
9 label = _("Editable screen name"),
10 help_text = _("Allow users to alter their screen name."),
11 required=False))
12
13 MIN_USERNAME_LENGTH = Setting('MIN_USERNAME_LENGTH', 3, USERS_SET, dict(
14 label = _("Minimum username length"),
15 help_text = _("The minimum length (in character) of a username.")))
16
17 RESERVED_USERNAMES = Setting('RESERVED_USERNAMES',
18 [_('fuck'), _('shit'), _('ass'), _('sex'), _('add'), _('edit'), _('save'), _('delete'), _('manage'), _('update'), _('remove'), _('new')]
19 , USERS_SET, dict(
20 label = _("Disabled usernames"),
21 help_text = _("A comma separated list of disabled usernames (usernames not allowed during a new user registration)."),
22 widget=CommaStringListWidget))
23
24 SHOW_STATUS_DIAMONDS = Setting('SHOW_STATUS_DIAMONDS', True, USERS_SET, dict(
25 label=_("Show status diamonds"),
26 help_text = _("Show status \"diamonds\" next to moderators or superusers usernames.")
27 ))
28
29 EMAIL_UNIQUE = Setting('EMAIL_UNIQUE', True, USERS_SET, dict(
30 label = _("Force unique email"),
31 help_text = _("Should each user have an unique email.")))
32
33 REQUIRE_EMAIL_VALIDATION_TO = Setting('REQUIRE_EMAIL_VALIDATION_TO', [], USERS_SET, dict(
34 label = _("Require email validation to..."),
35 help_text = _("Which actions in this site, users without a valid email will be prevented from doing."),
36 widget=CheckboxSelectMultiple,
37 choices=(("ask", _("ask questions")), ("answer", _("provide answers")), ("comment", _("make comments")), ("flag", _("report posts"))),
38 required=False,
39 ))
40
41 HOLD_PENDING_POSTS_MINUTES = Setting('HOLD_PENDING_POSTS_MINUTES', 120, USERS_SET, dict(
42 label=_("Hold pending posts for X minutes"),
43 help_text=_("How much time in minutes a post should be kept in session until the user logs in or validates the email.")
44 ))
45
46 WARN_PENDING_POSTS_MINUTES = Setting('WARN_PENDING_POSTS_MINUTES', 15, USERS_SET, dict(
47 label=_("Warn about pending posts afer X minutes"),
48 help_text=_("How much time in minutes a user that just logged in or validated his email should be warned about a pending post instead of publishing it automatically.")
49 ))
50