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

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

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

23
{% block content %}
fred's avatar
fred committed
24 25

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

33 34
<h2>Émissions</h2>

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

<a class="big-friendly-button" href="{% url 'episode-add' emission_slug=emission.slug %}">Ajouter un épisode</a>

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

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

fred's avatar
fred committed
45 46 47
<div class="two-columns">

<div>
fred's avatar
fred committed
48 49 50
<h4>Épisodes récents</h4>

<ul class="episode-list">
fred's avatar
fred committed
51
{% for episode in emission.get_sorted_episodes|slice:":5" %}
fred's avatar
fred committed
52 53 54 55 56 57
<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
58
</div>
fred's avatar
fred committed
59

fred's avatar
fred committed
60
<div>
fred's avatar
fred committed
61 62 63
<h4>Actus récentes</h4>

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

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

76
<hr/>
77
</div>
fred's avatar
fred committed
78 79
{% endfor %}

80

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

<a class="big-friendly-button" href="{% url 'newsitem-add' slug=news_category.slug %}">Ajouter une actu</a>

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

100 101 102 103 104 105 106 107
{% if perms.emissions.add_focus %}
<div class="newsitems">
<h3>Focus</h3>

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

122 123 124
<h3>Épisodes récemment édités</h3>

<ul class="episode-list">
125
{% for episode in recent_episodes|slice:":20" %}
126 127 128 129 130 131 132
<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
133
<h3>Actus récemment éditées</h3>
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156

<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>



157 158 159
</div>
{% endif %}

fred's avatar
fred committed
160
{% endblock %}
161 162 163 164 165 166 167 168

{% block page-end %}

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