fixtures.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
  2. from misago.utils import ugettext_lazy as _
  3. from misago.utils import get_msgid
  4. settings_fixtures = (
  5. # Avatars Settings
  6. ('avatars', {
  7. 'name': _("Users Avatars Settings"),
  8. 'description': _("Those settings allow you to control your users avatars."),
  9. 'settings': (
  10. ('avatars_types', {
  11. 'value': ['gravatar', 'gallery'],
  12. 'type': "array",
  13. 'input': "mlist",
  14. 'extra': {'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))]},
  15. 'separator': _("General Settings"),
  16. 'name': _("Allowed Avatars"),
  17. 'description': _("Select Avatar types allowed on your forum."),
  18. }),
  19. ('default_avatar', {
  20. 'value': "gravatar",
  21. 'type': "string",
  22. 'input': "select",
  23. 'extra': {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
  24. 'name': _("Default Avatar"),
  25. 'description': _("Default Avatar assigned to new members. If you creade directory and name it \"_default\", forum will select random avatar from that directory instead of regular gallery. If no avatar can be picked from gallery, Gravatar will be used."),
  26. }),
  27. ('upload_limit', {
  28. 'value': 128,
  29. 'type': "integer",
  30. 'input': "text",
  31. 'extra': {'min': 0},
  32. 'separator': _("Avatar Upload Settings"),
  33. 'name': _("Maxmimum size of uploaded file"),
  34. 'description': _("Select maximum allowed file size (in KB) for Avatar uploads."),
  35. }),
  36. ),
  37. }),
  38. )
  39. def load_fixtures():
  40. load_settings_fixture(settings_fixtures)
  41. def update_fixtures():
  42. update_settings_fixture(settings_fixtures)