]> git.0d.be Git - panikdb.git/blob - panikdb/templates/home.html
fix typo in permission check
[panikdb.git] / panikdb / templates / home.html
1 {% extends "base.html" %}
2
3 {% block bodyargs %}class="home"{% endblock %}
4
5 {% block appbar %}
6 <h2>Émissions</h2>
7 <span class="actions">
8 {% if perms.service_messages.change_message and not service_message.text %}
9 <a href="{% url 'message-edit-view' pk=service_message.id %}">Définir un message de service</a>
10 {% endif %}
11 {% if perms.emissions.change_emission %}
12 <a href="{% url 'emission-list' %}">Toutes les émissions</a>
13 <a href="{% url 'news-list' %}">Toutes les actus</a>
14 {% if perms.emissions.add_emission %}
15 <a href="{% url 'emission-add' %}">Nouvelle émission</a>
16 {% endif %}
17 {% endif %}
18 </span>
19 {% endblock %}
20
21 {% block more-user-links %}
22 {{ block.super }}
23 <a class="icon-wiki" href="/wiki/">Wiki</a>
24 <a class="icon-forums" href="https://forums.radiopanik.org/">Forums</a>
25 <a class="icon-members" href="{% url 'members-list-view' %}">Annuaire des membres</a>
26 {% if perms.nonstop.add_track %}
27 <a class="icon-music" href="{% url 'nonstop-quick-links' %}">Gestion nonstop</a>
28 {% endif %}
29 {% if perms.data.add_page %}
30 <a class="icon-cms" href="{% url 'combo-manager-homepage' %}">Pages éditoriales</a>
31 {% endif %}
32 {% if perms.newsletter.add_newsletter %}
33 <a class="icon-newsletter" href="{% url 'newsletter-list' %}">Newsletters</a>
34 {% endif %}
35 <a target="blank" href="http://stats.radiopanik.org/index.php?module=Login&action=logme&login=panikdb&password=d48fb8e3a453d965901339e6b020538f" class="icon-bar-chart">Statistiques</a>
36 {% endblock %}
37
38 {% block content %}
39
40 {% if display_poll_button %}
41 <!--
42 <div class="poll">
43         <a href="{% url 'vote' %}">Sondage Logo !</a>
44 </div>
45 -->
46 {% endif %}
47
48 {% if service_message.text %}
49 <div class="block {{service_message.style}}notice">
50   {% if perms.service_messsages.change_message %}
51   <a style="float: right" href="{% url 'message-edit-view' pk=service_message.id %}">Modifier le message de service</a>
52   {% endif %}
53   {{service_message.text|default:""|safe}}
54 </div>
55 {% endif %}
56
57 {% for emission in emissions %}
58 <div class="emission block">
59 <h3><a href="{% url 'emission-view' slug=emission.slug %}">{{ emission.title }}</a></h3>
60
61 <a class="button" href="{% url 'episode-add' emission_slug=emission.slug %}">Ajouter un épisode</a>
62
63 <a class="button" href="{% url 'emission-newsitem-add' emission_slug=emission.slug %}">Ajouter une actu</a>
64
65 <a class="button" href="{% url 'emission-update' slug=emission.slug %}">Modifier le profil de l'émission</a>
66
67 <div class="two-columns">
68
69 <div>
70 <h4>Épisodes récents</h4>
71
72 <ul class="episode-list">
73 {% for episode in emission.get_sorted_episodes|slice:":5" %}
74 <li>{{ episode.diffusion_set.all.0.datetime|date:"d E o H:i"|lower }}
75 <br/>   <a href="{% url 'episode-view' emission_slug=emission.slug slug=episode.slug %}">{{ episode.title }}</a>
76 {% if episode.has_sound %}<span class="icon-music"/>{%endif%}
77 </li>
78 {% endfor %}
79 </ul>
80 </div>
81
82 <div>
83 <h4>Actus récentes</h4>
84
85 <ul class="episode-list">
86 {% for newsitem in emission.get_sorted_newsitems|slice:":5" %}
87 <li>{{ newsitem.date|date:"d E o"|lower }}
88 <a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
89 </li>
90 {% empty %}
91 Aucune actu.
92 {% endfor %}
93 </ul>
94 </div>
95
96 </div> <!-- .two-columns -->
97
98 <hr/>
99 </div>
100 {% endfor %}
101
102
103 {% for news_category in news_categories %}
104 <div class="newsitems block">
105 <h3>Actu : {{ news_category.title }}</h3>
106
107 <a class="button" href="{% url 'newsitem-add' slug=news_category.slug %}">Ajouter une actu</a>
108
109 <ul class="episode-list">
110 {% for newsitem in news_category.get_sorted_newsitems|slice:":10" %}
111 <li>{{ newsitem.date|date:"d E o"|lower }}
112 <a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
113 </li>
114 {% empty %}
115 Aucune actu.
116 {% endfor %}
117 </ul>
118 <hr/>
119 </div>
120 {% endfor %}
121
122 {% if perms.emissions.add_focus %}
123 <div class="newsitems block">
124 <h3>Épisodes récemment édités</h3>
125
126 <ul class="episode-list">
127 {% for episode in recent_episodes|slice:":20" %}
128 <li>{{ episode.last_update_timestamp|date:"d E o H:i"|lower }}
129 <a href="{% url 'emission-view' slug=episode.emission.slug %}">{{ episode.emission.title }}</a> /
130     <a href="{% url 'episode-view' slug=episode.slug emission_slug=episode.emission.slug %}">{{ episode.title }}</a>
131 </li>
132 {% endfor %}
133 </ul>
134 </div>
135
136 <div class="newsitems block">
137 <h3>Actus récemment éditées</h3>
138
139 <ul class="episode-list">
140 {% for newsitem in recent_newsitems|slice:":20" %}
141 <li>{{ newsitem.last_update_timestamp|date:"d E o H:i"|lower }}
142 <a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
143 </li>
144 {% endfor %}
145 </ul>
146 </div>
147
148 <div class="newsitems block">
149 <h3>Sons récemment édités</h3>
150
151 <ul class="episode-list">
152 {% for soundfile in recent_soundfiles|slice:":20" %}
153 <li>{{ soundfile.last_update_timestamp|date:"d E o H:i"|lower }}
154 <a href="{% url 'emission-view' slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.emission.title }}</a> /
155 <a href="{% url 'episode-view' slug=soundfile.episode.slug emission_slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.title }}</a>
156 {% if soundfile.fragment %} ({{soundfile.title}}){% endif %}
157 </li>
158 {% endfor %}
159 </ul>
160 </div>
161
162 {% endif %}
163
164 {% endblock %}
165
166 {% block sidebar %}
167 <aside id="sidebar">
168
169 <div class="block program" data-url="{% url 'nonstop-ajax-program' date='' %}">
170 <h3>Au programme</h3>
171 <div></div>
172 <script>
173 $(function() {
174   $('.block.program').each(function() {
175     var url = $(this).data('url');
176     $(this).find('> div').load(url);
177   });
178 });
179 </script>
180 </div>
181
182 {% if perms.emissions.add_focus %}
183 <div class="newsitems block">
184 <h3>Focus</h3>
185
186 <ul class="episode-list">
187 {% for focus in focused_items %}
188 <li>
189   {% if focus.emission %}
190     <a href="{% url 'emission-view' slug=focus.emission.slug %}">[ÉMISSON] {{ focus.emission.title }}</a>
191   {% elif focus.episode %}
192     <a href="{% url 'episode-view' slug=focus.episode.slug emission_slug=focus.episode.emission.slug %}">[ÉPISODE] {{ focus.episode.title }}</a>
193   {% elif focus.newsitem %}
194     <a href="{% url 'newsitem-view' slug=focus.newsitem.slug %}">[ACTU] {{ focus.newsitem.title }}</a>
195   {% elif focus.soundfile %}
196     <a href="{% url 'episode-view' slug=focus.soundfile.episode.slug emission_slug=focus.soundfile.episode.emission.slug %}">[SON] {{ focus.soundfile.episode.title }}</a>
197   {% elif focus.page %}
198     <a href="{% url 'combo-manager-page-view' pk=focus.page.id %}">[TOPIK] {{focus.page.title }}</a>
199   {% endif %}
200 </li>
201 {% endfor %}
202 </ul>
203 </div>
204 {% endif %}
205
206
207
208 </aside>
209 {% endblock %}
210
211 {% block page-end %}
212
213 <script>
214 $(document).ready(function() {
215   $('#other-emissions').click(function() {
216      $('#other-emissions-list').toggle('blind');
217   });
218   document.cookie = 'panikdb=on; domain=.radiopanik.org';
219 });
220 </script>
221 {% endblock %}