0001_initial.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  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. },
  27. {
  28. 'setting': 'terms_of_service_link',
  29. 'name': _("Terms link"),
  30. 'description': _("If terms of service are located "
  31. "on other page, enter there its link."),
  32. 'value': "",
  33. 'field_extra': {
  34. 'max_length': 255,
  35. 'required': False,
  36. },
  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_lazy': True,
  53. },
  54. {
  55. 'setting': 'privacy_policy_title',
  56. 'name': _("Policy title"),
  57. 'legend': _("Privacy policy"),
  58. 'description': _("Leave this field empty to "
  59. "use default title."),
  60. 'value': "",
  61. 'field_extra': {
  62. 'max_length': 255,
  63. 'required': False,
  64. },
  65. },
  66. {
  67. 'setting': 'privacy_policy_link',
  68. 'name': _("Policy link"),
  69. 'description': _("If privacy policy is located on "
  70. "other page, enter there its link."),
  71. 'value': "",
  72. 'field_extra': {
  73. 'max_length': 255,
  74. 'required': False,
  75. },
  76. },
  77. {
  78. 'setting': 'privacy_policy',
  79. 'name': _("Policy contents"),
  80. 'description': _("Your forums can have custom privacy "
  81. "policy page. To create it, write or "
  82. "paste here its contents. Full Misago "
  83. "markup is available for formatting."),
  84. 'value': "",
  85. 'form_field': 'textarea',
  86. 'field_extra': {
  87. 'max_length': 128000,
  88. 'required': False,
  89. 'rows': 8,
  90. },
  91. 'is_lazy': True,
  92. },
  93. )
  94. })
  95. class Migration(migrations.Migration):
  96. dependencies = [
  97. ('misago_conf', '0001_initial'),
  98. ]
  99. operations = [
  100. migrations.RunPython(create_legal_settings_group),
  101. ]