]> git.0d.be Git - panikdb.git/commitdiff
redefine diffusion block with nonstop scheduling options
authorFrédéric Péters <fpeters@0d.be>
Thu, 27 May 2021 15:28:55 +0000 (17:28 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 27 May 2021 15:28:55 +0000 (17:28 +0200)
panikdb/templates/emissions/episode_detail.html

index 97e897d6ed6c04d0bb619fa01c335035d3e35029..92a4cb7ad7b5683c27a46e54b5561f2d85de3049 100644 (file)
@@ -1,6 +1,46 @@
 {% extends "emissions/episode_detail.html" %}
 {% load i18n soundfiles panikdbtags nonstop %}
 
+{% block diffusions-data %}
+<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 %}({% trans "scheduled for diffusion" %}){% else %}({% trans "stream scheduled for diffusion" %}){% endif %}
+    {% if can_manage %}
+      <a rel="popup" href="{% url 'nonstop-diffusion-properties' pk=diffusion.scheduleddiffusion_set.first.id %}">{% trans "[diffusion options]" %}</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 %}">{% trans "[remove 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 %}">{% trans "[schedule 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 %}">{% trans "[schedule a 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>
+{% endblock %}
+
 {% block soundfiles-data %}
 <div class="bo-block">
 <h3>{% trans "Soundfiles" %}</h3>