Exemple #1
0
    def get_main_html(self, request):
        """Return a chunk of html to be displayed in the main area of the
        admin index.  This is being called only if
        :meth:`get_main_action` returns `None`.  The default
        implementation renders the :xfile:`admin_main.html` template.

        """
        from lino.core import web
        return web.render_from_request(request, 'admin_main.html')
Exemple #2
0
def render_node(request, node, template_name='pages/node.html', **context):
    context.update(node=node)
    heading = dbutils.babelattr(node, 'title', '')
    if heading:
        context.update(heading=heading)
        context.update(title=heading + ' · ' + settings.SITE.title)
    else:
        context.update(heading=settings.SITE.title)
        context.update(title=settings.SITE.title)
    body = dbutils.babelattr(node, 'body', '')
    if not node.raw_html:
        body = restify(doc2rst(body))
    #~ logger.info("20121227 render_node %s -> body is %s",node,body)
    context.update(body=body)
    return web.render_from_request(request, template_name, **context)