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)
13 new_layout = request.EXPERIMENTS['layout']
15 rc = RequestContext(request)
17 left_column = Template(page.left_column).render(rc)
18 except TemplateSyntaxError:
22 right_column = Template(page.right_column).render(rc)
23 except TemplateSyntaxError:
28 'infopages/2022/infopage.html' if new_layout.value else 'infopages/infopage.html',
31 'left_column': left_column,
32 'right_column': right_column,
33 'active_menu_item': f'info:{slug}',