home.html 2.17 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
{% block content %}
fred's avatar
fred committed
12
{% for emission in emissions %}
13
<div class="emission">
fred's avatar
fred committed
14
<h2><a href="{% url 'emission-view' slug=emission.slug %}">{{ emission.title }}</a></h2>
fred's avatar
fred committed
15 16 17

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

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

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

fred's avatar
fred committed
22 23 24
<div class="two-columns">

<div>
fred's avatar
fred committed
25 26 27
<h4>Épisodes récents</h4>

<ul class="episode-list">
fred's avatar
fred committed
28
{% for episode in emission.get_sorted_episodes|slice:":5" %}
fred's avatar
fred committed
29 30 31 32 33 34
<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
35
</div>
fred's avatar
fred committed
36

fred's avatar
fred committed
37
<div>
fred's avatar
fred committed
38 39 40
<h4>Actus récentes</h4>

<ul class="episode-list">
fred's avatar
fred committed
41
{% for newsitem in emission.get_sorted_newsitems|slice:":5" %}
42
<li>{{ newsitem.date|date:"d E o H:i"|lower }}
fred's avatar
fred committed
43 44
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
45 46
{% empty %}
Aucune actu.
fred's avatar
fred committed
47 48
{% endfor %}
</ul>
fred's avatar
fred committed
49 50 51
</div>

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

53
</div>
fred's avatar
fred committed
54 55
{% endfor %}

56

fred's avatar
fred committed
57 58 59 60 61 62 63
{% for news_category in news_categories %}
<h2>{{ news_category.title }}</h2>

<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" %}
64
<li>{{ newsitem.date|date:"d E o H:i"|lower }}
fred's avatar
fred committed
65 66
<a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
</li>
fred's avatar
fred committed
67 68
{% empty %}
Aucune actu.
fred's avatar
fred committed
69 70 71 72 73
{% endfor %}
</ul>

{% endfor %}

fred's avatar
fred committed
74
{% endblock %}
75 76 77 78 79 80 81 82 83 84 85

{% block page-end %}

<script>
$(document).ready(function() {
  $('#other-emissions').click(function() {
     $('#other-emissions-list').toggle('blind');
  });
});
</script>
{% endblock %}