d710a01b10ad6e7887e01deef403686cd22ca556
[wolnelektury.git] / src / catalogue / templates / catalogue / snippets / 2022_jplayer.html
1 {% load i18n catalogue_tags %}
2
3 {% with audiobooks=book.get_audiobooks %}
4   <div class="c-media__player" id="jp_container_{{ book.pk }}" data-book-slug="{{ book.slug }}">
5     <div class="jp-jplayer" data-player="jp_container_{{ book.pk }}"
6          data-supplied="oga,mp3"></div>
7
8     <div class="c-player__head">
9       <span>&nbsp;</span>
10     </div>
11
12     <div class="c-player">
13       <div class="c-player__btns">
14         <button class="play-prev"><i class="icon icon-prev"></i></button>
15         <button class="c-player__btn--md jp-play"><i class="icon icon-play"></i></button>
16         <button class="play-next"><i class="icon icon-next"></i></button>
17         <div class="c-select speed">
18           <ul>
19             <li data-speed="2">2×</li>
20             <li data-speed="1.75">1.75×</li>
21             <li data-speed="1.5">1.5×</li>
22             <li data-speed="1.25">1.25×</li>
23             <li data-speed="1" class="is-active">1×</li>
24             <li data-speed="0.75">0.75×</li>
25             <li data-speed="0.5">0.5×</li>
26           </ul>
27         </div>
28       </div>
29
30       <div class="c-player__timeline">
31         <div class="c-player__info"></div>
32         <div class="c-player__chapters">
33           <span>Rozdziały</span>
34           <ul class="jp-playlist">
35             {% for i in audiobooks.0 %}
36               <li
37                   data-mp3='{{ i.mp3.file.url }}'
38                   data-ogg='{{ i.ogg.file.url }}'
39                   data-media-id="{{ i.mp3.id }}"
40                   data-duration="{{ i.mp3.duration }}"
41               >
42                 {% with extra_info=i.mp3.get_extra_info_json %}
43                   <span class="title">
44                     {{ i.mp3.part_name }}
45                   </span>
46                   <span class="attribution">
47                     {% trans "Artist:" %}&nbsp;<span class='artist'>{{ extra_info.artist_name }}</span>,
48                     {% trans "director:" %}&nbsp;<span class='director'>{{ extra_info.director_name }}</span>
49                   </span>
50                   <span class="license">
51                     {% if extra_info.license %}{% license_icon extra_info.license %}{% endif %}
52                   </span>
53                   <span class="project-icon">
54                     {% if i.mp3.project_icon %}<img class="project-icon" src="{{ i.mp3.project_icon }}">{% endif %}
55                   </span>
56                   <span class="project-description">
57                     {% if i.mp3.project_description %}{{ i.mp3.project_description }}{% else %}
58                       {% with fb=extra_info.funded_by %}
59                         {% if fb %}Dofinansowano ze środków: {{ fb }}.{% endif %}
60                       {% endwith %}
61                     {% endif %}
62                   </span>
63                 {% endwith %}
64               </li>
65             {% endfor %}
66           </ul>
67         </div>
68         <span>
69           <span class="jp-seek-bar">
70             <span class="jp-play-bar"></span>
71           </span>
72         </span>
73
74         <time class="c-player__length">
75           <span class="jp-current-time"></span>
76           <span class="time-left">
77           </span>
78           <span class="total-time-left">?</span>
79         </time>
80       </div>
81
82       <div class="c-player__volume">
83         <i class="icon icon-volume jp-mute"></i>
84         <span class="jp-volume-bar">
85           <span class="jp-volume-bar-value">
86           </span>
87         </span>
88       </div>
89
90
91     </div>
92     <div class="c-media__caption">
93       <div class="license"></div>
94       <div class="project-logo"></div>
95       <div class="content"></div>
96     </div>
97   </div>
98 {% endwith %}