aboutsummaryrefslogtreecommitdiff
path: root/dicoweb/templates
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2010-05-23 19:55:06 +0200
committerWojciech Polak <polak@gnu.org>2010-05-23 19:55:06 +0200
commitceeec5623dbf19d8c96cd1187c5f17ed362cb5fe (patch)
treeb50fa6b76b485e4ce160e9c3fa164d798844dbe5 /dicoweb/templates
parent051fe63429801418e1c061e1b6a6f41c0470f68b (diff)
downloaddico-ceeec5623dbf19d8c96cd1187c5f17ed362cb5fe.tar.gz
dico-ceeec5623dbf19d8c96cd1187c5f17ed362cb5fe.tar.bz2
Improve Dicoweb.
* dicoweb/dicoclient/dicoclient.py (define): Allow for empty descriptions in response. * dicoweb/static/opensearch.xml: Move to templates and make it dynamic. * dicoweb/views.py (opensearch): Add view.
Diffstat (limited to 'dicoweb/templates')
-rw-r--r--dicoweb/templates/base.html2
-rw-r--r--dicoweb/templates/index.html2
-rw-r--r--dicoweb/templates/opensearch.xml8
3 files changed, 10 insertions, 2 deletions
diff --git a/dicoweb/templates/base.html b/dicoweb/templates/base.html
index 4b6e08e..33e4491 100644
--- a/dicoweb/templates/base.html
+++ b/dicoweb/templates/base.html
@@ -8,7 +8,7 @@
<meta name="keywords" content="gnu dico web search interface, dicoweb, dictionaries, dict protocol" />
<meta name="description" content="GNU Dico WebSearch Interface" />
<link rel="stylesheet" type="text/css" href="{% media_prefix %}/dicoweb.css" />
-<link rel="search" type="application/opensearchdescription+xml" title="GNU Dico WebSearch" href="{% media_prefix %}/opensearch.xml" />
+<link rel="search" type="application/opensearchdescription+xml" title="GNU Dico WebSearch" href="{% url opensearch %}" />
<script type="text/javascript" src="{% media_prefix %}/dicoweb.js"></script>
</head>
diff --git a/dicoweb/templates/index.html b/dicoweb/templates/index.html
index 1b92bc8..10c8830 100644
--- a/dicoweb/templates/index.html
+++ b/dicoweb/templates/index.html
@@ -76,7 +76,7 @@
</h3>
{% for df in result.definitions %}
<pre>
- {% trans "From" %} <a href="?q={{ df.db|urlencode }}&amp;db=dbinfo">{{ df.db_fullname }}</a>:
+ {% trans "From" %} <a href="?q={{ df.db|urlencode }}&amp;db=dbinfo">{% firstof df.db_fullname df.db %}</a>:
<br /><br />
{% if df.format_html %}
{{ df.desc|safe }}
diff --git a/dicoweb/templates/opensearch.xml b/dicoweb/templates/opensearch.xml
new file mode 100644
index 0000000..70e52de
--- /dev/null
+++ b/dicoweb/templates/opensearch.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+ <ShortName>GNU Dico WebSearch</ShortName>
+ <Description>GNU Dico WebSearch Interface</Description>
+ <Url type="text/html" method="get" template="{{ url_query }}?q={searchTerms}"/>
+ <InputEncoding>UTF-8</InputEncoding>
+ <Image width="16" height="16">{{ url_media }}/favicon.ico</Image>
+</OpenSearchDescription>

Return to:

Send suggestions and report system problems to the System administrator.