home.html 4.96 KB
Newer Older
fred's avatar
fred committed
1 2
{% extends "base.html" %}

fred's avatar
fred committed
3 4
{% block bodyargs %}class="home"{% endblock %}

5
{% block appbar %}
fred's avatar
fred committed
6
{% if perms.emissions.change_emission %}
fred's avatar
fred committed
7 8 9
<span><a href="{% url 'emission-list' %}">Toutes les émissions</a>
-
<a href="{% url 'news-list' %}">Toutes les actus</a></span>
10 11
{% endif %}
{% endblock %}
fred's avatar
fred committed
12

13
{% block more-user-links %}
fred's avatar
fred committed
14
{{ block.super }}
15 16 17
{% if perms.emissions.add_emission %}
<a href="{% url 'emission-add' %}">Nouvelle émission</a>
{% endif %}
fred's avatar
fred committed
18
{% if perms.newsletter.add_newsletter %}
19 20
<a href="{% url 'newsletter-list' %}">Newsletters</a>
{% endif %}
fred's avatar
fred committed
21 22 23
{% if perms.nonstop.add_track %}
<a href="{% url 'nonstop-quick-links' %}">Gestion nonstop</a>
{% endif %}
24 25
{% endblock %}

26
{% block content %}
fred's avatar
fred committed
27 28

{% if display_poll_button %}
fred's avatar
fred committed
29
<!--
fred's avatar
fred committed
30 31 32
<div class="poll">
	<a href="{% url 'vote' %}">Sondage Logo !</a>
</div>
fred's avatar
fred committed
33
-->
fred's avatar
fred committed
34 35
{% endif %}

36 37
<h2>Émissions</h2>

fred's avatar
fred committed
38
{% for emission in emissions %}
fred's avatar
fred committed
39
<div class="emission block">
40
<h3><a href="{% url 'emission-view' slug=emission.slug %}">{{ emission.title }}</a></h3>
fred's avatar
fred committed
41

fred's avatar
fred committed
42
<a class="button" href="{% url 'episode-add' emission_slug=emission.slug %}">Ajouter un épisode</a>
fred's avatar
fred committed
43

fred's avatar
fred committed
44
<a class="button" href="{% url 'emission-newsitem-add' emission_slug=emission.slug %}">Ajouter une actu</a>
fred's avatar
fred committed
45

fred's avatar
fred committed
46
<a class="button" href="{% url 'emission-update' slug=emission.slug %}">Modifier le profil de l'émission</a>
fred's avatar
fred committed
47

fred's avatar
fred committed
48 49 50
<div class="two-columns">

<div>
fred's avatar
fred committed
51 52 53
<h4>Épisodes récents</h4>

<ul class="episode-list">
fred's avatar
fred committed
54
{% for episode in emission.get_sorted_episodes|slice:":5" %}
fred's avatar
fred committed
55 56 57 58 59 60
<li>{{ episode.diffusion_set.all.0.datetime|date:"d E o H:i"|lower }}
<br/>   <a href="{% url 'episode-view' emission_slug=emission.slug slug=episode.slug %}">{{ episode.title }}</a>
{% if episode.has_sound %}<span class="icon-music"/>{%endif%}
</li>
{% endfor %}
</ul>
fred's avatar
fred committed
61
</div>
fred's avatar
fred committed
62

fred's avatar
fred committed
63
<div>
fred's avatar
fred committed
64 65 66
<h4>Actus récentes</h4>

<ul class="episode-list">
fred's avatar
fred committed
67
{% for newsitem in emission.get_sorted_newsitems|slice:":5" %}
fred's avatar
fred committed
68
<li>{{ newsitem.date|date:"d E o"|lower }}
fred's avatar
fred committed
69 70
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
71 72
{% empty %}
Aucune actu.
fred's avatar
fred committed
73 74
{% endfor %}
</ul>
fred's avatar
fred committed
75 76 77
</div>

</div> <!-- .two-columns -->
fred's avatar
fred committed
78

79
<hr/>
80
</div>
fred's avatar
fred committed
81 82
{% endfor %}

83

