minor fixes in search
[wolnelektury.git] / src / catalogue / templates / catalogue / book_searched.html
1 {% spaceless %}
2   {% load i18n %}
3   {% load inline_tag_list from catalogue_tags %}
4   {% load ssi_include from ssify %}
5
6   <div class="search-result">
7     {% ssi_include 'catalogue_book_short' pk=book.pk %}
8
9     <div class="snippets">
10       {% for hit in hits %}
11         {% if hit.snippet %}
12           <div class="snippet-text">
13             <a href="{% url 'book_text' book.slug %}#sec{{hit.section_number}}">{{hit.snippet|safe}}</a>
14           </div>
15         {% elif hit.fragment %}
16           <div class="snippet-text">
17             {% if hit.themes_hit %}
18               {% inline_tag_list hit.themes_hit  %}
19             {% endif %}
20             <a href="{{hit.fragment.get_absolute_url}}">
21               {% if hit.snippet %}
22                 {{hit.snippet|safe}}
23               {% else %}
24                 {{hit.fragment.text|truncatewords_html:15|safe}} {# bad, now impossible #}
25               {% endif %}
26             </a>
27           </div>
28         {% endif %}
29       {% endfor %}
30     </div>
31
32     <div style="clear: right"></div>
33   </div>
34 {% endspaceless %}