0001_initial.py 5.3 KB

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