1 from base import Setting, SettingSet
2 from django.forms.widgets import Textarea, RadioSelect, Select
3 from django.utils.translation import ugettext_lazy as _
6 ('markdown', _('Markdown')),
8 ('escape', _('Escaped'))
11 STATIC_PAGE_REGISTRY = Setting('STATIC_PAGE_REGISTRY', {})
13 CSS_SET = SettingSet('css', 'Custom CSS', "Define some custom css you can use to override the default css.", 2000,
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."),
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'}),
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)
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."),
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'}),
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),
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."),
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'}),
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),
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."),
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'}),
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),
81 CUSTOM_FOOTER_MODE_CHOICES = (
82 ('replace', _('Replace default footer')),
83 ('above', _('Above default footer')),
84 ('below', _('Below default footer')),
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."),
91 choices=CUSTOM_FOOTER_MODE_CHOICES,
94 HEAD_SET = SettingSet('head', '<head>', "Define some custom elements to include in the head section of every page.",
95 2000, can_preview=True)
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."),
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'}),