Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save cacheleocode/d02ad3e4cfd438cfd00e to your computer and use it in GitHub Desktop.

Select an option

Save cacheleocode/d02ad3e4cfd438cfd00e to your computer and use it in GitHub Desktop.
old dn search
<form action="/{{ lang }}/search/" id="sitesearch" class="search">
<div>
<input type="hidden" name="cx" value="{{ GOOGLE_SEARCH_PASSWORD }}" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="hl" value="" />
<input id="id_search_q" type="text" class="query" value="" name="q"
/><input type="submit" name="sa" class="submit" value="{% trans "Search" %}" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=sitesearch&amp;lang={{ lang }}"></script>
<form action="/{{ lang }}/search/" id="search" class="search">
<h1>{% trans "Search" %}</h1>
<div>
<input type="hidden" name="cx" value="{{ GOOGLE_SEARCH_PASSWORD }}" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="hl" value="" />
<input id="id_search_q" type="text" class="query" value="" name="q" />
<input type="submit" name="sa" class="submit" value="{% trans "Search" %}" />
<br/>
{% ifnotequal LANG "en" %}<a href="/en/search/">English</a> &nbsp; {% endifnotequal %}
{% ifnotequal LANG "ja" %}<a href="/ja/search/">日本語</a> &nbsp; {% endifnotequal %}
{% ifnotequal LANG "es" %}<a href="/es/search/">Español</a> &nbsp; {% endifnotequal %}
{% ifnotequal LANG "pt" %}<a href="/pt/search/">Português</a> &nbsp; {% endifnotequal %}
</div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search&amp;lang={{ lang }}"></script>
<div id="cse-search-results">
{% if search_results %}<h1>{% trans "Search results" %}</h1>{% endif %}
<div id="cse-search-results-js-required">
The Django documentation search uses a Google Custom Search, which requires Javascript.
If your results don't appear here shortly, please
<a href="http://www.google.com/cse?q=&amp;cx={{ GOOGLE_SEARCH_PASSWORD }}&amp;hl=&amp;as_q=more%3Adev_docs&amp;sa=Search&amp;ie=UTF-8">view the results on Google's site</a>.
</div>
</div>
<script type="text/javascript">
var googleSearchMessage = document.getElementById("cse-search-results-js-required");
googleSearchMessage.parentNode.removeChild(googleSearchMessage);
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment