0001_initial.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. from django.db import migrations
  2. from misago.conf.migrationutils import migrate_settings_group
  3. _ = lambda s: s
  4. def create_legal_settings_group(apps, schema_editor):
  5. migrate_settings_group(
  6. apps, {
  7. 'key': 'legal',
  8. 'name': _("Legal information"),
  9. 'description': _("Those settings allow you to set forum terms of service and privacy policy."),
  10. 'settings': [
  11. {
  12. 'setting': 'terms_of_service_title',
  13. 'name': _("Terms title"),
  14. 'legend': _("Terms of Service"),
  15. 'description': _("Leave this field empty to use default title."),
  16. 'value': "",
  17. 'field_extra': {
  18. 'max_length': 255,
  19. 'required': False,
  20. },
  21. 'is_public': True,
  22. },
  23. {
  24. 'setting': 'terms_of_service_link',
  25. 'name': _("Terms link"),
  26. 'description': _("If terms of service are located on other page, enter there its link."),
  27. 'value': "",
  28. 'field_extra': {
  29. 'max_length': 255,
  30. 'required': False,
  31. },
  32. 'is_public': True,
  33. },
  34. {
  35. 'setting': 'terms_of_service',
  36. 'name': _("Terms contents"),
  37. 'description': _(
  38. "Your forums can have custom terms of "
  39. "service page. To create it, write or "
  40. "paste here its contents. Full Misago "
  41. "markup is available for formatting."
  42. ),
  43. 'value': "",
  44. 'form_field': 'textarea',
  45. 'field_extra': {
  46. 'max_length': 128000,
  47. 'required': False,
  48. 'rows': 8,
  49. },
  50. 'is_public': True,
  51. 'is_lazy': True,
  52. },
  53. {
  54. 'setting': 'privacy_policy_title',
  55. 'name': _("Policy title"),
  56. 'legend': _("Privacy policy"),
  57. 'description': _("Leave this field empty to use default title."),
  58. 'value': "",
  59. 'field_extra': {
  60. 'max_length': 255,
  61. 'required': False,
  62. },
  63. 'is_public': True,
  64. },
  65. {
  66. 'setting': 'privacy_policy_link',
  67. 'name': _("Policy link"),
  68. 'description': _("If privacy policy is located on other page, enter there its link."),
  69. 'value': "",
  70. 'field_extra': {
  71. 'max_length': 255,
  72. 'required': False,
  73. },
  74. 'is_public': True,
  75. },
  76. {
  77. 'setting': 'privacy_policy',
  78. 'name': _("Policy contents"),
  79. 'description': _(
  80. "Your forums can have custom privacy "
  81. "policy page. To create it, write or "
  82. "paste here its contents. Full Misago "
  83. "markup is available for formatting."
  84. ),
  85. 'value': "",
  86. 'form_field': 'textarea',
  87. 'field_extra': {
  88. 'max_length': 128000,
  89. 'required': False,
  90. 'rows': 8,
  91. },
  92. 'is_public': True,
  93. 'is_lazy': True,
  94. },
  95. {
  96. 'setting': 'forum_footnote',
  97. 'name': _("Footnote"),
  98. 'description': _("Short message displayed in forum footer."),
  99. 'legend': _("Forum footer"),
  100. 'field_extra': {
  101. 'max_length': 300,
  102. },
  103. 'is_public': True,
  104. },
  105. ],
  106. }
  107. )
  108. class Migration(migrations.Migration):
  109. initial = True
  110. dependencies = [
  111. ('misago_conf', '0001_initial'),
  112. ]
  113. operations = [
  114. migrations.RunPython(create_legal_settings_group),
  115. ]