0002_basic_settings.py 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. from django.utils.translation import ugettext as _
  5. from misago.conf.migrationutils import migrate_settings_group
  6. def create_basic_settings_group(apps, schema_editor):
  7. migrate_settings_group(
  8. apps,
  9. {
  10. 'key': 'basic',
  11. 'name': _("Basic forum settings"),
  12. 'description': _("Those settings control most basic properties "
  13. "of your forum like its name or description."),
  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 "
  30. "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 "
  41. "for internet crawlers."),
  42. 'field_extra': {
  43. 'max_length': 255
  44. },
  45. },
  46. {
  47. 'setting': 'forum_branding_display',
  48. 'name': _("Display branding"),
  49. 'description': _("Switch branding in forum's navbar."),
  50. 'legend': _("Branding"),
  51. 'value': True,
  52. 'python_type': 'bool',
  53. 'form_field': 'yesno',
  54. 'is_public': True,
  55. },
  56. {
  57. 'setting': 'forum_branding_text',
  58. 'name': _("Branding text"),
  59. 'description': _("Optional text displayed besides "
  60. "brand image in navbar."),
  61. 'value': "isago",
  62. 'field_extra': {
  63. 'max_length': 255
  64. },
  65. 'is_public': True,
  66. },
  67. {
  68. 'setting': 'email_footer',
  69. 'name': _("E-mails footer"),
  70. 'description': _("Optional short message included "
  71. "at the end of e-mails sent by "
  72. "forum"),
  73. 'legend': _("Forum e-mails"),
  74. 'field_extra': {
  75. 'max_length': 255
  76. },
  77. },
  78. )
  79. })
  80. class Migration(migrations.Migration):
  81. dependencies = [
  82. ('misago_core', '0001_initial'),
  83. ('misago_conf', '0001_initial'),
  84. ]
  85. operations = [
  86. migrations.RunPython(create_basic_settings_group),
  87. ]