0001_initial.py 4.3 KB

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