From: Radek Czajka Date: Fri, 21 Feb 2014 10:49:48 +0000 (+0100) Subject: Work list: don't care about types of objects on other pages. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/062a80b51a89bf2361930461c0ad7ae5e36a2bdd?ds=inline Work list: don't care about types of objects on other pages. --- diff --git a/apps/catalogue/templates/catalogue/work-list.html b/apps/catalogue/templates/catalogue/work-list.html index 6c1a7660f..fa33557d8 100755 --- a/apps/catalogue/templates/catalogue/work-list.html +++ b/apps/catalogue/templates/catalogue/work-list.html @@ -6,11 +6,11 @@ {% spaceless %}
    {% for item in object_list %} -
  1. +
  2. {% if item.short_html %} {{ item.short_html }} {# since we are using shor_html eerywhere, is it needed anymore? #} - {% elif item.object_type == "Picture" %} + {% elif item|class_name == "Picture" %} {% picture_short item %} {% else %} {% book_short item %} diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 6ff60a3fb..bbd9f0719 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -365,9 +365,6 @@ def book_mini(book, with_link=True): @register.inclusion_tag('catalogue/work-list.html', takes_context=True) def work_list(context, object_list): request = context.get('request') - for obj in object_list: - obj.object_type = type(obj).__name__ - return locals() @@ -472,7 +469,7 @@ def related_tag_name(tag, lang=None): return _related_tag_name(tag, lang) -@register.simple_tag +@register.filter def class_name(obj): return obj.__class__.__name__