1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. 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)
12 rc = RequestContext(request)
14 left_column = Template(page.left_column).render(rc)
15 except TemplateSyntaxError:
19 right_column = Template(page.right_column).render(rc)
20 except TemplateSyntaxError:
23 return render(request, 'infopages/infopage.html', {
25 'left_column': left_column,
26 'right_column': right_column,
27 'active_menu_item': f'info:{slug}',