0001_initial.py 4.5 KB

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