0001_initial.py 4.6 KB

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