1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from django.shortcuts import render, get_object_or_404
5 from django.template import RequestContext, Template, TemplateSyntaxError
7 from infopages.models import InfoPage
10 def infopage(request, slug):
11 page = get_object_or_404(InfoPage, slug=slug)
13 rc = RequestContext(request)
15 left_column = Template(page.left_column).render(rc)
16 except TemplateSyntaxError:
20 right_column = Template(page.right_column).render(rc)
21 except TemplateSyntaxError:
26 'infopages/infopage.html',
29 'left_column': left_column,
30 'right_column': right_column,
31 'active_menu_item': f'info:{slug}',