0002_basic_settings.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. {
  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": {"min_length": 2, "max_length": 255},
  21. "is_public": True,
  22. },
  23. {
  24. "setting": "forum_index_title",
  25. "name": _("Index title"),
  26. "description": _(
  27. "You may set custon title on forum index by typing it here."
  28. ),
  29. "legend": _("Forum index"),
  30. "field_extra": {"max_length": 255},
  31. "is_public": True,
  32. },
  33. {
  34. "setting": "forum_index_meta_description",
  35. "name": _("Meta Description"),
  36. "description": _(
  37. "Short description of your forum for internet crawlers."
  38. ),
  39. "field_extra": {"max_length": 255},
  40. },
  41. {
  42. "setting": "forum_branding_display",
  43. "name": _("Display branding"),
  44. "description": _("Switch branding in forum's navbar."),
  45. "legend": _("Branding"),
  46. "value": True,
  47. "python_type": "bool",
  48. "form_field": "yesno",
  49. "is_public": True,
  50. },
  51. {
  52. "setting": "forum_branding_text",
  53. "name": _("Branding text"),
  54. "description": _(
  55. "Optional text displayed besides brand image in navbar."
  56. ),
  57. "value": "Misago",
  58. "field_extra": {"max_length": 255},
  59. "is_public": True,
  60. },
  61. {
  62. "setting": "email_footer",
  63. "name": _("E-mails footer"),
  64. "description": _(
  65. "Optional short message included at the end of e-mails sent by forum."
  66. ),
  67. "legend": _("Forum e-mails"),
  68. "field_extra": {"max_length": 255},
  69. },
  70. ],
  71. },
  72. )
  73. class Migration(migrations.Migration):
  74. dependencies = [("misago_core", "0001_initial"), ("misago_conf", "0001_initial")]
  75. operations = [migrations.RunPython(create_basic_settings_group)]