]> git.0d.be Git - panikdb.git/blob - panikdb/templates/emissions/episode_detail.html
32d0ba489a71d94377f67f0433b2b0ad8b710df4
[panikdb.git] / panikdb / templates / emissions / episode_detail.html
1 {% extends "base.html" %}
2 {% load soundfiles panikdbtags nonstop %}
3 {% block appbar %}
4 <h2>{{ episode.emission.title }} — {{ episode.title }}</h2>
5 <span><a href="../">Retourner à l'émission</a></span>
6 {% endblock %}
7
8 {% block content %}
9
10 {% if can_manage %}
11 <p>
12 <a class="button" href="edit/">Modifier</a>
13 {% if perms.emissions.add_diffusion %}
14 <a class="button" href="add-diffusion" rel="popup">Ajouter une diffusion</a>
15 {% endif %}
16 <a class="button" id="add-soundfile-link" href="#">Ajouter un son</a>
17 {% if episode.effective_start and episode.effective_end %}
18   {% if internal_ip %}
19   <a class="button" id="download-recording" download href="{{ episode.get_pige_download_url }}">Télécharger l'enregistrement</a>
20   {% endif %}
21 {% elif not soundfiles %}
22   {% if episode.effective_start %}
23     <a class="button" id="stop-recording" href="stop">Arrêter l'enregistrement</a>
24   {% else %}
25     <a class="button" id="start-recording" href="start">Démarrer l'enregistrement</a>
26   {% endif %}
27 {% endif %}
28 <a class="button actually-not-that-friendly" href="delete/" rel="popup">Supprimer</a>
29 </p>
30 {% endif %}
31
32 {% if episode.subtitle %}
33 <div class="description">
34 {{ episode.subtitle|safe }}
35 </div>
36 {% endif %}
37
38 {% if episode.image %}
39 <div class="image">
40   <img src="{{ episode.image.url }}"/>
41 </div>
42 {% endif %}
43
44 {% if episode.text %}
45 <div class="text">
46 {{ episode.text|safe }}
47 </div>
48 {% endif %}
49
50 {% if episode.tags.all %}
51 <p>
52 Tags :
53 {% for tag in episode.tags.all %}
54   <span class="tag">{{ tag }}</span>{% if not forloop.last %}, {% endif %}
55 {% endfor %}
56 </p>
57 {% endif %}
58
59
60 <h3>Diffusions</h3>
61
62 {% now "Y-m-d H:i" as now %}
63
64 <ul>
65 {% for diffusion in diffusions %}
66 <li>{{ diffusion.datetime }}
67 {% if can_manage and perms.emissions.delete_diffusion %}
68 <a href="diffusion/{{ diffusion.id }}/remove" class="icon-remove-sign" title="Retirer"></a>
69 {% endif %}
70 {% if soundfiles and perms.nonstop.add_track and diffusion.datetime|date:"Y-m-d H:i" > now and not diffusion|is_already_in_soma %}
71 <a href="{% url 'nonstop-add-diffusion' pk=diffusion.id %}">[programmer dans soma]</a>
72 {% endif %}
73 </li>
74 {% endfor %}
75 </ul>
76
77
78 <h3>Sons</h3>
79
80 <table id="soundfiles">
81 <thead>
82 <tr>
83  <th>Fichier</th>
84  <th>Titre</th>
85  <th>Durée</th>
86  <th>Format</th>
87  <th>Podcastable?</th>
88  <th>Fragment?</th>
89  <th>Nb d'écoutes</th>
90  {% if can_manage %}<th>Modifier</th>{% endif %}
91  {% if can_manage %}<th>Supprimer</th>{% endif %}
92  {% if perms.emissions.add_focus %}<th>Focus</th>{% endif %}
93 </thead>
94 <tbody>
95 {% for soundfile in soundfiles %}
96 <tr>
97 <td><a href="{{ soundfile.file.url }}">{{ soundfile|sound_filename }}</a></td>
98 <td>{{ soundfile.title }}</td>
99 <td>{{ soundfile.duration|as_duration }}</td>
100 <td>{% if soundfile.format %}{{ soundfile.format }}{% else %}-{% endif %}</td>
101 <td>{% if soundfile.podcastable %}oui{% else %}non{% endif %}</td>
102 <td>{% if soundfile.fragment %}oui{% else %}non{% endif %}</td>
103 <td>{{ soundfile|nb_visits }}</td>
104 {% if can_manage %}<td><a href="sounds/{{ soundfile.id }}/"
105                 class="icon-edit" rel="popup" title="Modifier"></a></td>{% endif %}
106 {% if can_manage %}<td><a href="sounds/{{ soundfile.id }}/remove"
107                 class="icon-remove-sign" rel="popup" title="Retirer"></a></td>{% endif %}
108 {% if perms.emissions.add_focus %}
109 <td>
110 {% if soundfile.has_focus %}
111 ✓ <a class="icon-pushpin" href="{{ soundfile|unset_focus_url }}">retirer</a>
112 {% else %}
113   {% if soundfile.format %}
114   <a class="icon-pushpin" href="{{ soundfile|set_focus_url }}">mettre</a>
115   {% endif %}
116 {% endif %}
117 </td>
118 {% endif %}
119 {% endfor %}
120 </tbody>
121 </table>
122
123 <form id="add-soundfile-form" action="add-soundfile" method="POST" style="display: none;">
124 {% csrf_token %}
125 {{ add_soundfile_form.as_p }}
126 <button>Ajouter ce son</button>
127 <button class="cancel">Annuler</button>
128 </form>
129
130 {% endblock %}
131
132
133 {% block page-end %}
134 <script>
135 $(function() {
136   $('#add-soundfile-link').click(
137     function() {
138       $('#id_title').parent().hide();
139       $('#add-soundfile-form').dialog({modal: true, title: 'Son', width: 'auto'});
140     });
141
142   $('.image img').click(function() { $(this).toggleClass('large'); });
143
144   $('#id_fragment').change(function() {
145     if (this.checked) {
146       $('#id_title').parent().show();
147     } else {
148       $('#id_title').parent().hide();
149     }
150   });
151
152   $('button.cancel').click(function() {
153     $(this).parent().dialog('close');
154     return false;
155   });
156 });
157 </script>
158 {% endblock %}