$def with (resource) $ path = tx.request.uri.path $ owner = tx.host.owner $def render_breadcrumbs(breadcrumbs, separator="▸", padding=" "): $ """ $ Render a `separator` delimited list of linkified `breadcrumbs`. $ $ `breadcrumbs` should be a single tuple that will be read two items at a time: $ $ ("path", "Name", "subpath", "Subname", ...) $ $ """ $ remaining = int(len(breadcrumbs) / 2) $ path = "" $for crumb_path, crumb_title in zip(*(breadcrumbs[i::2] for i in (0, 1))): $ crumb_path = str(crumb_path) $ crumb_icon, crumb_classes = None, None $if isinstance(crumb_title, tuple): $ crumb_icon, crumb_classes, crumb_title = crumb_title $ path = path + "/" + crumb_path $ ups = " ".join(["up"] * remaining) $ remaining = remaining - 1 \ $if crumb_icon: \ $:crumb_title\ $:padding$:separator\
$if not tx.request.uri.path:
$# $ rel_mes = [
$# $ ]
$# $for rel_me in rel_mes:
$# $ domain = rel_me.partition(".")[0]
$# \
$#