diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_tables/documents.html | 21 | ||||
-rw-r--r-- | ishtar_common/templatetags/window_tables.py | 12 |
2 files changed, 33 insertions, 0 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/window_tables/documents.html b/ishtar_common/templates/ishtar/blocks/window_tables/documents.html new file mode 100644 index 000000000..9405bc3e8 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_tables/documents.html @@ -0,0 +1,21 @@ +{% load i18n %} +<table> + <caption>{{caption}}</caption> + <tr> + <th>{% trans "Title" %}</th> + <th>{% trans "Type" %}</th> + <th>{% trans "Authors" %}</th> + <th>{% trans "Related to" %}</th> + <th>{% trans "Link" %}</th> + </tr> + {% for doc in data %} + <tr> + <td class='string'>{{ doc.title }}</td> + <td class='string'>{{doc.source_type}}</td> + <td class='string'>{{ doc.authors.all|join:", " }}</td> + <td class='string'><a href="#" onclick='load_window("{{doc.owner.show_url}}")'>{{doc.owner.short_label}}</a></td> + <td class='string'>{% if doc.associated_url %}<a href='{{doc.associated_url}}'>{% trans "Link"%}</a>{% endif %}</td> + </tr> + {% endfor %} +</table> + diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py new file mode 100644 index 000000000..5c19eb6df --- /dev/null +++ b/ishtar_common/templatetags/window_tables.py @@ -0,0 +1,12 @@ + +from django import template +from django.utils.translation import ugettext as _ +import re + +register = template.Library() + +@register.inclusion_tag('ishtar/blocks/window_tables/documents.html') +def table_document(caption, data): + return {'caption':caption, 'data':data} + + |