Code layout change.
[wolnelektury.git] / src / catalogue / templates / catalogue / book_searched.html
diff --git a/src/catalogue/templates/catalogue/book_searched.html b/src/catalogue/templates/catalogue/book_searched.html
new file mode 100644 (file)
index 0000000..357491c
--- /dev/null
@@ -0,0 +1,38 @@
+{% spaceless %}
+
+{% load i18n %}
+{% load inline_tag_list from catalogue_tags %}
+{% load ssi_include from ssify %}
+
+<div class="search-result">
+
+{% ssi_include 'catalogue_book_short' pk=book.pk %}
+
+<div class="snippets">
+  {% for hit in hits %}
+  {% if hit.snippet %}
+  <div class="snippet-text"><a href="{% url 'book_text' book.slug %}#sec{{hit.section_number}}">{{hit.snippet|safe}}</a></div>
+  {% else %}
+  {% if hit.fragment %}
+  <div class="snippet-text">
+    {% if hit.themes_hit %}
+    {% inline_tag_list hit.themes_hit  %}
+    {% endif %}
+    <a href="{{hit.fragment.get_absolute_url}}">
+      {% if hit.snippet %}
+        {{hit.snippet|safe}}
+      {% else %}
+        {{hit.fragment.text|truncatewords_html:15|safe}}
+      {% endif %}
+    </a>
+  </div>
+  {% endif %}
+  {% endif %}
+  {% endfor %}
+</div>
+
+<div style="clear: right"></div>
+
+</div>
+
+{% endspaceless %}
\ No newline at end of file