]> git.openstreetmap.org Git - osqa.git/blob - forum_modules/OpenSearch/settings.py
moved opensearch into its own module and put it in the settings menu
[osqa.git] / forum_modules / OpenSearch / settings.py
1 from forum.settings.base import Setting, SettingSet
2 from django.forms.widgets import Textarea
3 from forum import settings as django_settings
4
5 OPEN_SEARCH_SET = SettingSet('OpenSearch', 'OpenSearch', "Set up the open_search.xml file.", 3000)
6
7 OPEN_SEARCH_FILE = Setting('OPEN_SEARCH_FILE',
8 ("""
9 <?xml version="1.0" encoding="UTF-8"?>
10  <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
11    <ShortName>%s Web Search</ShortName>
12    <Description>Use %s to search the Web.</Description>
13    <Tags>%s</Tags>
14    <Url type="application/rss+xml"
15         template="%s/?q={searchTerms}&pw={startPage?}"/>
16  </OpenSearchDescription>
17 """ % (django_settings.APP_SHORT_NAME, django_settings.APP_URL, django_settings.APP_KEYWORDS, django_settings.APP_URL)),
18 OPEN_SEARCH_SET,
19 dict(label = "open_search.xml file",
20      help_text = "The open_search.xml file.",
21      widget=Textarea(attrs={'rows': '20', 'cols' : '70'})))