rankingsettings.py 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. # Users Ranking Settings
  5. ('ranking', {
  6. 'name': _("Members Ranking"),
  7. 'description': _("Those settings control mechanisms of members activity ranking which allows you to gamificate your forum."),
  8. 'settings': (
  9. ('ranking_inflation', {
  10. 'value': 5,
  11. 'type': "integer",
  12. 'input': "text",
  13. 'extra': {'min': 0, 'max': 99},
  14. 'separator': _("Basic Ranking Settings"),
  15. 'name': _("Ranking Inflation"),
  16. 'description': _("Enter size of ranking scores inflation in percent. Scores inflation is important mechanism that allows ranking self-regulation, punishing inactivity and requiring users to remain active in order to remain high in ranking."),
  17. }),
  18. ('ranking_positions_visible', {
  19. 'value': True,
  20. 'type': "boolean",
  21. 'input': "yesno",
  22. 'name': _("Don't Keep Users Ranking Positions Secret"),
  23. 'description': _("Changing this to yes will cause forum to display user position in ranking on his profile page."),
  24. }),
  25. ('ranking_scores_visible', {
  26. 'value': True,
  27. 'type': "boolean",
  28. 'input': "yesno",
  29. 'name': _("Don't Keep Users Scores Secret"),
  30. 'description': _("Changing this to yes will cause forum to display user score on his profile page."),
  31. }),
  32. ('score_reward_new_thread', {
  33. 'value': 50,
  34. 'type': "integer",
  35. 'input': "text",
  36. 'separator': _("Posting Rewards"),
  37. 'name': _("New Thread Reward"),
  38. 'description': _("Score user will receive (or lose) whenever he posts new thread."),
  39. }),
  40. ('score_reward_new_post', {
  41. 'value': 100,
  42. 'type': "integer",
  43. 'input': "text",
  44. 'name': _("New Reply Reward"),
  45. 'description': _("Score user will receive (or lose) whenever he posts new reply in thread."),
  46. }),
  47. ('score_reward_new_post_cooldown', {
  48. 'value': 180,
  49. 'type': "integer",
  50. 'input': "text",
  51. 'extra': {'min': 0},
  52. 'name': _("Reward Cooldown"),
  53. 'description': _("Minimal time (in seconds) that has to pass between postings for new message to receive karma vote. This is useful to combat flood."),
  54. }),
  55. ('score_reward_karma_positive', {
  56. 'value': 20,
  57. 'type': "integer",
  58. 'input': "text",
  59. 'extra': {'min': 0},
  60. 'separator': _("Karma System"),
  61. 'name': _("Upvote Reward"),
  62. 'description': _("Score user will receive every time his post receives upvote."),
  63. }),
  64. ('score_reward_karma_negative', {
  65. 'value': 10,
  66. 'type': "integer",
  67. 'input': "text",
  68. 'extra': {'min': 0},
  69. 'name': _("Downvote Punishment"),
  70. 'description': _("Score user will lose every time his post receives downvote."),
  71. }),
  72. ),
  73. }),
  74. )
  75. def load():
  76. load_settings_fixture(settings_fixture)
  77. def update():
  78. update_settings_fixture(settings_fixture)