]> git.0d.be Git - panikdb.git/blob - panikdb/templates/emissions/episode_detail.html
pige: fix silent file retention policy
[panikdb.git] / panikdb / templates / emissions / episode_detail.html
1 {% extends "emissions/episode_detail.html" %}
2 {% load i18n soundfiles panikdbtags nonstop %}
3
4 {% block diffusions-data %}
5   <div class="bo-block">
6     <h3>{% trans "Diffusions" %}</h3>
7
8     {% now "Y-m-d H:i" as s_now %}
9
10     <ul>
11       {% for diffusion in diffusions %}
12         <li>{{ diffusion.datetime }}
13
14           {% if has_soma %}
15             {% if diffusion|is_already_in_soma %}
16               {% if soundfiles|integral %}({% trans "scheduled for diffusion" %}){% else %}({% trans "stream scheduled for diffusion" %}){% endif %}
17               {% if can_manage %}
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>
21                 {% endif %}
22               {% endif %}
23             {% elif can_manage %}
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>
26               {% endif %}
27
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>
31                 {% endif %}
32               {% endif %}
33             {% endif %}
34           {% endif %}
35           {% if can_manage %}
36             <a href="diffusion/{{ diffusion.id }}/remove" class="icon-remove-sign" title="{% trans "Remove" %}"></a>
37           {% endif %}
38         </li>
39       {% endfor %}
40     </ul>
41   </div>
42 {% endblock %}
43
44 {% block soundfiles-extra-column-headers %}
45   <th>{% trans "Download count" %}</th>
46 {% endblock %}
47
48 {% block soundfiles-extra-action-headers %}
49   {% if perms.emissions.add_focus %}<th>Focus</th>{% endif %}
50 {% endblock %}
51
52 {% block soundfiles-extra-column-cells %}
53   <td>{% if soundfile.external_url %}{% trans "n/a" %}{% else %}{{ soundfile|nb_visits }}{% endif %}</td>
54 {% endblock %}
55
56 {% block soundfiles-extra-action-cells %}
57   {% if perms.emissions.add_focus %}
58     <td>
59       {% if soundfile|has_focus %}
60         ✓ <a class="icon-pushpin" href="{{ soundfile|unset_focus_url }}">retirer</a>
61       {% else %}
62         {% if soundfile.format %}
63           <a class="icon-pushpin" href="{{ soundfile|set_focus_url }}">mettre</a>
64         {% endif %}
65       {% endif %}
66     </td>
67   {% endif %}
68 {% endblock %}
69
70 {% block page-end %}
71   {{ block.super }}
72   <script>
73     $(function() {
74       $('#id_fragment').change(function() {
75         if (this.checked) {
76           $('#id_title').parent().show();
77         } else {
78           $('#id_title').parent().hide();
79         }
80       });
81
82       $(document).on('gadjo:dialog-loaded', function(e, form) {
83         var $select = $('select#id_jingle');
84         var audio = null;
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 + '/');
90           audio.play();
91           return false;
92         });
93       });
94     });
95   </script>
96 {% endblock %}