workaround for django ticket 17111; cover in api fix
[wolnelektury.git] / wolnelektury / templates / newsearch / search.html
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load catalogue_tags %}
4
5 {% block title %}Search{% endblock %}
6
7 {% block metadescription %}{% endblock %}
8
9 {% block bodyid %}newsearch{% endblock %}
10
11 {% block body %}
12     <h1>Search</h1>
13     <form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form-x">
14         <p>
15           <input type="text" name="q" value="{{request.GET.q}}" style="width:250px; font-size: 1.2em;">
16           <input type="submit" value="{% trans "Search" %}" /> 
17           <br />
18           <input type="checkbox" value="true" name="fuzzy" {% if fuzzy %}checked{% endif %}/> fuzzy.
19         </p>
20     </form>
21     {% if did_you_mean %}
22     Czy miałeś na mysli <a href="?q={{did_you_mean|urlencode}}">{{did_you_mean}}</a>?
23     {% endif %}
24
25
26     <div id="results">
27       <ol>
28       {% for result in results %}
29       <li>
30         <p><a href="{{result.book.get_absolute_url}}">{{result.book.pretty_title}}</a> (id: {{result.book_id}}, score: {{result.score}})</p>
31         <ul>
32           {% for hit in result.hits %}
33           <li>
34             {% for snip in hit.3.snippets %}
35               {{snip|safe}}<br/>
36             {% endfor %}
37           </li>
38           {% endfor %}
39
40           {% for part in result.parts %}
41           {% if part.header %}
42           <li>W {{part.header}} nr {{part.position}}</li>
43           {% else %} 
44           {% if part.fragment %}
45           <li>
46             <div style="">Tagi/Motywy: {% for tag in part.fragment.tags %}{{tag.name}} {% endfor %}</div>
47             {{part.fragment.short_html|safe}}
48           </li>
49           {% endif %}
50           {% endif %}
51           {% endfor %}
52         </ul>
53       </li>
54       {% empty %}
55       <p>No results.</p>
56       {% endfor %}
57       </ol>
58     </div>
59
60 {% endblock %}