0002_basic_settings.py 3.1 KB

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