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

3 4
{% block appbar %}
{% if user.is_staff %}
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 %}
18 19
{% endblock %}

20
{% block content %}
21 22
<h2>Émissions</h2>

fred's avatar
fred committed
23
{% for emission in emissions %}
24
<div class="emission">
25
<h3><a href="{% url 'emission-view' slug=emission.slug %}">{{ emission.title }}</a></h3>
fred's avatar
fred committed
26 27 28

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

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

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

fred's avatar
fred committed
33 34 35
<div class="two-columns">

<div>
fred's avatar
fred committed
36 37 38
<h4>Épisodes récents</h4>

<ul class="episode-list">
fred's avatar
fred committed
39
{% for episode in emission.get_sorted_episodes|slice:":5" %}
fred's avatar
fred committed
40 41 42 43 44 45
<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
46
</div>
fred's avatar
fred committed
47

fred's avatar
fred committed
48
<div>
fred's avatar
fred committed
49 50 51
<h4>Actus récentes</h4>

<ul class="episode-list">
fred's avatar
fred committed
52
{% for newsitem in emission.get_sorted_newsitems|slice:":5" %}
53
<li>{{ newsitem.date|date:"d E o H:i"|lower }}
fred's avatar
fred committed
54 55
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
56 57
{% empty %}
Aucune actu.
fred's avatar
fred committed
58 59
{% endfor %}
</ul>
fred's avatar
fred committed
60 61 62
</div>

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

64
<hr/>
65
</div>
fred's avatar
fred committed
66 67
{% endfor %}

68

fred's avatar
fred committed
69
{% for news_category in news_categories %}
70 71
<div class="newsitems">
<h3>Actu : {{ news_category.title }}</h3>
fred's avatar
fred committed
72 73 74 75 76

<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" %}
77
<li>{{ newsitem.date|date:"d E o H:i"|lower }}
fred's avatar
fred committed
78 79
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
80 81
{% empty %}
Aucune actu.
fred's avatar
fred committed
82 83
{% endfor %}
</ul>
84 85
<hr/>
</div>
fred's avatar
fred committed
86 87
{% endfor %}

88 89 90 91 92 93 94 95
{% 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
96
    <a href="{% url 'emission-view' slug=focus.emission.slug %}">[ÉMISSON] {{ focus.emission.title }}</a>
97
  {% elif focus.episode %}
fred's avatar
fred committed
98
    <a href="{% url 'episode-view' slug=focus.episode.slug emission_slug=focus.episode.emission.slug %}">[ÉPISODE] {{ focus.episode.title }}</a>
99
  {% elif focus.newsitem %}
fred's avatar
fred committed
100
    <a href="{% url 'newsitem-view' slug=focus.newsitem.slug %}">[ACTU] {{ focus.newsitem.title }}</a>
101
  {% elif focus.soundfile %}
fred's avatar
fred committed
102
    <a href="{% url 'episode-view' slug=focus.soundfile.episode.slug emission_slug=focus.soundfile.episode.emission.slug %}">[SON] {{ focus.soundfile.episode.title }}</a>
103 104 105 106 107
  {% endif %}
</li>
{% endfor %}
</ul>

108 109 110
<h3>Épisodes récemment édités</h3>

<ul class="episode-list">
111
{% for episode in recent_episodes|slice:":20" %}
112 113 114 115 116 117 118
<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>

119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
<h3>Actus récemment édités</h3>

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



143 144 145
</div>
{% endif %}

fred's avatar
fred committed
146
{% endblock %}
147 148 149 150 151 152 153 154

{% block page-end %}

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