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

3
{% block appbar %}
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
{% block more-user-links %}
12
{{ block.super }}
13 14 15
{% if perms.emissions.add_emission %}
<a href="{% url 'emission-add' %}">Nouvelle émission</a>
{% endif %}
16
{% if perms.newsletter.add_newsletter %}
17 18
<a href="{% url 'newsletter-list' %}">Newsletters</a>
{% endif %}
19 20 21
{% if perms.nonstop.add_track %}
<a href="{% url 'nonstop-quick-links' %}">Gestion nonstop</a>
{% endif %}
22 23
{% endblock %}

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

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

34 35
<h2>Émissions</h2>

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

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

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

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

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

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

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

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

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

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

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

81

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

<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" %}
fred's avatar
fred committed
90
<li>{{ newsitem.date|date:"d E o"|lower }}
fred's avatar
fred committed
91 92
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
93 94
{% empty %}
Aucune actu.
fred's avatar
fred committed
95 96
{% endfor %}
</ul>
97 98
<hr/>
</div>
fred's avatar
fred committed
99 100
{% endfor %}

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

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

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

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

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



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

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

{% block page-end %}

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