expose siteSettings

This commit is contained in:
j 2010-02-27 17:14:38 +05:30
parent 2e8676fc52
commit b5a16574b3

View file

@ -20,9 +20,11 @@ def api_getPage(request):
return render_to_json_response(response) return render_to_json_response(response)
return render_to_response('site.js', context, mimetype="application/javascript") return render_to_response('site.js', context, mimetype="application/javascript")
def site_js(request): def site_js(request):
pages = models.Page.objects.all() pages = models.Page.objects.all()
context = RequestContext(request, {'settings':settings, 'pages': pages}) siteSettings = {}
for s in models.SiteSettings.objects.all():
siteSettings[s.key] = s.value
context = RequestContext(request, {'settings':settings, 'pages': pages, 'siteSettings': siteSettings})
return render_to_response('site.js', context, mimetype="application/javascript") return render_to_response('site.js', context, mimetype="application/javascript")