]> git.0d.be Git - panikdb.git/blob - panikdb/templates/emissions/episode_detail.html
settings: add flag to enable/disable soma support
[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" href="add-soundfile" rel="popup">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 and not diffusion|is_already_in_soma %}
68 <a href="diffusion/{{ diffusion.id }}/remove" class="icon-remove-sign" title="Retirer"></a>
69 {% endif %}
70 {% if soundfiles|integral and perms.nonstop.add_track and diffusion.datetime|date:"Y-m-d H:i" > now %}
71   {% if has_soma %}
72   {% if not diffusion|is_already_in_soma %}
73   <a href="{% url 'nonstop-add-diffusion' pk=diffusion.id %}">[programmer dans soma]</a>
74   {% else %}
75   (diffusion déjà programmée dans soma)
76   <!-- diffusion/{{ diffusion.id }}/remove -->
77   {% endif %}
78   {% endif %}
79 {% endif %}
80 </li>
81 {% endfor %}
82 </ul>
83
84
85 <h3>Sons</h3>
86
87 <table id="soundfiles">
88 <thead>
89 <tr>
90  <th>Fichier</th>
91  <th>Titre</th>
92  <th>Durée</th>
93  <th>Format</th>
94  <th>Podcastable?</th>
95  <th>Fragment?</th>
96  <th>Nb d'écoutes</th>
97  {% if can_manage %}<th>Modifier</th>{% endif %}
98  {% if can_manage %}<th>Supprimer</th>{% endif %}
99  {% if perms.emissions.add_focus %}<th>Focus</th>{% endif %}
100 </thead>
101 <tbody>
102 {% for soundfile in soundfiles %}
103 <tr>
104 <td><a href="{{ soundfile.file.url }}">{{ soundfile|sound_filename }}</a></td>
105 <td>{{ soundfile.title }}</td>
106 <td>{{ soundfile.duration|as_duration }}</td>
107 <td>{% if soundfile.format %}{{ soundfile.format }}{% else %}-{% endif %}</td>
108 <td>{% if soundfile.podcastable %}oui{% else %}non{% endif %}</td>
109 <td>{% if soundfile.fragment %}oui{% else %}non{% endif %}</td>
110 <td>{{ soundfile|nb_visits }}</td>
111 {% if can_manage %}<td><a href="sounds/{{ soundfile.id }}/"
112                 class="icon-edit" rel="popup" title="Modifier"></a></td>{% endif %}
113 {% if can_manage %}<td><a href="sounds/{{ soundfile.id }}/remove"
114                 class="icon-remove-sign" rel="popup" title="Retirer"></a></td>{% endif %}
115 {% if perms.emissions.add_focus %}
116 <td>
117 {% if soundfile|has_focus %}
118 ✓ <a class="icon-pushpin" href="{{ soundfile|unset_focus_url }}">retirer</a>
119 {% else %}
120   {% if soundfile.format %}
121   <a class="icon-pushpin" href="{{ soundfile|set_focus_url }}">mettre</a>
122   {% endif %}
123 {% endif %}
124 </td>
125 {% endif %}
126 {% endfor %}
127 </tbody>
128 </table>
129
130 {% endblock %}
131
132
133 {% block page-end %}
134 <script>
135 $(function() {
136   $('.image img').click(function() { $(this).toggleClass('large'); });
137
138   $('#id_fragment').change(function() {
139     if (this.checked) {
140       $('#id_title').parent().show();
141     } else {
142       $('#id_title').parent().hide();
143     }
144   });
145
146 });
147 </script>
148 {% endblock %}