def render_cms(self): defaults = dict((node.uri.clone(version=None), node.initial) for node in pipeline.history.list('get')) return render_to_string( 'djedi/cms/embed.html', { 'json_nodes': json.dumps(defaults).replace('</', '\\x3C/'), })
def djedi_admin(context): output = u'' if has_permission(context.get('user')): defaults = dict((node.uri.clone(version=None), node.initial) for node in pipeline.history.list('get')) output = render_to_string('djedi/cms/embed.html', { 'json_nodes': json.dumps(defaults).replace('</', '\\x3C/'), }) # Clear pipeline pipeline.clear() return output
def render_cms(self): def get_requested_uri(node): # Get first namespace URI, remove any version and ensures extension. # TODO: Default extension fallback should be handled in content-io uri = node.namespace_uri uri = uri.clone( ext=uri.ext or settings.URI_DEFAULT_EXT, version=None, ) return uri defaults = dict((get_requested_uri(node), node.initial) for node in pipeline.history.list('get')) return render_to_string( 'djedi/cms/embed.html', { 'json_nodes': json.dumps(defaults).replace('</', '\\x3C/'), })
def render_cms(self): def get_requested_uri(node): # Get first namespace URI, remove any version and ensures extension. # TODO: Default extension fallback should be handled in content-io uri = node.namespace_uri uri = uri.clone( ext=uri.ext or settings.URI_DEFAULT_EXT, version=None, ) return uri defaults = dict( (get_requested_uri(node), node.initial) for node in pipeline.history.list('get') ) return render_to_string('djedi/cms/embed.html', { 'json_nodes': json.dumps(defaults).replace('</', '\\x3C/'), })
def render_cms(self): defaults = dict((node.uri.clone(version=None), node.initial) for node in pipeline.history.list('get')) return render_to_string('djedi/cms/embed.html', { 'json_nodes': json.dumps(defaults).replace('</', '\\x3C/'), })