def search_pages(request): adv_search_form = forms.AdvSearchPagesForm() search_form = forms.SearchPagesForm() page_title = 'Search Newspaper Pages' return render_to_response('search_pages.html', dictionary=locals(), context_instance=RequestContext(request))
def tabs(request, date=None): params = request.GET if request.GET else None form = forms.SearchPagesForm(params) adv_form = forms.AdvSearchPagesForm(params) context = {"search_form": form, "adv_search_form": adv_form} context.update(get_newspaper_info()) return TemplateResponse(request, "includes/tabs.html", context)
def tabs(request, date=None): params = request.GET if request.GET else None form = forms.SearchPagesForm(params) adv_form = forms.AdvSearchPagesForm(params) context = RequestContext(request, { 'search_form': form, 'adv_search_form': adv_form }) template = get_template("includes/tabs.html") return HttpResponse(content=template.render(context))
def home(request, date=None): context = RequestContext(request, {}) #context["crumbs"] = list(settings.BASE_CRUMBS) today = datetime.date.today() context["date"] = date = today.replace(year=today.year - 100) context["pages"] = pages = _frontpages(request, date) #search_form = forms.SearchPagesForm() context["search_form"] = forms.SearchPagesForm() template = get_template("home.html") # note the date is handled on the client side in javascript return HttpResponse(content=template.render(context))