momo: generate footer (#8807)

This commit is contained in:
Frédéric Péters 2015-10-28 13:42:28 +01:00
parent 314793d71d
commit 1cb6e7cfcb
1 changed files with 14 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class MomoManagerView(TemplateView):
def get_page_dict(request, page, manifest):
cells = CellBase.get_cells(page_id=page.id)
cells = [x for x in CellBase.get_cells(page_id=page.id) if x.placeholder != 'footer']
page_dict = {
'title': page.title,
@ -149,6 +149,19 @@ def generate(request, **kwargs):
homepage._children = children
manifest.update(get_page_dict(request, homepage, manifest))
# footer
footer_cells = CellBase.get_cells(page_id=homepage.id, placeholder='footer')
if footer_cells:
context = RequestContext(request, {
'synchronous': True,
'page': homepage,
'page_cells': footer_cells,
'request': request,
'site_base': request.build_absolute_uri('/')[:-1],
})
manifest['footer'] = '\n'.join([
'<div id="footer-%s">%s</div>' % (cell.slug, cell.render(context)) for cell in footer_cells])
# construct the application menu
manifest['menu'].append('home') # link to home screen