0002_basic_settings.py 3.1 KB

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