Search - some tests, change in SearchResults cleaning.
[wolnelektury.git] / wolnelektury / templates / catalogue / search_multiple_hits.html
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags pagination_tags %}
4
5 {% block titleextra %}{% trans "Search" %}{% endblock %}
6
7 {% block bodyid %}tagged-object-list{% endblock %}
8
9 {% block body %}
10     <h1>{% trans "Search" %}</h1>
11
12     <div id="results">
13       <ol>
14       {% for result in results %}
15       <li>
16         <p><a href="{{result.book.get_absolute_url}}">{{result.book.pretty_title}}</a> (id: {{result.book_id}}, score: {{result.score}})</p>
17         <ul>
18           {% for hit in result.hits %}
19           <li>
20             {% if hit.fragment %}
21             <a href="{{hit.fragment.get_absolute_url}}">Idź do fragmentu</a>
22             <div style="">Tagi/Motywy: {% for tag in hit.themes %}{{tag.name}} {% endfor %}</div>
23             {# snippets or short html? #}
24             {% if hit.snippets %}
25              {% for snip in hit.snippets %}
26                {{snip|safe}}<br/>
27              {% endfor %}
28             {% else %}
29              {{hit.fragment.short_text|safe}}
30             {% endif %}
31             
32             {% else %}
33             {# it's a section #}
34              {% if hit.snippets %}
35               {% for snip in hit.snippets %}
36                 {{snip|safe}}<br/>
37               {% endfor %}
38              {% else %}
39                [section matched but no snippets :-(]
40              {% endif %}
41             {% endif %}
42           </li>
43           {% endfor %}
44
45         </ul>
46       </li>
47       {% empty %}
48       <p>No results.</p>
49       {% endfor %}
50       </ol>
51     </div>
52
53
54 {% comment %}
55     <div id="books-list">
56         <p>{% trans "More than one result matching the criteria found." %}</p>
57         <ul class='matches'>
58         {% for match, link, type in results %}
59           <li>{% trans type %}: <a href='{{ link }}'>
60             {% ifequal type "book" %}
61                 {% book_title match %}
62             {% else %}
63                 {{ match.name }}
64             {% endifequal %}
65           </a></li>
66         {% endfor %}
67         </ul>
68     </div>
69 {% endcomment %}
70
71 {% endblock %}