]> git.openstreetmap.org Git - osqa.git/blob - forum/settings/static.py
Fixes OSQA 455. Multiple cross site scripting(XSS) vulnerabilities.
[osqa.git] / forum / settings / static.py
1 from base import Setting, SettingSet
2 from django.forms.widgets import Textarea, RadioSelect
3 from django.utils.translation import ugettext_lazy as _
4
5 STATIC_PAGE_REGISTRY = Setting('STATIC_PAGE_REGISTRY', {})
6
7 CSS_SET = SettingSet('css', 'Custom CSS', "Define some custom css you can use to override the default css.", 2000,
8                      can_preview=True)
9
10 USE_CUSTOM_CSS = Setting('USE_CUSTOM_CSS', False, CSS_SET, dict(
11         label = _("Use custom CSS"),
12         help_text = _("Do you want to use custom CSS."),
13         required=False))
14
15 CUSTOM_CSS = Setting('CUSTOM_CSS', '', CSS_SET, dict(
16         label = _("Custom CSS"),
17         help_text = _("Your custom CSS."),
18         widget=Textarea(attrs={'rows': '25'}),
19         required=False))
20
21 HEAD_AND_FOOT_SET = SettingSet('headandfoot', 'Header and Footer', "Adds a custom header and/or footer to your page",
22                                2000, can_preview=True)
23
24 USE_CUSTOM_HEADER = Setting('USE_CUSTOM_HEADER', False, HEAD_AND_FOOT_SET, dict(
25         label = _("Use custom header"),
26         help_text = _("Do you want to use a custom header."),
27         required=False))
28
29 CUSTOM_HEADER = Setting('CUSTOM_HEADER', '', HEAD_AND_FOOT_SET, dict(
30         label = _("Custom Header"),
31         help_text = _("Your custom header."),
32         widget=Textarea(attrs={'rows': '25'}),
33         required=False))
34
35 USE_ANNOUNCEMENT_BAR = Setting('USE_ANNOUNCEMENT_BAR', False, HEAD_AND_FOOT_SET, dict(
36         label = _("Show announcement bar"),
37         help_text = _("Some piece of content that goes under the search bar and can be used for announcements, etc."),
38         required=False))
39
40 ANNOUNCEMENT_BAR = Setting('ANNOUNCEMENT_BAR', '', HEAD_AND_FOOT_SET, dict(
41         label = _("Announcement bar"),
42         help_text = _("The announcement bar content."),
43         widget=Textarea(attrs={'rows': '25'}),
44         required=False))
45
46 USE_CUSTOM_FOOTER = Setting('USE_CUSTOM_FOOTER', False, HEAD_AND_FOOT_SET, dict(
47         label = _("Use custom footer"),
48         help_text = _("Do you want to use a custom footer."),
49         required=False))
50
51 CUSTOM_FOOTER = Setting('CUSTOM_FOOTER', '', HEAD_AND_FOOT_SET, dict(
52         label = _("Custom Footer"),
53         help_text = _("Your custom footer."),
54         widget=Textarea(attrs={'rows': '25'}),
55         required=False))
56
57 CUSTOM_FOOTER_MODE_CHOICES = (
58 ('replace', _('Replace default footer')),
59 ('above', _('Above default footer')),
60 ('below', _('Below default footer')),
61 )
62
63 CUSTOM_FOOTER_MODE = Setting('CUSTOM_FOOTER_MODE', 'replace', HEAD_AND_FOOT_SET, dict(
64         label = _("Custom Footer Mode"),
65         help_text = _("How your custom footer will appear."),
66         widget=RadioSelect,
67         choices=CUSTOM_FOOTER_MODE_CHOICES,
68         required=False))
69
70 HEAD_SET = SettingSet('head', '<head>', "Define some custom elements to include in the head section of every page.",
71                       2000, can_preview=True)
72
73 USE_CUSTOM_HEAD = Setting('USE_CUSTOM_HEAD', False, HEAD_SET, dict(
74         label = _("Use custom Head elements"),
75         help_text = _("Do you want to use custom head elements."),
76         required=False))
77
78 CUSTOM_HEAD = Setting('CUSTOM_HEAD', '', HEAD_SET, dict(
79         label = _("Custom Head"),
80         help_text = _("Your custom Head elements."),
81         widget=Textarea(attrs={'rows': '25'}),
82         required=False))