Marquise cover and some fixes.
[wolnelektury.git] / src / catalogue / templates / catalogue / 2022 / book_detail.html
index cb0dd3a..e0c82e0 100644 (file)
@@ -4,6 +4,8 @@
 {% load choose_cites from social_tags %}
 {% load choose_fragment license_icon from catalogue_tags %}
 {% load catalogue_tags %}
+{% load likes_book from social_tags %}
+{% load piwik_tags %}
 
 
 <html class="no-js">
@@ -20,6 +22,8 @@
       <link rel="preconnect" href="https://fonts.googleapis.com">
       <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
       <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap" rel="stylesheet">
+
+      {% tracking_code %}
   </head>
   <body>
 
         <h3>Zmieniamy się!</h3>
         <p>
           Jeżeli to czytasz jesteś jedną z osób, której prezentujemy nowy wygląd strony książki.
-          Będziemy bardzo! wdzięczni za Twoją opinię – <a href='{% url 'suggest' %}' target="_blank">możesz nam ją przesłać tutaj</a>.
+          Będziemy bardzo! wdzięczni za Twoją opinię – <a href='/formularz/ux-strona-ksiazki-T1/' target="_blank">możesz nam ją przesłać tutaj</a>.
           Jeżeli wolisz klasyczny wygląd - wystarczy, że <a class="quit-experiment" href="#">klikniesz tutaj</a>
         </p>
         <!-- button class="l-change-pop__close">
-          <i class="icon icon-close"></i>
-        </button -->
+             <i class="icon icon-close"></i>
+             </button -->
       </div>
       <div class="l-container">
         <a href="/" class="l-navigation__logo">
         <div class="l-navigation__actions">
           <a href="/ludzie/polka/"><i class="icon icon-liked"></i></a>
           <!-- button class="l-navigation__button js-menu" aria-label="Menu">
-            <span class="c-hamburger">
-              <span class="bar"></span>
-            </span>
-          </button-->
+               <span class="c-hamburger">
+               <span class="bar"></span>
+               </span>
+               </button-->
         </div>
       </div>
     </nav>
               <img src="{% if book.cover_clean %}{{ book.cover_clean.url }}{% endif %}" alt="{{ book.pretty_title }}" width="240">
             </a>
           </figure>
-          <ul class="l-aside__info">
-            <li><span>Epoka:</span> {% for tag in book.epochs %}<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a> {% endfor %}</li>
-            <li><span>Rodzaj:</span> {% for tag in book.kinds %}<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a> {% endfor %}</li>
-            <li><span>Gatunek:</span> {% for tag in book.genres %}<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a> {% endfor %}</li>
-          </ul>
+
           {% if book.parent or book.get_children %}
             <ul class="l-aside__zbiory">
               {% if book.parent %}
               {% endif %}
             </ul>
           {% endif  %}
