Only display an icon for index instances and not for documents
This commit is contained in:
@@ -2,8 +2,14 @@ from django.utils.safestring import mark_safe
|
||||
|
||||
from document_indexing.models import IndexInstance
|
||||
|
||||
FOLDER_ICON = u'folder_page'
|
||||
|
||||
|
||||
def index_instance_item_link(index_instance_item):
|
||||
icon = u'folder_page' if isinstance(index_instance_item, IndexInstance) else u'page'
|
||||
return mark_safe(u'<span class="famfam active famfam-%(icon)s"></span><a href="%(url)s">%(text)s</a>' % {
|
||||
'url': index_instance_item.get_absolute_url(), 'icon': icon, 'text': index_instance_item})
|
||||
icon = FOLDER_ICON if isinstance(index_instance_item, IndexInstance) else u''
|
||||
icon_template = u'<span class="famfam active famfam-%s"></span>' % icon if icon else u''
|
||||
return mark_safe('%(icon_template)s<a href="%(url)s">%(text)s</a>' % {
|
||||
'url': index_instance_item.get_absolute_url(),
|
||||
'icon_template': icon_template,
|
||||
'text': index_instance_item
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user