fix player placement in search results
authorJan Szejko <janek37@gmail.com>
Wed, 13 Dec 2017 15:22:36 +0000 (16:22 +0100)
committerJan Szejko <janek37@gmail.com>
Wed, 13 Dec 2017 15:22:36 +0000 (16:22 +0100)
src/catalogue/templates/catalogue/book_searched.html
src/catalogue/templates/catalogue/book_short.html
src/catalogue/templates/catalogue/search_multiple_hits.html
src/wolnelektury/static/scss/main/book_box.scss
src/wolnelektury/static/scss/main/search.scss

index 06bb4fd..4e91432 100644 (file)
@@ -1,14 +1,8 @@
-{% spaceless %}
-  {% load i18n %}
-  {% load inline_tag_list from catalogue_tags %}
-  {% load ssi_include from ssify %}
-  {% load cache %}
-
-  <div class="search-result">
-    {% cache 86400 catalogue_book_short book.pk %}
-      {% include 'catalogue/book_short.html' %}
-    {% endcache %}
+{% extends "catalogue/book_short.html" %}
+{% load inline_tag_list from catalogue_tags %}
 
+{% block right-column %}
+  <div class="book-right-column">
     <div class="snippets">
       {% for hit in hits %}
         {% if hit.snippet %}
               {% 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}} {# bad, now impossible #}
-              {% endif %}
+              {{hit.snippet|safe}}
             </a>
           </div>
         {% endif %}
       {% endfor %}
     </div>
-
-    <div style="clear: right"></div>
+    {% include 'catalogue/snippets/jplayer.html' %}
   </div>
-{% endspaceless %}
\ No newline at end of file
+{% endblock %}
index 24d93d0..70aaed3 100644 (file)
 
     {% block right-column %}
       {% if audiobooks %}
-        <div class="audiobook-right-column">
+        <div class="book-right-column">
           {% include 'catalogue/snippets/jplayer.html' %}
         </div>
       {% endif %}
index b3f522b..ce43bf9 100644 (file)
@@ -30,7 +30,9 @@
     <ul class="work-list">
       {% for result in results %}
         <li class="Book-item">
-          {% book_searched result %}
+          <div class="search-result">
+            {% book_searched result %}
+          </div>
         </li>
       {% endfor %}
     </ul>
index 44a5955..0e90611 100755 (executable)
   }
 }
 
-.audiobook-box {
+.audiobook-box, .search-result .book-box {
   .book-left-column {
     @media screen and (min-width: 1024px) {
       display: inline-block;
     }
   }
 
-  .audiobook-right-column {
+  .book-right-column {
     @media screen and (min-width: 1024px) {
       float: right;
+      @include size(padding-top, 15px);
       @include size(width, 360px);
     }
   }
 
     @media screen and (min-width: 1024px) {
       float: right;
-      margin-top: 48px;
     }
   }
 }
index f77e84e..14d8f0d 100755 (executable)
@@ -26,8 +26,7 @@
     @include size(margin-bottom, 16px);
 }
 
-
-.search-result {
+/*.search-result {
     @include size(border, 1px solid #ddd);
     @include size(box-shadow, 2px 2px 2px #ddd);
     @include size(margin, 1px);
@@ -55,7 +54,7 @@
             margin: 0;
         }
     }
-}
+}*/