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