{% 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>