use site.json

This commit is contained in:
j 2010-11-06 17:18:12 +01:00
parent aeaa875608
commit 75f6e3b2dc
4 changed files with 4 additions and 15 deletions

View file

@ -31,20 +31,10 @@ def api_getPage(request):
response = json_response({'name': page.name, 'body': page.body}) response = json_response({'name': page.name, 'body': page.body})
return render_to_json_response(response) return render_to_json_response(response)
return render_to_response('site.js', context, mimetype="application/javascript") def site_json(request):
def site_js(request):
pages = models.Page.objects.all()
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")
def pandora_json(request):
siteSettings = {} siteSettings = {}
for s in models.SiteSettings.objects.all(): for s in models.SiteSettings.objects.all():
siteSettings[s.key] = s.value siteSettings[s.key] = s.value
context = RequestContext(request, {'settings':settings, 'siteSettings': siteSettings}) context = RequestContext(request, {'settings':settings, 'siteSettings': siteSettings})
return render_to_response('pandora.json', context, mimetype="application/javascript") return render_to_response('site.json', context, mimetype="application/javascript")

View file

@ -17,8 +17,7 @@ def serve_static_file(path, location, content_type):
urlpatterns = patterns('', urlpatterns = patterns('',
(r'^ajax_filtered_fields/', include('ajax_filtered_fields.urls')), (r'^ajax_filtered_fields/', include('ajax_filtered_fields.urls')),
(r'^api/upload/$', 'archive.views.firefogg_upload'), (r'^api/upload/$', 'archive.views.firefogg_upload'),
(r'^site.js$', 'app.views.site_js'), (r'^site.json$', 'app.views.site_json'),
(r'^pandora.json$', 'app.views.pandora_json'),
(r'^$', 'app.views.intro'), (r'^$', 'app.views.intro'),
(r'^ra$', 'app.views.index'), (r'^ra$', 'app.views.index'),
(r'^timeline$', 'app.views.timeline'), (r'^timeline$', 'app.views.timeline'),

View file

@ -4,7 +4,7 @@
var app = new Ox.App({ var app = new Ox.App({
apiURL: '/api/', apiURL: '/api/',
config: '/pandora.json', config: '/site.json',
init: 'hello', init: 'hello',
}).launch(function(data) { }).launch(function(data) {
Ox.print('data', data) Ox.print('data', data)