From dabbc37252cdcd0a58a8fa1e11569850ce2bc170 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 15 Jan 2012 21:14:41 +0530 Subject: [PATCH] implement noscript site pages --- pandora/app/views.py | 14 ++++++++++++++ pandora/templates/index.html | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pandora/app/views.py b/pandora/app/views.py index ec0460cf..b2995623 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -24,9 +24,23 @@ def intro(request): return render_to_response('intro.html', context) def index(request): + title = settings.SITENAME + text = settings.CONFIG['site']['description'] + page = request.path.split('/') + if len(page) == 2: + page = page[1] + else: + page = '' + for p in settings.CONFIG['sitePages']: + if p['id'] == page: + title += ' - ' + p['title'] + text, created = models.Page.objects.get_or_create(name=page) + text = text.body context = RequestContext(request, { 'base_url': request.build_absolute_uri('/'), 'settings': settings, + 'text': text, + 'title': title, }) return render_to_response('index.html', context) diff --git a/pandora/templates/index.html b/pandora/templates/index.html index feb6d32c..a4bb0ce8 100644 --- a/pandora/templates/index.html +++ b/pandora/templates/index.html @@ -2,7 +2,7 @@
-