0002_basic_settings.py 3.1 KB

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