episode_detail.html 3.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{% extends "base.html" %}
{% load soundfiles panikdbtags %}
{% block appbar %}
<h2>{{ episode.emission.title }} — {{ episode.title }}</h2>
<span><a href="../">Retourner à l'émission</a></span>
{% endblock %}

{% block content %}

{% if can_manage %}
<p>
<a class="big-friendly-button" href="edit/">Modifier</a>
<a class="big-friendly-button" id="add-diffusion-link" href="#">Ajouter une diffusion</a>
<a class="big-friendly-button" id="add-soundfile-link" href="#">Ajouter un son</a>
<a class="big-friendly-button actually-not-that-friendly" href="delete/">Supprimer</a>
</p>
{% endif %}

{% if episode.subtitle %}
<div class="description">
{{ episode.subtitle|safe }}
</div>
{% endif %}

{% if episode.image %}
<div class="image">
  <img src="{{ episode.image.url }}"/>
</div>
{% endif %}

{% if episode.text %}
<div class="text">
{{ episode.text|safe }}
</div>
{% endif %}

{% if episode.tags.all %}
<p>
Tags :
{% for tag in episode.tags.all %}
  <span class="tag">{{ tag }}</span>{% if not forloop.last %}, {% endif %}
{% endfor %}
</p>
{% endif %}


<h3>Diffusions</h3>

<ul>
{% for diffusion in diffusions %}
<li>{{ diffusion.datetime }}
{% if can_manage %}
<a href="diffusion/{{ diffusion.id }}/remove" class="icon-remove-sign" title="Retirer"></a>
{% endif %}
</li>
{% endfor %}
</ul>

<form id="add-diffusion-form" action="add-diffusion" method="POST" style="display: none;">
{% csrf_token %}
{{ add_diffusion_form.as_p }}
<input type="submit" value="Ajouter cet horaire"/>
<button class="cancel">Annuler</button>
</form>



<h3>Sons</h3>

<table id="soundfiles">
<thead>
<tr>
 <th>Fichier</th>
 <th>Titre</th>
 <th>Format</th>
 <th>Podcastable?</th>
 <th>Fragment?</th>
 {% if can_manage %}<th>Modifier</th>{% endif %}
 {% if can_manage %}<th>Supprimer</th>{% endif %}
 {% if perms.emissions.add_focus %}<th>Focus</th>{% endif %}
</thead>
<tbody>
{% for soundfile in soundfiles %}
<tr>
<td><a href="{{ soundfile.file.url }}">{{ soundfile|sound_filename }}</a></td>
<td>{{ soundfile.title }}</td>
87
88
89
<td>{% if soundfile.format %}{{ soundfile.format }}{% else %}-{% endif %}</td>
<td>{% if soundfile.podcastable %}oui{% else %}non{% endif %}</td>
<td>{% if soundfile.fragment %}oui{% else %}non{% endif %}</td>
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{% if can_manage %}<td><a href="sounds/{{ soundfile.id }}/"
		class="icon-edit" title="Modifier"></a></td>{% endif %}
{% if can_manage %}<td><a href="sounds/{{ soundfile.id }}/remove"
		class="icon-remove-sign" title="Retirer"></a></td>{% endif %}
{% if perms.emissions.add_focus %}
<td>
{% if soundfile.has_focus %}
<a class="icon-pushpin" href="{{ soundfile|unset_focus_url }}">retirer</a>
{% else %}
<a class="icon-pushpin" href="{{ soundfile|set_focus_url }}">mettre</a>
{% endif %}
</td>
{% endif %}
{% endfor %}
</tbody>
</table>

<form id="add-soundfile-form" action="add-soundfile" method="POST" style="display: none;">
{% csrf_token %}
{{ add_soundfile_form.as_p }}
<input type="submit" value="Ajouter ce son"/>
<button class="cancel">Annuler</button>
</form>

{% endblock %}


{% block page-end %}
<script>
$(function() {
  $('#add-soundfile-link').click(
    function() {
      $('#id_title').parent().hide();
      $('#add-soundfile-form').dialog({modal: true, title: 'Son', width: 'auto'});
    });

  $('#add-diffusion-link').click(
    function() {
      $('#add-diffusion-form').dialog({modal: true, title: 'Horaire', width: 'auto'});
    });

  $('.image img').click(function() { $(this).toggleClass('large'); });

  $('#id_fragment').change(function() {
    if (this.checked) {
      $('#id_title').parent().show();
    } else {
      $('#id_title').parent().hide();
    }
  });

  $('button.cancel').click(function() {
    $(this).parent().dialog('close');
    return false;
  });
});
</script>
{% endblock %}