d17190f6905939e6ae60dc4f7b326f2d0a6de339
[audio.git] / src / archive / templates / archive / book.html
1 {% extends "archive/base.html" %}
2 {% load i18n %}
3 {% load tags %}
4
5
6 {% block menu-active-audiobooks %}active{% endblock %}
7
8
9 {% block content %}
10   <div class="card mt-4">
11     <div class="card-header">
12       <h2>{{ object_list.0.book.title }}</h2>
13     </div>
14     <div class="card-body">
15       <table class="table">
16         <thead>
17           <tr>
18             <th>{% trans "Index" %}</th>
19             <th>{% trans "Title" %}</th>
20             <th>MP3</th>
21             <th>Ogg</th>
22             <th colspan="5">YouTube</th>
23           </tr>
24         </thead>
25         <tbody>
26           {% with volumes=object_list.0.youtube_volume_count %}
27             {% for audiobook in object_list %}
28               <tr>
29                 <td>{{ audiobook.index }}</td>
30                 <td>
31                   <a href="{% url 'file' audiobook.id %}">
32                     {% if audiobook.part_name %}
33                       {{ audiobook.part_name }}
34                     {% else %}
35                       <em class="text-warning" title="ddd">
36                         ({{ audiobook }})
37                       </em>
38                     {% endif %}
39                   </a>
40                 </td>
41                 <td>{% status audiobook "mp3" %}</td>
42                 <td>{% status audiobook "ogg" %}</td>
43                 {% ifchanged audiobook.youtube_volume_index %}
44                   <td>
45                     {{ audiobook.youtube_volume_index }}/{{ volumes }}
46                   </td>
47                   <td>
48                     <form method="POST" action="{% url 'book_youtube_volume' audiobook.id %}">
49                       {% csrf_token %}
50                       <input name='volume' value="{{ audiobook.youtube_volume }}" class="form-control">
51                     </form>
52                   </td>
53                   <td>
54                     {{ audiobook.total|duration }}
55                   </td>
56                   <td>
57                     {{ audiobook.duration|duration }}
58                   </td>
59                   <td>
60                     {% status audiobook "youtube" %}
61                   </td>
62                 {% else  %}
63                   <td>
64                     –
65                   </td>
66                   <td>
67                     <span class="text-secondary">
68                       <form method="POST" action="{% url 'book_youtube_volume' audiobook.id %}">
69                         {% csrf_token %}
70                         <input name='volume' value="{{ audiobook.youtube_volume }}" class="form-control">
71                       </form>
72                     </span>
73                   </td>
74                   <td>
75                   </td>                      >
76                   <td class="text-secondary">
77                     {{ audiobook.duration|duration }}
78                   </td>
79                   <td>
80                   </td>
81                 {% endifchanged %}
82               </tr>
83             {% endfor %}
84           {% endwith %}
85         </tbody>
86       </table>
87       <form method="post" action="{% url 'youtube_book_publish' view.kwargs.slug %}">
88         {% csrf_token %}
89         <button class="btn btn-primary">
90           Opublikuj wszystko na YouTube
91         </button>
92       </form>
93     </div>
94 {% endblock %}