From 75f6e3b2dcfb6f5e656798fbe4ce95c2d3d7866c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 6 Nov 2010 17:18:12 +0100 Subject: [PATCH] use site.json --- pandora/app/views.py | 14 ++------------ pandora/templates/{pandora.json => site.json} | 0 pandora/urls.py | 3 +-- static/js/pandora.js | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) rename pandora/templates/{pandora.json => site.json} (100%) diff --git a/pandora/app/views.py b/pandora/app/views.py index c4c090a6..5cd2e0b1 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -31,20 +31,10 @@ def api_getPage(request): response = json_response({'name': page.name, 'body': page.body}) return render_to_json_response(response) - return render_to_response('site.js', context, mimetype="application/javascript") - -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): +def site_json(request): siteSettings = {} for s in models.SiteSettings.objects.all(): siteSettings[s.key] = s.value 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") diff --git a/pandora/templates/pandora.json b/pandora/templates/site.json similarity index 100% rename from pandora/templates/pandora.json rename to pandora/templates/site.json diff --git a/pandora/urls.py b/pandora/urls.py index 489d84dc..2065b75a 100644 --- a/pandora/urls.py +++ b/pandora/urls.py @@ -17,8 +17,7 @@ def serve_static_file(path, location, content_type): urlpatterns = patterns('', (r'^ajax_filtered_fields/', include('ajax_filtered_fields.urls')), (r'^api/upload/$', 'archive.views.firefogg_upload'), - (r'^site.js$', 'app.views.site_js'), - (r'^pandora.json$', 'app.views.pandora_json'), + (r'^site.json$', 'app.views.site_json'), (r'^$', 'app.views.intro'), (r'^ra$', 'app.views.index'), (r'^timeline$', 'app.views.timeline'), diff --git a/static/js/pandora.js b/static/js/pandora.js index 78ca9303..a412b64d 100755 --- a/static/js/pandora.js +++ b/static/js/pandora.js @@ -4,7 +4,7 @@ var app = new Ox.App({ apiURL: '/api/', - config: '/pandora.json', + config: '/site.json', init: 'hello', }).launch(function(data) { Ox.print('data', data)