fred's avatar
fred committed
84
{% for news_category in news_categories %}
fred's avatar
fred committed
85
<div class="newsitems block">
86
<h3>Actu : {{ news_category.title }}</h3>
fred's avatar
fred committed
87

fred's avatar
fred committed
88
<a class="button" href="{% url 'newsitem-add' slug=news_category.slug %}">Ajouter une actu</a>
fred's avatar
fred committed
89 90 91

<ul class="episode-list">
{% for newsitem in news_category.get_sorted_newsitems|slice:":10" %}
fred's avatar
fred committed
92
<li>{{ newsitem.date|date:"d E o"|lower }}
fred's avatar
fred committed
93 94
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
95 96
{% empty %}
Aucune actu.
fred's avatar
fred committed
97 98
{% endfor %}
</ul>
99 100
<hr/>
</div>
fred's avatar
fred committed
101 102
{% endfor %}

103
{% if perms.emissions.add_focus %}
fred's avatar
fred committed
104
<div class="newsitems block">
105 106 107 108 109 110
<h3>Focus</h3>

<ul class="episode-list">
{% for focus in focused_items %}
<li>
  {% if focus.emission %}
fred's avatar
fred committed
111
    <a href="{% url 'emission-view' slug=focus.emission.slug %}">[ÉMISSON] {{ focus.emission.title }}</a>
112
  {% elif focus.episode %}
fred's avatar
fred committed
113
    <a href="{% url 'episode-view' slug=focus.episode.slug emission_slug=focus.episode.emission.slug %}">[ÉPISODE] {{ focus.episode.title }}</a>
114
  {% elif focus.newsitem %}
fred's avatar
fred committed
115
    <a href="{% url 'newsitem-view' slug=focus.newsitem.slug %}">[ACTU] {{ focus.newsitem.title }}</a>
116
  {% elif focus.soundfile %}
fred's avatar
fred committed
117
    <a href="{% url 'episode-view' slug=focus.soundfile.episode.slug emission_slug=focus.soundfile.episode.emission.slug %}">[SON] {{ focus.soundfile.episode.title }}</a>
118 119
  {% elif focus.page %}
    <a href="{% url 'combo-manager-page-view' pk=focus.page.id %}">[TOPIK] {{focus.page.title }}</a>
120 121 122 123 124
  {% endif %}
</li>
{% endfor %}
</ul>

125 126 127
<h3>Épisodes récemment édités</h3>

<ul class="episode-list">
128
{% for episode in recent_episodes|slice:":20" %}
129 130 131 132 133 134 135
<li>{{ episode.last_update_timestamp|date:"d E o H:i"|lower }}
<a href="{% url 'emission-view' slug=episode.emission.slug %}">{{ episode.emission.title }}</a> /
    <a href="{% url 'episode-view' slug=episode.slug emission_slug=episode.emission.slug %}">{{ episode.title }}</a>
</li>
{% endfor %}
</ul>

fred's avatar
fred committed
136
<h3>Actus récemment éditées</h3>
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

<ul class="episode-list">
{% for newsitem in recent_newsitems|slice:":20" %}
<li>{{ newsitem.last_update_timestamp|date:"d E o H:i"|lower }}
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
{% endfor %}
</ul>

<h3>Sons récemment édités</h3>

<ul class="episode-list">
{% for soundfile in recent_soundfiles|slice:":20" %}
<li>{{ soundfile.last_update_timestamp|date:"d E o H:i"|lower }}
<a href="{% url 'emission-view' slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.emission.title }}</a> /
<a href="{% url 'episode-view' slug=soundfile.episode.slug emission_slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.title }}</a>
{% if soundfile.fragment %} ({{soundfile.title}}){% endif %}
</li>
{% endfor %}
</ul>



160 161 162
</div>
{% endif %}

fred's avatar
fred committed
163
{% endblock %}
164 165 166 167 168 169 170 171

{% block page-end %}

<script>
$(document).ready(function() {
  $('#other-emissions').click(function() {
     $('#other-emissions-list').toggle('blind');
  });
172
  document.cookie = 'panikdb=on; domain=.radiopanik.org';
173 174 175
});
</script>
{% endblock %}