Remove jsonfield dependency.
[audio.git] / src / archive / templates / archive / file_managed.html
1 {% extends "archive/base.html" %}
2 {% load i18n %}
3 {% load tags %}
4 {% load bootstrap4 %}
5
6 {% block content %}
7
8
9
10 <div class="card mt-4">
11   <div class="card-header">
12     <h2>{% trans "Publishing" %}</h2>
13   </div>
14   <div class="card-body">
15     {% if audiobook.mp3_status or audiobook.ogg_status %}
16       <h2>{% trans "Publishing pending" %}</h2>
17       <form method="post" action="{% url 'cancel_publishing' audiobook.id %}">
18         {% csrf_token %}
19         <input class='btn btn-danger' type="submit" value="{% trans "Cancel publishing" %}" />
20       </form>
21
22       {% if audiobook.mp3_status %}
23         <hr/>
24         <h2>MP3</h2>
25
26         {% tags_table audiobook.get_mp3_tags.tags %}
27
28         <p>Status: <b>{{ audiobook.get_mp3_status_display }}</b></p>
29       {% endif %}
30
31       {% if audiobook.ogg_status %}
32         <hr/>
33         <h2>Ogg Vorbis</h2>
34
35         {% tags_table audiobook.get_ogg_tags.tags %}
36
37         <p>Status: <b>{{ audiobook.get_ogg_status_display }}</b></p>
38       {% endif %}
39
40     {% else %}
41
42       <table class='table'>
43         {% tags_table audiobook.new_publish_tags 0 %}
44         <tr><th></th><td>
45
46           {% if user_can_publish %}
47             <form method="post" action="{% url 'publish' audiobook.id %}">
48               {% csrf_token %}
49               <input class="btn btn-primary" type="submit" value="{% trans "Publish" %}" />
50             </form>
51           {% else %}
52             <a class="btn btn-primary" href="{% url 'apiclient_oauth' %}">Podłącz się</a>
53           {% endif %}
54
55           {% if not audiobook.mp3_published or not audiobook.ogg_published %}
56             <form class="mt-3" method="post" action="{% url 'convert' audiobook.id %}">
57               {% csrf_token %}
58               <input class="btn btn-secondary" type="submit" value="{% trans "Convert without publishing" %}" />
59             </form>
60             {% endif %}
61               </div>
62               </div>
63
64         </td></tr>
65       </table>
66     {% endif %}
67   </div>
68 </div>
69
70
71 <div class="row">
72   <div class="col-xl-6">
73     <div class="card mt-4">
74       <div class="card-header">
75         <h2>{% trans "MP3 file" %}</h2>
76       </div>
77       <div class="card-body">
78         {% if audiobook.mp3_file %}
79           <p><a href="{% url 'download' audiobook.id 'mp3' %}">{% trans "Download MP3 file." %}</a></p>
80           {% if audiobook.mp3_published %}
81             <p>{% trans "Published:" %} {{ audiobook.mp3_published }}</a></p>
82             {% if audiobook.get_mp3_published_tags.tags %}
83               {% tags_table audiobook.get_mp3_published_tags.tags %}
84             {% endif %}
85           {% else %}
86             <p>{% trans "Not published yet." %}</p>
87           {% endif %}
88         {% else %}
89           <p>{% trans "MP3 file hasn't been generated yet." %}</p>
90         {% endif %}
91       </div>
92     </div>
93   </div>
94
95   <div class="col-xl-6">
96     <div class="card mt-4">
97       <div class="card-header">
98         <h2>{% trans "Ogg Vorbis file" %}</h2>
99       </div>
100       <div class="card-body">
101         {% if audiobook.ogg_file %}
102           <p><a href="{% url 'download' audiobook.id 'ogg' %}">{% trans "Download Ogg Vorbis file." %}</a></p>
103           {% if audiobook.ogg_published %}
104             <p>{% trans "Published:" %} {{ audiobook.ogg_published }}</a></p>
105             {% if audiobook.get_ogg_published_tags.tags %}
106               {% tags_table audiobook.get_ogg_published_tags.tags %}
107             {% endif %}
108           {% else %}
109             <p>{% trans "Not published yet." %}</p>
110           {% endif %}
111         {% else %}
112           <p>{% trans "Ogg Vorbis file hasn't been generated yet." %}</p>
113         {% endif %}
114       </div>
115     </div>
116   </div>
117
118   <div class="col-xl-6">
119     <div class="card mt-4">
120       <div class="card-header">
121         <h2>Plik źródłowy</h2>
122       </div>
123       <div class="card-body">
124         <p>Last modified: {{ audiobook.modified }}</p>
125         <p>Plik źródłowy: <a href='{% url "download" audiobook.id %}'>{{ path }}</a>
126           (sha1: <tt>{{ audiobook.source_sha1 }}</tt>).
127         </p>
128         {% multiple_tags_table tags %}
129
130         <form method="post" action="{% url 'remove_to_archive' audiobook.id %}"
131               onsubmit='return confirm("{% trans "Are you sure you want to move this audiobook to archive?" %}")'>
132           {% csrf_token %}
133           <input class="btn btn-danger" type="submit" value="{% trans "Remove to archive" %}" />
134         </form>
135
136       </div>
137     </div>
138   </div>
139
140   <div class="col-xl-6">
141     <div class="card mt-4 mb-4">
142       <div class="card-header">
143         <h2>{% trans "Update tags" %}</h2>
144       </div>
145       <div class="card-body">
146
147         <form method='post' action='.'>
148           {% csrf_token %}
149           {% bootstrap_form form %}
150           <input class="btn btn-primary" type="submit" value='{% trans "Commit" %}' />
151         </form>
152
153       </div>
154     </div>
155   </div>
156 </div>
157
158 {% endblock %}