Easier cutting.
[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" class="edit-youtube-volume" data-audiobook="{{ audiobook.id }}">
68                       {{ audiobook.youtube_volume }}
69                     </span>
70                   </td>
71                   <td>
72                   </td>
73                   <td>
74                   </td>
75                   <td>
76                     {{ audiobook.duration }}
77                   </td>
78                 {% endifchanged %}
79               </tr>
80             {% endfor %}
81           {% endwith %}
82         </tbody>
83       </table>
84       <form method="post" action="{% url 'youtube_book_publish' view.kwargs.slug %}">
85         {% csrf_token %}
86         <button class="btn btn-primary">
87           Opublikuj wszystko na YouTube
88         </button>
89       </form>
90     </div>
91 {% endblock %}