0002_basic_settings.py 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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(apps, {
  8. 'key': 'basic',
  9. 'name': _("Basic forum settings"),
  10. 'description': _("Those settings control most basic properties "
  11. "of your forum like its name or description."),
  12. 'settings': (
  13. {
  14. 'setting': 'forum_name',
  15. 'name': _("Forum name"),
  16. 'legend': _("General"),
  17. 'value': "Misago",
  18. 'field_extra': {
  19. 'min_length': 2,
  20. 'max_length': 255
  21. },
  22. 'is_public': True,
  23. },
  24. {
  25. 'setting': 'forum_index_title',
  26. 'name': _("Index title"),
  27. 'description': _("You may set custon title on "
  28. "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 "
  39. "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 "
  58. "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 "
  69. "at the end of e-mails sent by "
  70. "forum"),
  71. 'legend': _("Forum e-mails"),
  72. 'field_extra': {
  73. 'max_length': 255
  74. },
  75. },
  76. )
  77. })
  78. class Migration(migrations.Migration):
  79. dependencies = [
  80. ('misago_core', '0001_initial'),
  81. ('misago_conf', '0001_initial'),
  82. ]
  83. operations = [
  84. migrations.RunPython(create_basic_settings_group),
  85. ]