0001_initial.py 4.0 KB

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