]> git.openstreetmap.org Git - osqa.git/blob - forum/settings/static.py
make {% comments %} template tag decoratable and add ability to attach additional...
[osqa.git] / forum / settings / static.py
1 from base import Setting, SettingSet
2 from django.forms.widgets import Textarea, RadioSelect, Select
3 from django.utils.translation import ugettext_lazy as _
4
5 RENDER_CHOICES = (
6 ('markdown', _('Markdown')),
7 ('html', _('HTML')),
8 ('escape', _('Escaped'))
9 )
10
11 STATIC_PAGE_REGISTRY = Setting('STATIC_PAGE_REGISTRY', {})
12
13 CSS_SET = SettingSet('css', 'Custom CSS', "Define some custom css you can use to override the default css.", 2000,
14                      can_preview=True)
15
16 USE_CUSTOM_CSS = Setting('USE_CUSTOM_CSS', False, CSS_SET, dict(
17         label = _("Use custom CSS"),
18         help_text = _("Do you want to use custom CSS."),
19         required=False))
20
21 CUSTOM_CSS = Setting('CUSTOM_CSS', '', CSS_SET, dict(
22         label = _("Custom CSS"),
23         help_text = _("Your custom CSS."),
24         widget=Textarea(attrs={'rows': '25'}),
25         required=False))
26
27 HEAD_AND_FOOT_SET = SettingSet('headandfoot', 'Header and Footer', "Adds a custom header and/or footer to your page",
28                                2000, can_preview=True)
29
30 USE_CUSTOM_HEADER = Setting('USE_CUSTOM_HEADER', False, HEAD_AND_FOOT_SET, dict(
31         label = _("Use custom header"),
32         help_text = _("Do you want to use a custom header."),
33         required=False))
34
35 CUSTOM_HEADER = Setting('CUSTOM_HEADER', '', HEAD_AND_FOOT_SET, dict(
36         label = _("Custom Header"),
37         help_text = _("Your custom header."),
38         widget=Textarea(attrs={'rows': '25'}),
39         required=False))
40
41 CUSTOM_HEADER_RENDER_MODE = Setting('CUSTOM_HEADER_RENDER_MODE', 'markdown', HEAD_AND_FOOT_SET, dict(
42         label = _("Custom Header rendering mode"),
43         help_text = _("How to render your custom header code."),
44         widget=Select(choices=RENDER_CHOICES),
45         required=False))
46
47 USE_ANNOUNCEMENT_BAR = Setting('USE_ANNOUNCEMENT_BAR', False, HEAD_AND_FOOT_SET, dict(
48         label = _("Show announcement bar"),
49         help_text = _("Some piece of content that goes under the search bar and can be used for announcements, etc."),
50         required=False))
51
52 ANNOUNCEMENT_BAR = Setting('ANNOUNCEMENT_BAR', '', HEAD_AND_FOOT_SET, dict(
53         label = _("Announcement bar"),
54         help_text = _("The announcement bar content."),
55         widget=Textarea(attrs={'rows': '25'}),
56         required=False))
57
58 ANNOUNCEMENT_BAR_RENDER_MODE = Setting('ANNOUNCEMENT_BAR_RENDER_MODE', 'markdown', HEAD_AND_FOOT_SET, dict(
59         label = _("Announcement bar rendering mode"),
60         help_text = _("How to render your announcement bar code."),
61         widget=Select(choices=RENDER_CHOICES),
62         required=False))
63
64 USE_CUSTOM_FOOTER = Setting('USE_CUSTOM_FOOTER', False, HEAD_AND_FOOT_SET, dict(
65         label = _("Use custom footer"),
66         help_text = _("Do you want to use a custom footer."),
67         required=False))
68
69 CUSTOM_FOOTER = Setting('CUSTOM_FOOTER', '', HEAD_AND_FOOT_SET, dict(
70         label = _("Custom Footer"),
71         help_text = _("Your custom footer."),
72         widget=Textarea(attrs={'rows': '25'}),
73         required=False))
74
75 CUSTOM_FOOTER_RENDER_MODE = Setting('CUSTOM_FOOTER_RENDER_MODE', 'markdown', HEAD_AND_FOOT_SET, dict(
76         label = _("Custom footer rendering mode"),
77         help_text = _("How to render your custom footer code."),
78         widget=Select(choices=RENDER_CHOICES),
79         required=False))
80
81 CUSTOM_FOOTER_MODE_CHOICES = (
82 ('replace', _('Replace default footer')),
83 ('above', _('Above default footer')),
84 ('below', _('Below default footer')),
85 )
86
87 CUSTOM_FOOTER_MODE = Setting('CUSTOM_FOOTER_MODE', 'replace', HEAD_AND_FOOT_SET, dict(
88         label = _("Custom Footer Mode"),
89         help_text = _("How your custom footer will appear."),
90         widget=RadioSelect,
91         choices=CUSTOM_FOOTER_MODE_CHOICES,
92         required=False))
93
94 HEAD_SET = SettingSet('head', '<head>', "Define some custom elements to include in the head section of every page.",
95                       2000, can_preview=True)
96
97 USE_CUSTOM_HEAD = Setting('USE_CUSTOM_HEAD', False, HEAD_SET, dict(
98         label = _("Use custom Head elements"),
99         help_text = _("Do you want to use custom head elements."),
100         required=False))
101
102 CUSTOM_HEAD = Setting('CUSTOM_HEAD', '', HEAD_SET, dict(
103         label = _("Custom Head"),
104         help_text = _("Your custom Head elements."),
105         widget=Textarea(attrs={'rows': '25'}),
106         required=False))