X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f109b7f6e35d54281f1edf4b684c49db621d36c5..756585089fb09cd0e25856b55510e69a52112e5f:/wolnelektury/templates/newsearch/search.html?q=%7B%7Bdid_you_mean%7Curlencode%7D%7D diff --git a/wolnelektury/templates/newsearch/search.html b/wolnelektury/templates/newsearch/search.html index e018b2111..af36b5988 100644 --- a/wolnelektury/templates/newsearch/search.html +++ b/wolnelektury/templates/newsearch/search.html @@ -2,35 +2,46 @@ {% load i18n %} {% load catalogue_tags %} -{% block title %}LeÅmianator w WolneLektury.pl{% endblock %} +{% block title %}Search{% endblock %} -{% block metadescription %}Stwórz wÅasny wierszmiks z utworów znajdujÄ cych siÄ na Wolnych Lekturach.{% endblock %} +{% block metadescription %}{% endblock %} -{% block bodyid %}lesmianator{% endblock %} +{% block bodyid %}newsearch{% endblock %} {% block body %} <h1>Search</h1> <form action="{% url newsearch %}" 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 score,book,parts in results %} + {% for result in results %} <li> - <p>{{book.author}} - {{book.title}} (id: {{book.id}}, score: {{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 score,part in parts %} + {% for snippet in result.snippets %} + <li>{{snippet|safe}}</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 %}