0001_initial.py 4.8 KB

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