def index_instance_item_link(index_instance_item):
    if isinstance(index_instance_item, IndexInstanceNode):
        if index_instance_item.index_template_node.link_documents:
            icon_template = '<i class="fa fa-folder"></i>'
        else:
            icon_template = '<i class="fa fa-level-up fa-rotate-90"></i>'
    else:
        icon_template = ''

    return mark_safe(
        '%(icon_template)s&nbsp;<a href="%(url)s">%(text)s</a>' % {
            'url': index_instance_item.get_absolute_url(),
            'icon_template': icon_template,
            'text': index_instance_item
        }
    )
dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/document_indexing/widgets.py/index_instance_item_link/original