0002_basic_settings.py 3.2 KB

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