avatarssettings.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from misago.utils.fixtures import load_settings_fixture, update_settings_fixture
  2. from misago.utils.translation import ugettext_lazy as _
  3. settings_fixture = (
  4. # Avatars Settings
  5. ('avatars', {
  6. 'name': _("Users Avatars Settings"),
  7. 'description': _("Those settings allow you to control your users avatars."),
  8. 'settings': (
  9. ('avatars_types', {
  10. 'value': ('gravatar', 'gallery'),
  11. 'type': "array",
  12. 'input': "mlist",
  13. 'extra': {'choices': [('gravatar', _("Gravatar")), ('upload', _("Uploaded Avatar")), ('gallery', _("Avatars Gallery"))]},
  14. 'separator': _("General Settings"),
  15. 'name': _("Allowed Avatars"),
  16. 'description': _("Select Avatar types allowed on your forum."),
  17. }),
  18. ('default_avatar', {
  19. 'value': "gravatar",
  20. 'type': "string",
  21. 'input': "select",
  22. 'extra': {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
  23. 'name': _("Default Avatar"),
  24. '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."),
  25. }),
  26. ('upload_limit', {
  27. 'value': 128,
  28. 'type': "integer",
  29. 'input': "text",
  30. 'extra': {'min': 0},
  31. 'separator': _("Avatar Upload Settings"),
  32. 'name': _("Maxmimum size of uploaded file"),
  33. 'description': _("Select maximum allowed file size (in KB) for Avatar uploads."),
  34. }),
  35. ),
  36. }),
  37. )
  38. def load():
  39. load_settings_fixture(settings_fixture)
  40. def update():
  41. update_settings_fixture(settings_fixture)