+
+          <ul class="l-aside__info">
+            <li><span>Epoka:</span> {% for tag in book.epochs %}<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a> {% endfor %}</li>
+            <li><span>Rodzaj:</span> {% for tag in book.kinds %}<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a> {% endfor %}</li>
+            <li><span>Gatunek:</span> {% for tag in book.genres %}<a href="{{ tag.get_absolute_url }}">{{ tag.name }}</a> {% endfor %}</li>
+
+          </ul>
         </aside>
         <div class="l-content">
           <header class="l-header">
             <div class="l-header__content">
               <p>{% for author in book.authors %}<a href="{{ author.get_absolute_url }}">{{ author.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
-                {% if book.translators %}
-                  (tłum. {% for translator in book.translators %}{{ translator }}{% endfor %})
-                {% endif %}
               </p>
               <h1><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></h1>
+              {% if book.translators %}
+                <p class="l-header__translators">
+                  tłum.
+                  {% for translator in book.translators %}
+                    {{ translator }}{% if not forloop.last %}, {% endif %}
+                  {% endfor %}
+                </p>
+              {% endif %}
             </div>
             <div class="l-header__actions">
-              <form method='post' action='{% url 'social_like_book' book.slug %}'>
-                {% csrf_token %}
-                <button class="l-button l-button--fav">
-                  <img src="{% static '2022/images/fav.svg' %}" alt="Dodaj do ulubionych">
-                </button>
-              </form>
+              {% likes_book book as likes %}
+              {% if likes %}
+                <form method='post' action='{% url 'social_unlike_book' book.slug %}'>
+                  {% csrf_token %}
+                  <button class="l-button l-button--fav">
+                    <img src="{% static '2022/images/faved.svg' %}" alt="Usuń z ulubionych">
+                  </button>
+                </form>
+              {% else %}
+                <form method='post' action='{% url 'social_like_book' book.slug %}'>
+                  {% csrf_token %}
+                  <button class="l-button l-button--fav">
+                    <img src="{% static '2022/images/fav.svg' %}" alt="Dodaj do ulubionych">
+                  </button>
+                </form>
+              {% endif %}
             </div>
           </header>
           <article class="l-article">
                         <div>
                           <h3>inne formaty</h3>
                           <ul>
+                            <li><a href="{% url 'custom_pdf_form' book.slug %}">Stwórz własny PDF</a></li>
                             {% if book.txt_file %}<li><a href="{{ book.txt_url }}">plik tekstowy (.txt)</a></li>{% endif %}
                             {% if book.fb2_file %}<li><a href="{{ book.fb2_url }}">FictionBook</a></li>{% endif %}
                           </ul>
           <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>
-              <a href="/towarzystwo/">Dorzuć się!</a>
+              <a href="{% url 'club_join' %}?pk_campaign=layout">Dorzuć się!</a>
             </div>
             <figure>
               <img src="{% static '2022/images/dziecko.jpeg' %}" alt="Dorzuć się!">
                   </figure>
                 {% endif %}
                 <article class="l-author__info">
-                  <h3>{{ author.name }}</h3>
+                  <h3><a href="{{ author.get_absolute_url }}">{{ author.name }}</a></h3>
                   <div class="l-article__overlay" data-max-height="327">
                     {{ author.description|safe }}
                   </div>
               </div>
             {% endif %}
           </div>
-      </section>
+        </section>
       {% endfor %}
 
       <section class="l-section">
             {% endif %}
           {% endwith %}
           <ul class="links">
+            {% if book.wiki_link %}
+              <li><a href="{{ book.wiki_link }}">strona utworu w Wikipedii</a></li>
+            {% endif %}
             <li>
               <a href="{{ book.xml_url }}">źródłowy plik XML</a>
             </li>
                 <article class="l-books__item">
                   <figure class="l-books__item__img">
                     <a href="{{ rel.get_absolute_url }}">
-                      <img src="{% if rel.cover %}{{ rel.cover.url }}{% endif %}" alt="{{ rel.pretty_title }}">
+                      <img src="{% if rel.cover_clean %}{{ rel.cover_clean.url }}{% endif %}" alt="{{ rel.pretty_title }}">
                     </a>
                   </figure>
                   <h3>
               <article class="l-books__item">
                 <figure class="l-books__item__img">
                   <a href="{{ rel.get_absolute_url }}">
-                    <img src="{% if rel.cover %}{{ rel.cover.url }}{% endif %}" alt="{{ rel.pretty_title }}">
+                    <img src="{% if rel.cover_clean %}{{ rel.cover_clean.url }}{% endif %}" alt="{{ rel.pretty_title }}">
                   </a>
                 </figure>
                 <h3>
     </div>
 
     <script src="{% static '2022/scripts/vendor.js' %}"></script>
-    <script src="{% static '2022/scripts/main.js' %}"></script>
+    <script src="{% static '2021/scripts/main.js' %}"></script>
 
     {% javascript '2022' %}
-    {% javascript '2022_player' %}
+      {% javascript '2022_player' %}
+        <!-- Hotjar Tracking Code for https://wolnelektury.pl/ -->
+        <script>
+         (function(h,o,t,j,a,r){
+             h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
+             h._hjSettings={hjid:2661024,hjsv:6};
+             a=o.getElementsByTagName('head')[0];
+             r=o.createElement('script');r.async=1;
+             r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
+             a.appendChild(r);
+         })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
+        </script>
   </body>
 </html>