X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/9362aac47564f9b03a3fcad625b312e85dfdf6db..8fc17a12a92f649f2b9dd8c884a85d1a7232f248:/wolnelektury/templates/newsearch/search.html diff --git a/wolnelektury/templates/newsearch/search.html b/wolnelektury/templates/newsearch/search.html index 4dfc8581f..c494ca602 100644 --- a/wolnelektury/templates/newsearch/search.html +++ b/wolnelektury/templates/newsearch/search.html @@ -10,27 +10,42 @@ {% block body %} <h1>Search</h1> - <form action="{% url newsearch %}" method="get" accept-charset="utf-8" id="search-form-x"> + <form action="{% url search %}" method="get" accept-charset="utf-8" id="search-form-x"> <p> - <input type="text" name="q" style="width:250px; font-size: 1.2em;"> + <input type="text" name="q" value="{{request.GET.q}}" style="width:250px; font-size: 1.2em;"> <input type="submit" value="{% trans "Search" %}" /> + <br /> + <input type="checkbox" value="true" name="fuzzy" {% if fuzzy %}checked{% endif %}/> fuzzy. </p> </form> + {% if did_you_mean %} + Czy miaÅeÅ na mysli <a href="?q={{did_you_mean|urlencode}}">{{did_you_mean}}</a>? + {% endif %} + <div id="results"> <ol> {% for result in results %} <li> - <p>{{result.book.pretty_title}} (id: {{result.book.id}}, score: {{result.score}})</p> + <p><a href="{{result.book.get_absolute_url}}">{{result.book.pretty_title}}</a> (id: {{result.book_id}}, score: {{result.score}})</p> <ul> + {% for hit in result.hits %} + <li> + {% for snip in hit.3.snippets %} + {{snip|safe}}<br/> + {% endfor %} + </li> + {% endfor %} + {% for part in result.parts %} {% if part.header %} <li>W {{part.header}} nr {{part.position}}</li> {% else %} {% if part.fragment %} <li> - <div style="font-weight: bold;">{% for tag in part.fragment.tags %}{{tag.name}} {% endfor %}</div> - {{part.fragment.text|safe}} </li> + <div style="">Tagi/Motywy: {% for tag in part.fragment.tags %}{{tag.name}} {% endfor %}</div> + {{part.fragment.short_html|safe}} + </li> {% endif %} {% endif %} {% endfor %}