0001_initial.py 4.5 KB

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