Skip to content

Commit

Permalink
fix #30: disable the search box when javascript isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Boissinot committed Jan 4, 2009
1 parent 32f6af6 commit 2cdaa24
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
21 changes: 13 additions & 8 deletions sphinx/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,19 @@ <h3>{{ _('This Page') }}</h3>
{% include customsidebar %}
{%- endif %}
{%- block sidebarsearch %}
{%- if pagename != "search" %}
<h3>{{ _('Quick search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p>
{%- if pagename != "search" %}
<div id="searchbox" style="display: none">
<h3>{{ _('Quick search') }}</h3>
<form class="search" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" size="18" /> <input type="submit" value="{{ _('Go') }}" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p style="font-size: 90%">{{ _('Enter search terms or a module, class or function name.') }}</p>
</div>
<script type="text/javascript">
$(function () { $('#searchbox').show(0); });
</script>
{%- endif %}
{%- endblock %}
</div>
Expand Down
6 changes: 6 additions & 0 deletions sphinx/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% block body %}
<h1 id="search-documentation">{{ _('Search') }}</h1>
<div id ="fallback" class="admonition warning">
<script type="text/javascript">$('#fallback').hide();</script>
<p>
{% trans %}Please activate Javascript to enable the search functionality.{% endtrans %}
</p>
</div>
<p>
{% trans %}From here you can search these documents. Enter your search
words into the box below and click "search". Note that the search
Expand Down

0 comments on commit 2cdaa24

Please sign in to comment.