]> git.0d.be Git - panikdb.git/commitdiff
templates: do not duplicate all of episode details template
authorFrédéric Péters <fpeters@0d.be>
Thu, 27 May 2021 11:32:37 +0000 (13:32 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 27 May 2021 11:32:37 +0000 (13:32 +0200)
panikdb/templates/emissions/episode_detail.html

index dff3ddc524a1f8e97a670114981cb2feb82a3f86..acf3664e26051afc6e91c462f66ae1ae3710e4ac 100644 (file)
@@ -1,102 +1,7 @@
-{% extends "base.html" %}
+{% extends "emissions/episode_detail.html" %}
 {% load i18n soundfiles panikdbtags nonstop %}
-{% block appbar %}
-<h2>{{ episode.emission.title }} — {{ episode.title }}</h2>
-<span class="actions"><a href="../">{% trans "Back to emission" %}</a></span>
-{% endblock %}
-
-{% block content %}
-
-{% if can_manage %}
-<p>
-<a class="button" href="edit/">{% trans "Edit" %}</a>
-{% if perms.emissions.add_diffusion %}
-<a class="button" href="add-diffusion" rel="popup">{% trans "Add a diffusion" %}</a>
-{% endif %}
-<a class="button" href="add-soundfile" rel="popup">{% trans "Add a sound" %}</a>
-{% if episode.effective_start and episode.effective_end %}
-  {% if internal_ip %}
-  <a class="button" id="download-recording" download href="{{ episode.get_pige_download_url }}">{% trans "Download recording" %}</a>
-  {% endif %}
-{% elif not soundfiles and 0 %}
-  {% if episode.effective_start %}
-    <a class="button" id="stop-recording" href="stop">{% trans "Stop recording" %}</a>
-  {% else %}
-    <a class="button" id="start-recording" href="start">{% trans "Start recording" %}</a>
-  {% endif %}
-{% endif %}
-<a class="button actually-not-that-friendly" rel="popup" href="delete/">{% trans "Delete" %}</a>
-</p>
-{% endif %}
-
-{% if episode.subtitle %}
-<div class="description">
-{{ episode.subtitle|safe }}
-</div>
-{% endif %}
-
-{% if episode.image %}
-<div class="image">
-  <img src="{{ episode.image.url }}"/>
-</div>
-{% endif %}
-
-<div class="bo-block">
-{% if episode.text %}
-<div class="text">
-{{ episode.text|safe }}
-</div>
-{% endif %}
-
-{% if episode.tags.all %}
-<p>
-{% trans "Tags:" %}
-{% for tag in episode.tags.all %}
-  <span class="tag">{{ tag }}</span>{% if not forloop.last %}, {% endif %}
-{% endfor %}
-</p>
-{% endif %}
-</div>
-
-
-<div class="bo-block">
-<h3>{% trans "Diffusions" %}</h3>
-
-{% now "Y-m-d H:i" as s_now %}
-
-<ul>
-{% for diffusion in diffusions %}
-<li>{{ diffusion.datetime }}
-
-{% if has_soma %}
-  {% if diffusion|is_already_in_soma %}
-    {% if soundfiles|integral %}(diffusion programmée){% else %}(stream programmé){% endif %}
-    {% if can_manage %}
-      <a rel="popup" href="{% url 'nonstop-diffusion-properties' pk=diffusion.scheduleddiffusion_set.first.id %}">[options de diffusion]</a>
-      {% if perms.nonstop.add_streameddiffusion and not soundfiles|integral and diffusion.end_datetime|date:"Y-m-d H:i" > s_now %}
-      <a href="{% url 'nonstop-del-diffusion' pk=diffusion.id %}">[supprimer stream]</a>
-      {% endif %}
-    {% endif %}
-  {% elif can_manage %}
-    {% if diffusion.datetime|date:"Y-m-d H:i" > s_now and soundfiles|integral %}
-      <a rel="popup" href="{% url 'nonstop-add-diffusion' pk=diffusion.id %}">[programmer la diffusion]</a>
-    {% endif %}
-
-    {% if perms.nonstop.add_streameddiffusion and diffusion.end_datetime|date:"Y-m-d H:i" > s_now %}
-      {% if forloop.first and not soundfiles|integral %}
-      <a rel="popup" href="{% url 'nonstop-add-diffusion' pk=diffusion.id %}">[programmer un stream]</a>
-      {% endif %}
-    {% endif %}
-  {% endif %}
-{% endif %}
-{% if can_manage %}
-<a href="diffusion/{{ diffusion.id }}/remove" class="icon-remove-sign" title="{% trans "Remove" %}"></a>
-{% endif %}
-</li>
-{% endfor %}
-</ul>
-</div>
 
+{% block soundfiles-data %}
 <div class="bo-block">
 <h3>{% trans "Soundfiles" %}</h3>
 
 </tbody>
 </table>
 </div>
-
 {% endblock %}
 
-
 {% block page-end %}
+{{ block.super }}
 <script>
 $(function() {
-  $('.image img').click(function() { $(this).toggleClass('large'); });
-
   $('#id_fragment').change(function() {
     if (this.checked) {
       $('#id_title').parent().show();
@@ -172,7 +74,6 @@ $(function() {
       return false;
     });
   });
-
 });
 </script>
 {% endblock %}