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