0001_initial.py 4.8 KB

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