Ticket #8800: 8800.patch
File 8800.patch, 1.5 KB (added by , 16 years ago) |
---|
-
djangodocs/templatetags/docs.py
1 from django.core import urlresolvers 1 2 from django.template import Library 2 3 3 4 from djangodocs.forms import SearchForm … … 8 9 @register.inclusion_tag('docs/search_form.html', takes_context=True) 9 10 def search_form(context, search_form_id='search'): 10 11 request = context['request'] 12 13 search_url = context['search'] 14 __, __, search_kwargs = urlresolvers.resolve(search_url) 15 11 16 auto_id = 'id_%s_%%s' % search_form_id 12 17 return { 13 18 'form': SearchForm(initial=request.GET, auto_id=auto_id), 14 19 'search_form_id': search_form_id, 15 'action': context['search'],16 }17 No newline at end of file20 'action': search_url, 21 'lang': search_kwargs['lang'], 22 } -
djangodocs/templates/docs/search_form.html
9 9 {{ form.as_q }} 10 10 </div> 11 11 </form> 12 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form={{ search_form_id|escape }}&lang={{ lang|escape }}"></script> 13 No newline at end of file 12 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form={{ search_form_id|escape }}&lang={{ lang|escape }}"></script>