0002_basic_settings.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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_basic_settings_group(apps, schema_editor):
  7. migrate_settings_group(
  8. apps, {
  9. 'key':
  10. 'basic',
  11. 'name':
  12. _("Basic forum settings"),
  13. 'description':
  14. _(
  15. "Those settings control most basic properties "
  16. "of your forum like its name or description."
  17. ),
  18. 'settings': [
  19. {
  20. 'setting': 'forum_name',
  21. 'name': _("Forum name"),
  22. 'legend': _("General"),
  23. 'value': "Misago",
  24. 'field_extra': {
  25. 'min_length': 2,
  26. 'max_length': 255
  27. },
  28. 'is_public': True,
  29. },
  30. {
  31. 'setting':
  32. 'forum_index_title',
  33. 'name':
  34. _("Index title"),
  35. 'description':
  36. _("You may set custon title on "
  37. "forum index by typing it here."),
  38. 'legend':
  39. _("Forum index"),
  40. 'field_extra': {
  41. 'max_length': 255
  42. },
  43. 'is_public':
  44. True,
  45. },
  46. {
  47. 'setting': 'forum_index_meta_description',
  48. 'name': _("Meta Description"),
  49. 'description': _("Short description of your forum "
  50. "for internet crawlers."),
  51. 'field_extra': {
  52. 'max_length': 255
  53. },
  54. },
  55. {
  56. 'setting': 'forum_branding_display',
  57. 'name': _("Display branding"),
  58. 'description': _("Switch branding in forum's navbar."),
  59. 'legend': _("Branding"),
  60. 'value': True,
  61. 'python_type': 'bool',
  62. 'form_field': 'yesno',
  63. 'is_public': True,
  64. },
  65. {
  66. 'setting': 'forum_branding_text',
  67. 'name': _("Branding text"),
  68. 'description': _("Optional text displayed besides "
  69. "brand image in navbar."),
  70. 'value': "Misago",
  71. 'field_extra': {
  72. 'max_length': 255
  73. },
  74. 'is_public': True,
  75. },
  76. {
  77. 'setting':
  78. 'email_footer',
  79. 'name':
  80. _("E-mails footer"),
  81. 'description':
  82. _(
  83. "Optional short message included "
  84. "at the end of e-mails sent by "
  85. "forum"
  86. ),
  87. 'legend':
  88. _("Forum e-mails"),
  89. 'field_extra': {
  90. 'max_length': 255
  91. },
  92. },
  93. ],
  94. }
  95. )
  96. class Migration(migrations.Migration):
  97. dependencies = [
  98. ('misago_core', '0001_initial'),
  99. ('misago_conf', '0001_initial'),
  100. ]
  101. operations = [
  102. migrations.RunPython(create_basic_settings_group),
  103. ]