fixtures.py 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. from misago.monitor.fixtures import load_monitor_fixture
  2. from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
  3. from misago.utils import ugettext_lazy as _
  4. from misago.utils import get_msgid
  5. monitor_fixtures = {
  6. 'threads': 0,
  7. 'posts': 0,
  8. }
  9. settings_fixtures = (
  10. # Threads Settings
  11. ('threads', {
  12. 'name': _("Threads and Posts Settings"),
  13. 'description': _("Those settings control your forum's threads and posts."),
  14. 'settings': (
  15. ('thread_name_min', {
  16. 'value': 4,
  17. 'type': "integer",
  18. 'input': "text",
  19. 'extra': {'min': 1},
  20. 'separator': _("Threads"),
  21. 'name': _("Min. Thread Name Length"),
  22. 'description': _('Minimal allowed thread name length.'),
  23. 'position': 0,
  24. }),
  25. ('threads_per_page', {
  26. 'value': 40,
  27. 'type': "integer",
  28. 'input': "text",
  29. 'extra': {'min': 5},
  30. 'name': _("Threads per page"),
  31. 'description': _("Number of threads displayed on page in forum view."),
  32. 'position': 1,
  33. }),
  34. ('post_length_min', {
  35. 'value': 5,
  36. 'type': "integer",
  37. 'input': "text",
  38. 'extra': {'min': 5},
  39. 'separator': _("Posts"),
  40. 'name': _("Min. Post Length"),
  41. 'description': _("Minimal allowed post length."),
  42. 'position': 2,
  43. }),
  44. ('post_merge_time', {
  45. 'value': 5,
  46. 'type': "integer",
  47. 'input': "text",
  48. 'extra': {'min': 0},
  49. 'name': _("Automatic Post Merge timespan"),
  50. 'description': _("Forum can automatically merge member posts if interval between postings is shorter than specified number of minutes."),
  51. 'position': 3,
  52. }),
  53. ('posts_per_page', {
  54. 'value': 15,
  55. 'type': "integer",
  56. 'input': "text",
  57. 'extra': {'min': 5},
  58. 'name': _("Posts per page"),
  59. 'description': _("Number of posts per page in thread view."),
  60. 'position': 4,
  61. }),
  62. ('thread_length', {
  63. 'value': 300,
  64. 'type': "integer",
  65. 'input': "text",
  66. 'extra': {'min': 0},
  67. 'name': _("Thread Length Limit"),
  68. 'description': _('Long threads are hard to follow and search. You can force users to create few shorter threads instead of one long by setting thread lenght limits. Users with "Can close threads" permission will still be able to post in threads that have reached posts limit.'),
  69. 'position': 5,
  70. }),
  71. ),
  72. }),
  73. )
  74. def load_fixtures():
  75. load_monitor_fixture(monitor_fixtures)
  76. load_settings_fixture(settings_fixtures)
  77. def update_fixtures():
  78. update_settings_fixture(settings_fixtures)