1 {% extends "emissions/episode_detail.html" %}
2 {% load i18n soundfiles panikdbtags nonstop %}
4 {% block diffusions-data %}
6 <h3>{% trans "Diffusions" %}</h3>
8 {% now "Y-m-d H:i" as s_now %}
11 {% for diffusion in diffusions %}
12 <li>{{ diffusion.datetime }}
15 {% if diffusion|is_already_in_soma %}
16 {% if soundfiles|integral %}({% trans "scheduled for diffusion" %}){% else %}({% trans "stream scheduled for diffusion" %}){% endif %}
18 <a rel="popup" href="{% url 'nonstop-diffusion-properties' pk=diffusion.scheduleddiffusion_set.first.id %}">{% trans "[diffusion options]" %}</a>
19 {% if perms.nonstop.add_scheduleddiffusion and not soundfiles|integral and diffusion.end_datetime|date:"Y-m-d H:i" > s_now %}
20 <a href="{% url 'nonstop-del-diffusion' pk=diffusion.id %}">{% trans "[remove stream]" %}</a>
24 {% if diffusion.datetime|date:"Y-m-d H:i" > s_now and soundfiles|integral %}
25 <a rel="popup" href="{% url 'nonstop-add-diffusion' pk=diffusion.id %}">{% trans "[schedule diffusion]" %}</a>
28 {% if perms.nonstop.add_scheduleddiffusion and diffusion.end_datetime|date:"Y-m-d H:i" > s_now %}
29 {% if forloop.first and not soundfiles|integral %}
30 <a rel="popup" href="{% url 'nonstop-add-diffusion' pk=diffusion.id %}">{% trans "[schedule a stream]" %}</a>
36 <a href="diffusion/{{ diffusion.id }}/remove" class="icon-remove-sign" title="{% trans "Remove" %}"></a>
44 {% block soundfiles-extra-column-headers %}
45 <th>{% trans "Download count" %}</th>
48 {% block soundfiles-extra-action-headers %}
49 {% if perms.emissions.add_focus %}<th>Focus</th>{% endif %}
52 {% block soundfiles-extra-column-cells %}
53 <td>{% if soundfile.external_url %}{% trans "n/a" %}{% else %}{{ soundfile|nb_visits }}{% endif %}</td>
56 {% block soundfiles-extra-action-cells %}
57 {% if perms.emissions.add_focus %}
59 {% if soundfile|has_focus %}
60 ✓ <a class="icon-pushpin" href="{{ soundfile|unset_focus_url }}">retirer</a>
62 {% if soundfile.format %}
63 <a class="icon-pushpin" href="{{ soundfile|set_focus_url }}">mettre</a>
74 $('#id_fragment').change(function() {
76 $('#id_title').parent().show();
78 $('#id_title').parent().hide();
82 $(document).on('gadjo:dialog-loaded', function(e, form) {
83 var $select = $('select#id_jingle');
85 $select.css('width', '80%').css('margin-right', '1em').after('<button id="play-jingle">▸</button>');
86 $('#play-jingle').on('click', function() {
87 var val = $select.val();
88 if (audio) { audio.pause(); }
89 audio = new Audio('/nonstop/api/jingle/' + val + '/');