fix player
[wolnelektury.git] / src / catalogue / templates / catalogue / book_detail.html
index 6586970..32a10ad 100644 (file)
                 <p>{% for author in book.authors %}<a href="{{ author.get_absolute_url }}">{{ author.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
                 </p>
                 <h1><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></h1>
-                {% with translators=book.translators %}
-                {% if translators %}
+                {% if book.translators.exists %}
                   <p class="l-header__translators">
-                    {% if translators.0 != 'tłumacz nieznany' %}
-                      {% trans "tłum." %}
-                    {% endif %}
-                    {% for translator in translators %}
-                      {{ translator }}{% if not forloop.last %}, {% endif %}
+                    {% for translator in book.translators.all %}
+                      {% if forloop.first and translator.name != 'tłumacz nieznany' %}
+                        {% trans "tłum." %}
+                      {% endif %}
+                      <a href="{{ translator.get_absolute_url }}">
+                        {{ translator }}</a>{% if not forloop.last %}, {% endif %}
                     {% endfor %}
                   </p>
                 {% endif %}
-                {% endwith %}
               </div>
 
 
                         <div class="c-media__btn">
                           <button class="l-button l-button--media" id="ebook"><i class="icon icon-book"></i> {% trans "pobierz książkę" %}</button>
                         </div>
+                        <div class="c-media__btn">
+                          {% if first_text %}
+                            <a href="https://elevenreader.io/audiobooks/wolnelektury:{{ first_text.slug }}" target="_blank" class="l-button l-button--media"><img src="{% static 'img/elevenreader-21.png' %}" title="{% trans "Posłuchaj w ElevenReader" %}" alt="{% trans "Posłuchaj w ElevenReader" %}"></a>
+                          {% endif %}
+                        </div>
                         <div class="c-media__btn">
                           {% if first_text %}
                             <a href="{% url 'book_text' first_text.slug %}" class="l-button l-button--media l-button--media--full"><i class="icon icon-eye"></i> {% trans "czytaj online" %}</a>
                   </div>
 
 
-
-                  {% if book.has_mp3_file %}
+                  {% if book.has_audio %}
                     {% include 'catalogue/snippets/jplayer.html' %}
-                  {% else %}
-                    {% with ch=book.get_child_audiobook %}
-                      {% if ch %}
-                        {% include 'catalogue/snippets/jplayer_link.html' with book=ch %}
-                      {% endif %}
-                    {% endwith %}
-
                   {% endif %}
 
 
-
-
                   <div class="c-media__popup" data-popup="ebook">
                     <div class="c-media__popup__box">
                       <div class="c-media__popup__box__lead">