0001_initial.py 4.6 KB

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