missing chunk
[wolnelektury.git] / src / catalogue / templates / catalogue / 2022 / book_detail.html
index ea967be..00e59ce 100644 (file)
@@ -1,4 +1,4 @@
-{% extends '2022/base_real.html' %}
+{% extends '2022/base.html' %}
 
 {% load static %}
 {% load choose_cites from social_tags %}
@@ -6,7 +6,7 @@
 {% load likes_book from social_tags %}
 
 
-{% block content %}
+{% block global-content %}
     <div class="l-container">
       <div class="l-breadcrumb">
         <a href="/"><span>Strona główna</span></a>
         {% with first_text=book.get_first_text %}
           <aside class="l-aside">
             <figure>
-              {% if first_text %}
+              {% if accessible and first_text %}
                 <a href="{% url 'book_text' first_text.slug %}">
               {% endif %}
               <img src="{% if book.cover_clean %}{{ book.cover_clean.url }}{% endif %}" alt="{{ book.pretty_title }}" width="240">
-              {% if first_text %}
+              {% if accessible and first_text %}
                 </a>
               {% endif %}
             </figure>
               </div>
             </header>
             <article class="l-article">
+              {% if accessible %}
               <div class="c-media">
                 <div class="c-media__actions">
                   <div class="c-media__btn">
                             </div>
                           </div>
                         {% endif %}
-                        {% if book.has_synchro_file %}
+                        {% if book.has_audio_epub_file %}
                           <div class="c-media__popup__box__item">
                             <div>
-                              <h3>synchrobook</h3>
+                              <h3>EPUB + audiobook</h3>
                               <p>Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format.</p>
                             </div>
                             <div>
-                              <a href="#" class="l-button l-button--media l-button--media--full">synchrobook</a>
+                              {% for epub in book.media_audio_epub %}
+                                <a href="{{ epub.file.url }}" class="l-button l-button--media l-button--media--full">EPUB+audio</a>
+                              {% endfor %}
                             </div>
                           </div>
                         {% endif %}
                   </div>
                 {% endif %}
               </div>
+              {% else %}
+              <div class="l-checkout__box">
+                {% chunk 'book-preview-warn' %}
+                {% include 'club/2022/donation_step1_form.html' %}
+              </div>
+              {% endif %}
 
               <div class="l-article__overlay" data-max-height="327">
                 {{ book.abstract|safe }}
               </div>
               <button class="l-article__read-more" aria-label="Kliknij aby rozwinąć" data-label="Czytaj więcej" data-action="Zwiń tekst">Czytaj więcej</button>
             </article>
+            {% if accessible %}
             <div class="c-support">
               <div>
                 <h2>Ta książka jest dostępna dla tysięcy dzieciaków dzięki <span>darowiznom</span> od osób takich jak <span>Ty</span>!</h2>
                 <img src="{% static '2022/images/dziecko.jpeg' %}" alt="Dorzuć się!">
               </figure>
             </div>
+            {% endif %}
           </div>
         {% endwith %}
       </section>
             {% if book.wiki_link %}
               <li><a href="{{ book.wiki_link }}">strona utworu w Wikipedii</a></li>
             {% endif %}
+           {% if accessible %}
             <li>
               <a href="{{ book.xml_url }}">źródłowy plik XML</a>
             </li>
             <li>
               <a target="_blank" href="{{ book.get_extra_info_json.about }}">utwór na Platformie Redakcyjnej</a>
             </li>
+           {% endif %}
           </ul>
         </div>
       </section>