X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/73ce961f14509aabfa26536f847afd28111029c6..4e3a77b2fd049d08ecc1d156356750dc5881fe76:/wolnelektury/templates/catalogue/book_short.html

diff --git a/wolnelektury/templates/catalogue/book_short.html b/wolnelektury/templates/catalogue/book_short.html
index 7f262374d..2c81b2e98 100644
--- a/wolnelektury/templates/catalogue/book_short.html
+++ b/wolnelektury/templates/catalogue/book_short.html
@@ -1,7 +1,10 @@
 {% load i18n %}
+{% load social_tags %}
 {% load thumbnail %}
 <div class="{% block box-class %}book-box{% endblock %}">
-<div class="book-box-inner">
+<div class="book-box-inner" style="position: relative;">
+
+
     <a href="{{ book.get_absolute_url }}">
         {% if book.cover %}
             <img src="
@@ -16,11 +19,27 @@
     {% block right-column %}
     {% endblock %}
     <div class="book-box-body">
+
+
+<div class="star {% if not request.user|likes:book %}un{% endif %}like">
+    <div class="if-like" >
+        <a id="social-book-sets-{{ book.slug }}" data-callback='social-book-sets' class='ajaxable' href='{% url social_book_sets book.slug %}'>
+            ★
+        </a>
+    </div>
+    <div class="if-unlike">
+        <form id="social-like-book-{{ book.slug }}" data-callback='social-like-book' method='post' class='ajax-form' action='{% url social_like_book book.slug %}'>
+            <button type='submit'>☆</button>
+        </form>
+    </div>
+</div>
+
+
         <div class="book-box-head">
             <div class="mono author">
-            {% for author in tags.author %}
-                {{ author }}
-            {% endfor %}
+                {% for name, url in related.tags.author %}
+                    {{ name }}{% if not forloop.last %}, {% endif %}
+                {% endfor %}
             </div>
             <div class="title">{{ book.title }}</div>
         </div>
@@ -28,20 +47,20 @@
             {% spaceless %}
 
             <span class="mono">{% trans "Epoch" %}:</span>&nbsp;<span class="book-box-tag">
-                {% for tag in tags.epoch %}
-                    <a href="{{ tag.get_absolute_url }}">{{ tag.name }} </a>
+                {% for name, url in related.tags.epoch %}
+                    <a href="{{ url }}">{{ name }} </a>
                 {% endfor %}
             </span>
 
             <span class="mono">{% trans "Kind" %}:</span>&nbsp;<span class="book-box-tag">
-                {% for tag in tags.kind %}
-                    <a href="{{ tag.get_absolute_url }}">{{ tag.name }} </a>
+                {% for name, url in related.tags.kind %}
+                    <a href="{{ url }}">{{ name }} </a>
                 {% endfor %}
             </span>
 
             <span class="mono">{% trans "Genre" %}:</span>&nbsp;<span class="book-box-tag">
-                {% for tag in tags.genre %}
-                    <a href="{{ tag.get_absolute_url }}">{{ tag.name }} </a>
+                {% for name, url in related.tags.genre %}
+                    <a href="{{ url }}">{{ name }} </a>
                 {% endfor %}
             </span>
 
@@ -72,7 +91,7 @@
             </div>
         </li>
         <li class="book-box-audiobook">
-        {% if book.has_mp3_file %}
+        {% if related.media.mp3 or related.media.ogg %}
             <a href="{% url book_player book.slug %}" class="open-player mono downarrow">{% trans "Listen" %}</a>
         {% endif %}
         </li>