Experimental preview of 2022 book detail page.
[wolnelektury.git] / src / catalogue / templates / catalogue / 2021 / book_detail.html
1 <!doctype html>
2 {% load pipeline %}
3 {% load static %}
4 {% load choose_cites from social_tags %}
5 {% load choose_fragment license_icon from catalogue_tags %}
6 {% load catalogue_tags %}
7
8
9 <html class="no-js">
10   <head>
11     <meta charset="utf-8">
12     <meta name="description" content="">
13     <meta name="viewport" content="width=device-width,initial-scale=1">
14     <title>WolneLektury.pl</title>
15     <link rel="apple-touch-icon" href="apple-touch-icon.png">
16
17     {% stylesheet '2022' %}
18       <script src="scripts/modernizr.js"></script>
19
20       <link rel="preconnect" href="https://fonts.googleapis.com">
21       <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
22       <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">
23   </head>
24   <body>
25
26     <nav class="l-navigation">
27       <div class="l-container">
28         <a href="/" class="l-navigation__logo">
29           <img src="{% static "2022/images/logo.png" %}" alt="WolneLektury.pl">
30         </a>
31         <div class="l-naviagion__search">
32           <form action="/szukaj/">
33             <input name="q" type="text" placeholder="szukaj tytułu, autora, motywów…">
34           </form>
35         </div>
36         <div class="l-navigation__actions">
37           <a href="/ludzie/polka/"><i class="icon icon-liked"></i></a>
38           <button class="l-navigation__button js-menu" aria-label="Menu">
39             <span class="c-hamburger">
40               <span class="bar"></span>
41             </span>
42           </button>
43         </div>
44       </div>
45     </nav>
46
47
48     {# TODO: BREADCRUMBS #}
49     <div class="l-container">
50       <div class="l-breadcrumb">
51         <a href="/"><span>Strona główna</span></a>
52         <a href="/katalog/lektury/"><span>Literatura</span></a>
53         {% for ancestor in book.ancestors %}
54           <a href="{{ ancestor.get_absolute_url }}">{{ ancestor.title }}</a>
55         {% endfor %}
56       </div>
57     </div>
58
59
60     <main class="l-main">
61       <section class="l-section">
62         <aside class="l-aside">
63           <figure>
64             <img src="{% if book.cover_thumb %}{{ book.cover_thumb.url }}{% endif %}" alt="{{ book.pretty_title }}" width="238">
65           </figure>
66           <ul class="l-aside__info">
67             <li><span>Epoka:</span> {% for tag in book.epochs %}<a href="{{ tag.get_absolute_url }}">{{ tag.name|lower }}</a> {% endfor %}</li>
68             <li><span>Rodzaj:</span> {% for tag in book.kinds %}<a href="{{ tag.get_absolute_url }}">{{ tag.name|lower }}</a> {% endfor %}</li>
69             <li><span>Gatunek:</span> {% for tag in book.genres %}<a href="{{ tag.get_absolute_url }}">{{ tag.name|lower }}</a> {% endfor %}</li>
70           </ul>
71           {% if book.parent or book.children.all %}
72             <ul class="l-aside__zbiory">
73               {% if book.parent %}
74                 {% for b in book.ancestors %}
75                   <li>
76                     <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
77                     <ul>
78                 {% endfor %}
79                 {% for b in book.get_siblings %}
80                   <li>
81                     {% if b == book %}
82                       <strong>{{ b.title }}</strong>
83                       <ul>
84                         {% for c in book.children.all %}
85                           <li>
86                             <a href="{{ c.get_absolute_url }}">{{ c.title }}</a>
87                           </li>
88                         {% endfor %}
89                       </ul>
90                     {% else %}
91                       <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
92                     {% endif %}
93                   </li>
94                 {% endfor %}
95
96                 {% for b in book.ancestor.all %}
97                     </ul>
98                   </li>
99                 {% endfor %}
100               {% else %}
101                 <li>
102                   <strong>{{ book.title }}</strong>
103                   <ul>
104                     {% for c in book.children.all %}
105                       <li>
106                         <a href="{{ c.get_absolute_url }}">{{ c.title }}</a>
107                       </li>
108                     {% endfor %}
109                   </ul>
110                 </li>
111               {% endif %}
112             </ul>
113           {% endif  %}
114         </aside>
115         <div class="l-content">
116           <header class="l-header">
117             <div class="l-header__content">
118               <p>{% for author in book.authors %}<a href="{{ author.get_absolute_url }}">{{ author.name }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
119                 {% if book.translators %}
120                   (tłum. {% for translator in book.translators %}{{ translator }}{% endfor %})
121                 {% endif %}
122               </p>
123               <h1>{{ book.title }}</h1>
124             </div>
125             <div class="l-header__actions">
126               <button class="l-button l-button--fav">
127                 <img src="{% static '2022/images/fav.svg' %}" alt="Dodaj do ulubionych">
128               </button>
129             </div>
130           </header>
131           <article class="l-article">
132             <div class="c-media">
133               <div class="c-media__actions">
134                 <div class="c-media__btn">
135                   {% if book.has_mp3_file %}
136                     <button class="l-button l-button--media" id="audiobook"><i class="icon icon-audio"></i> pobierz audiobook</button>
137                   {% endif %}
138                 </div>
139                 <div class="c-media__btn">
140                   <button class="l-button l-button--media" id="ebook"><i class="icon icon-book"></i> pobierz książkę</button>
141                 </div>
142                 <div class="c-media__btn">
143                   {% with t=book.get_first_text %}
144                     {% if t %}
145                       <a href="{% url 'book_text' t.slug %}" class="l-button l-button--media l-button--media--full"><i class="icon icon-eye"></i> czytaj online</a>
146                     {% endif %}
147                   {% endwith %}
148                 </div>
149               </div>
150
151
152
153               {% if book.has_mp3_file %}
154                 {% include 'catalogue/snippets/2022_jplayer.html' %}
155               {% endif %}
156
157
158
159
160               <div class="c-media__popup" data-popup="ebook">
161                 <div class="c-media__popup__box">
162                   <div class="c-media__popup__box__lead">
163                     <h2>Pobieranie e-booka</h2>
164                     <p>Wybierz wersję dla siebie:</p>
165                   </div>
166                   <div class="c-media__popup__box__items">
167                     {% if book.pdf_file %}
168                       <div class="c-media__popup__box__item">
169                         <div>
170                           <h3>.pdf</h3>
171                           <p>Jeśli planujesz wydruk albo lekturę na urządzeniu mobilnym bez dodatkowych aplikacji.</p>
172                         </div>
173                         <div>
174                           <a href="{{ book.pdf_url }}" class="l-button l-button--media l-button--media--full">.pdf</a>
175                         </div>
176                       </div>
177                     {% endif %}
178                     {% if book.epub_file %}
179                       <div class="c-media__popup__box__item">
180                         <div>
181                           <h3>.epub</h3>
182                           <p>Uniwersalny format e-booków, obsługiwany przez większość czytników sprzętowych i aplikacji na urządzenia mobilne.</p>
183                         </div>
184                         <div>
185                           <a href="{{ book.epub_url }}" class="l-button l-button--media l-button--media--full">.epub</a>
186                         </div>
187                       </div>
188                     {% endif %}
189                     {% if book.mobi_file %}
190                       <div class="c-media__popup__box__item">
191                         <div>
192                           <h3>.mobi</h3>
193                           <p>Natywny format dla czytnika Amazon Kindle.</p>
194                         </div>
195                         <div>
196                           <a href="{{ book.mobi_url }}" class="l-button l-button--media l-button--media--full">.mobi</a>
197                         </div>
198                       </div>
199                     {% endif %}
200                     {% if book.synchro_file %}
201                       <div class="c-media__popup__box__item">
202                         <div>
203                           <h3>synchrobook (epub3)</h3>
204                           <p>Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format (np. ..., ..., ...).</p>
205                         </div>
206                         <div>
207                           <a href="#" class="l-button l-button--media l-button--media--full">synchrobook</a>
208                         </div>
209                       </div>
210                     {% endif %}
211                     {% if book.txt_file or book.fb2_file %}
212                       <div class="c-media__popup__box__item">
213                         <div>
214                           <h3>inne formaty</h3>
215                           <ul>
216                             {% if book.txt_file %}<li><a href="{{ book.txt_url }}">plik tekstowy (.txt)</a></li>{% endif %}
217                             {% if book.fb2_file %}<li><a href="{{ book.fb2_url }}">FictionBook</a></li>{% endif %}
218                           </ul>
219                         </div>
220                       </div>
221                     {% endif %}
222                   </div>
223                   <button class="c-media__popup__close">
224                     <img src="{% static '2022/images/close.svg' %}" alt="Zamknij">
225                   </button>
226                 </div>
227               </div>
228               {% if book.has_mp3_file %}
229                 <div class="c-media__popup" data-popup="audiobook">
230                   <div class="c-media__popup__box">
231                     <div class="c-media__popup__box__lead">
232                       <h2>Pobieranie audiobooka</h2>
233                       <p>Wybierz wersję dla siebie:</p>
234                     </div>
235                     <div class="c-media__popup__box__items">
236                       <div class="c-media__popup__box__item">
237                         <div>
238                           <h3>.mp3</h3>
239                           <p>Uniwersalny format, obsługiwany przez wszystkie urządzenia.</p>
240                         </div>
241                         <div>
242                           <a href="{% url 'download_zip_mp3' book.slug %}" class="l-button l-button--media l-button--media--full">.mp3</a>
243                         </div>
244                       </div>
245                       {% if book.has_ogg_file %}
246                         <div class="c-media__popup__box__item">
247                           <div>
248                             <h3>OggVorbis</h3>
249                             <p>Otwarty format plików audio, oferujący nagranie w najwyższej jakości dźwiękowej.</p>
250                           </div>
251                           <div>
252                             <a href="{% url 'download_zip_ogg' book.slug %}" class="l-button l-button--media l-button--media--full">.ogg</a>
253                           </div>
254                         </div>
255                       {% endif %}
256                       {% if book.has_daisy_file %}
257                         <div class="c-media__popup__box__item">
258                           <div>
259                             <h3>DAISY</h3>
260                             <p>Format dla osób z dysfunkcjami czytania.</p>
261                           </div>
262                           <div>
263                             {% for dsy in book.media_daisy %}
264                               <a href="{{ dsy.file.url }}" class="l-button l-button--media l-button--media--full">DAISY</a>
265                             {% endfor %}
266                           </div>
267                         </div>
268                       {% endif %}
269                       {% if book.has_synchro_file %}
270                         <div class="c-media__popup__box__item">
271                           <div>
272                             <h3>synchrobook</h3>
273                             <p>Książka elektroniczna i audiobook w jednym. Wymaga aplikacji obsługującej format.</p>
274                           </div>
275                           <div>
276                             <a href="#" class="l-button l-button--media l-button--media--full">synchrobook</a>
277                           </div>
278                         </div>
279                       {% endif %}
280                     </div>
281                     <button class="c-media__popup__close">
282                       <img src="{% static '2022/images/close.svg' %}" alt="Zamknij">
283                     </button>
284                   </div>
285                 </div>
286               {% endif %}
287             </div>
288
289             <h3>Opis</h3>
290             {{ book.abstract|safe }}
291           </article>
292         </div>
293       </section>
294       <section class="l-section">
295         <div class="c-support">
296           <h2>Ta książka jest dostępna dla tysięcy dzieciaków dzięki darowiznom od osób takich jak Ty!</h2>
297           <figure>
298             <img src="{% static '2022/images/img-1.jpg' %}" alt="Dorzuć się!">
299             <a href="/towarzystwo/">Dorzuć się!</a>
300           </figure>
301         </div>
302       </section>
303
304       {% for author in book.authors %}
305         <section class="l-section">
306           <div class="l-author">
307             <div class="row">
308               <h2>O autorze</h2>
309               <div>
310                 {% if author.photo %}
311                   <figure class="l-author__photo">
312                     <img src="{{ author.photo.url }}" alt="{{ author.name }}" style="width: 238px;">
313                     <figcaption>
314                       {{ author.photo_attribution|safe }}
315                     </figcaption>
316                   </figure>
317                 {% endif %}
318                 <article class="l-author__info">
319                   <h3>{{ author.name }}</h3>
320                   {{ author.description|safe }}
321                 </article>
322               </div>
323             </div>
324
325             <div class="row">
326               <div class="l-author__quotes">
327                 <div class="l-author__quotes__slider">
328                   {% choose_cites book 3 as cites %}
329                   {% for fragment in cites %}
330                     <div class="l-author__quotes__slider__item">
331                       <em>
332                         {{ fragment.short_text|safe }}
333                       </em>
334                       <p>{{ fragment.book.pretty_title }}</p>
335                     </div>
336                   {% endfor %}
337                 </div>
338               </div>
339             </div>
340           </div>
341         </div>
342       </section>
343       {% endfor %}
344
345       <section class="l-section">
346         <div class="l-themes__wrapper">
347           {% with book.related_themes as themes %}
348             {% if themes %}
349               <h2>Motywy występujące w tym utworze <a href="/katalog/motyw/"><span>Wszystkie motywy</span> <i class="icon icon-arrow-right"></i></a></h2>
350               <div class="l-themes">
351                 <ul>
352                   {% for item in themes %}
353                     <li><a href="{% url 'book_fragments' book.slug item.slug %}">{{ item|lower }}&nbsp;({{ item.count}})</a></li>
354                   {% endfor %}
355                 </ul>
356               </div>
357             {% endif %}
358           {% endwith %}
359           <ul class="links">
360             <li>
361               <a href="{{ book.xml_url }}">źródłowy plik XML</a>
362             </li>
363             <li>
364               <a target="_blank" href="{% url 'poem_from_book' book.slug %}">miksuj treść utworu</a>
365             </li>
366             <li>
367               <a target="_blank" href="{{ book.get_extra_info_json.about }}">utwór na Platformie Redakcyjnej</a>
368             </li>
369           </ul>
370         </div>
371       </section>
372     </main>
373
374
375
376
377
378     <section class="l-section">
379       <div class="l-books__wrapper">
380         <div class="l-container">
381           <h2>Tytuły powiązane</h2>
382           <div class="l-books">
383             {% if book.other_versions %}
384               {% for rel in book.other_versions %}
385                 <article class="l-books__item">
386                   <figure class="l-books__item__img">
387                     <a href="{{ rel.get_absolute_url }}">
388                       <img src="{% if rel.cover %}{{ rel.cover.url }}{% endif %}" alt="{{ rel.pretty_title }}">
389                     </a>
390                   </figure>
391                   <h3>
392                     {% for author in rel.authors %}
393                       <a href="{{ author.get_absolute_url }}">{{ author }}</a>
394                     {% endfor %}
395                   </h3>
396                   <h2><a href="{{ rel.get_absolute_url }}">{{ rel.title }}</a></h2>
397                 </article>
398               {% endfor %}
399             {% endif %}
400
401
402             {% related_books_2021 book taken=book.other_versions|length as related_books %}
403             {% for rel in related_books %}
404               <article class="l-books__item">
405                 <figure class="l-books__item__img">
406                   <a href="{{ rel.get_absolute_url }}">
407                     <img src="{% if rel.cover %}{{ rel.cover.url }}{% endif %}" alt="{{ rel.pretty_title }}">
408                   </a>
409                 </figure>
410                 <h3>
411                   {% for author in rel.authors %}
412                     <a href="{{ author.get_absolute_url }}">{{ author|upper }}</a>
413                   {% endfor %}
414                 </h3>
415                 <h2><a href="{{ rel.get_absolute_url }}">{{ rel.title }}</a></h2>
416               </article>
417             {% endfor %}
418
419             <article class="l-books__item l-books__item--link">
420               <a href="/katalog/kolekcje/">i wiele innych książek, wierszy, obrazów, audiobooków…</a>
421               <a href="/katalog/kolekcje/" class="icon-link"><i class="icon icon-all"></i></a>
422             </article>
423
424           </div>
425         </div>
426       </div>
427     </section>
428
429     <div class="l-footer">
430       <div class="l-container">
431         <div class="l-footer__row">
432           <a href="#"><img src="{% static '2022/images/FNP-logo.png' %}" alt="FUNDACJA Nowoczesna Polska"></a>
433           <ul>
434             <li>ul. Marszałkowska 84/92 lok. 125</li>
435             <li>00-514 Warszawa</li>
436           </ul>
437           <ul class="teal">
438             <li>tel. <a href="#">(22) 621 30 17</a></li>
439             <li>email <a href="#">fundacja@nowoczesnapolska.org.pl</a></li>
440           </ul>
441         </div>
442         <div class="l-footer__row">
443           <div>
444             Wolne Lektury to projekt prowadzony przez fundację <a href="#">Nowoczesna Polska</a>. <br>
445             Hosting: <a href="#">ICM</a>.
446           </div>
447           <div>
448             <a href="#"><img src="{% static '2022/images/MKiDN.png' %}" alt="MKiDN"></a>
449           </div>
450           <div>
451             Strona biblioteki Wolne Lektury powstała dzięki dofinansowaniu ze środków Ministra <a href="#">Kultury i Dziedzictwa Narodowego</a>
452             pochodzących z <a href="#">Funduszu Promocji Kultury</a> – państwowego funduszu celowego.
453           </div>
454         </div>
455       </div>
456     </div>
457
458     <script src="{% static '2022/scripts/vendor.js' %}"></script>
459     <script src="{% static '2022/scripts/main.js' %}"></script>
460     {% javascript '2022_player' %}
461   </body>
462 </html>