workaround for django ticket 17111; cover in api fix
[wolnelektury.git] / wolnelektury / templates / catalogue / book_searched.html
index 722e323..1a345ed 100644 (file)
@@ -1,5 +1,5 @@
 {% extends "catalogue/book_short.html" %}
-{% load i18n %}
+{% load i18n catalogue_tags %}
 
 
 {% block box-class %}search-result{% endblock %}
@@ -8,15 +8,14 @@
 <div class="snippets">
   {% for hit in hits %}
   {% if hit.snippets %}
-  <p>In text:</p>
-  <div class="snippet-text"><a href="{% url book_text book.slug %}#f{{hit.section_number}}">{{hit.snippets.0|safe}}</a></div>
+  <div class="snippet-text"><a href="{% url book_text book.slug %}#sec{{hit.section_number}}">{{hit.snippets.0|safe}}</a></div>
   {% else %}
   {% if hit.fragment %}
   <div class="snippet-text">
-    <p>{% trans "In fragment" %}
-      {% if hit.themes_hit %}{% trans ", for themes:" %}{% for t in hit.themes_hit %}{{t.name}} {% endfor %}{% endif %}
-    </p>
-    <a href="{{hit.fragment.get_absolute_url}}">{{hit.fragment.get_short_text|safe}}</a>
+    {% if hit.themes_hit %}
+    {% inline_tag_list hit.themes_hit  %}
+    {% endif %}
+    <a href="{{hit.fragment.get_absolute_url}}">{{hit.fragment.text|truncatewords_html:15|safe}}</a>
   </div>
   {% endif %}
   {% endif %}