]> git.0d.be Git - panikdb.git/blob - panikdb/templates/home.html
2ab0d03522cfc67132270248e5c8d83ce1573b45
[panikdb.git] / panikdb / templates / home.html
1 {% extends "base.html" %}
2 {% load i18n %}
3
4 {% block bodyargs %}class="home"{% endblock %}
5
6 {% block appbar %}
7 <h2>{% trans "Emissions" %}</h2>
8 <span class="actions">
9 {% if perms.service_messages.change_message and not service_message.text %}
10 <a href="{% url 'message-edit-view' pk=service_message.id %}">{% trans "Define service message" %}</a>
11 {% endif %}
12 {% if perms.emissions.change_emission %}
13 <a href="{% url 'emission-list' %}">{% trans "All emissions" %}</a>
14 <a href="{% url 'news-list' %}">{% trans "All newsitems" %}</a>
15 {% if perms.emissions.add_emission %}
16 <a href="{% url 'emission-add' %}">{% trans "New emission" %}</a>
17 {% endif %}
18 {% endif %}
19 </span>
20 {% endblock %}
21
22 {% block more-user-links %}
23 {{ block.super }}
24 {% if has_wiki %}
25 <a class="icon-wiki" href="/wiki/">Wiki</a>
26 {% endif %}
27 {% if has_regie %}
28 <a class="icon-regie" href="/regie/">{% trans "Studio" %}</a>
29 {% endif %}
30 {% if has_forums %}
31 <a class="icon-forums" href="https://forums.radiopanik.org/">Forums</a>
32 {% endif %}
33 <a class="icon-members" href="{% url 'members-list-view' %}">{% trans "Members directory" %}</a>
34 {% if has_nonstop and perms.nonstop.add_track %}
35 <a class="icon-music" href="{% url 'nonstop-quick-links' %}">{% trans "Nonstop management" %}</a>
36 {% endif %}
37 {% if has_cms and perms.data.add_page %}
38 <a class="icon-cms" href="{% url 'combo-manager-homepage' %}">{% trans "Editorial pages" %}</a>
39 {% endif %}
40 {% if has_newsletters and perms.newsletter.add_newsletter %}
41 <a class="icon-newsletter" href="{% url 'newsletter-list' %}">{% trans "Newsletters" %}</a>
42 {% endif %}
43 {% if stats_visit_url %}
44 <a target="blank" href="{{ stats_visit_url }}" class="icon-bar-chart">{% trans "Statistics" %}</a>
45 {% endif %}
46 {% endblock %}
47
48 {% block content %}
49
50 {% if display_poll_button %}
51 <!--
52 <div class="poll">
53         <a href="{% url 'vote' %}">Sondage Logo !</a>
54 </div>
55 -->
56 {% endif %}
57
58 {% if service_message.text %}
59 <div class="block {{service_message.style}}notice service-message">
60   {{service_message.text|default:""|safe}}
61   {% if perms.service_messages.change_message %}
62   <a class="edit-service-message" href="{% url 'message-edit-view' pk=service_message.id %}">{% trans "Edit service message" %}</a>
63   {% endif %}
64 </div>
65 {% endif %}
66
67 {% for emission in emissions %}
68 <div class="emission block">
69 <h3><a href="{% url 'emission-view' slug=emission.slug %}">{{ emission.title }}</a></h3>
70
71 <a class="button" href="{% url 'episode-add' emission_slug=emission.slug %}">{% trans "Add an episode" %}</a>
72
73 <a class="button" href="{% url 'emission-newsitem-add' emission_slug=emission.slug %}">{% trans "Add a newsitem" %}</a>
74
75 <a class="button" href="{% url 'emission-update' slug=emission.slug %}">{% trans "Edit emission details" %}</a>
76
77 {% if emission.schedule_set.exists %}
78 <a class="button" id="add-absence-link" rel="popup" href="{% url 'emission-add-absence' slug=emission.slug %}">{% trans "Add absence" %}</a>
79 {% endif %}
80
81 <div class="two-columns">
82
83 <div>
84 <h4>{% trans "Recent episodes" %}</h4>
85
86 <ul class="episode-list">
87 {% for episode in emission.get_sorted_episodes|slice:":5" %}
88 <li>{{ episode.first_diffusion|date:"d E o H:i"|lower }}
89 <br/>   <a href="{% url 'episode-view' emission_slug=emission.slug slug=episode.slug %}">{{ episode.title }}</a>
90 {% if episode.image %}<span class="icon-image"></span>{%endif%}
91 {% if episode.has_sound %}<span class="icon-music"/>{%endif%}
92 </li>
93 {% endfor %}
94 </ul>
95 </div>
96
97 <div>
98 <h4>{% trans "Recent newsitems" %}</h4>
99
100 <ul class="episode-list">
101 {% for newsitem in emission.get_sorted_newsitems|slice:":5" %}
102 <li>{{ newsitem.date|date:"d E o"|lower }}
103 <a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
104 </li>
105 {% empty %}
106 {% trans "No newsitems." %}
107 {% endfor %}
108 </ul>
109 </div>
110
111 </div> <!-- .two-columns -->
112
113 <hr/>
114 </div>
115 {% endfor %}
116
117
118 {% for news_category in news_categories %}
119 <div class="newsitems block">
120 <h3>{% trans "Newsitem:" %} {{ news_category.title }}</h3>
121
122 <a class="button" href="{% url 'newsitem-add' slug=news_category.slug %}">{% trans "Add a newsitem" %}</a>
123
124 <ul class="episode-list">
125 {% for newsitem in news_category.get_sorted_newsitems|slice:":10" %}
126 <li>{{ newsitem.date|date:"d E o"|lower }}
127 <a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
128 </li>
129 {% empty %}
130 {% trans "No newsitems" %}
131 {% endfor %}
132 </ul>
133 <hr/>
134 </div>
135 {% endfor %}
136
137 {% if perms.emissions.add_focus %}
138 <div class="newsitems block">
139 <h3>{% trans "Recently updated episodes" %}</h3>
140
141 <ul class="episode-list">
142 {% for episode in recent_episodes|slice:":20" %}
143 <li>{{ episode.last_update_timestamp|date:"d E o H:i"|lower }}
144 <a href="{% url 'emission-view' slug=episode.emission.slug %}">{{ episode.emission.title }}</a> /
145     <a href="{% url 'episode-view' slug=episode.slug emission_slug=episode.emission.slug %}">{{ episode.title }}</a>
146 </li>
147 {% endfor %}
148 </ul>
149 </div>
150
151 <div class="newsitems block">
152 <h3>{% trans "Recently updated newsitems" %}</h3>
153
154 <ul class="episode-list">
155 {% for newsitem in recent_newsitems|slice:":20" %}
156 <li>{{ newsitem.last_update_timestamp|date:"d E o H:i"|lower }}
157 <a href="{% url 'newsitem-view' slug=newsitem.slug %}">{{ newsitem.title }}</a>
158 </li>
159 {% endfor %}
160 </ul>
161 </div>
162
163 <div class="newsitems block">
164 <h3>{% trans "Recently updated sounds" %}</h3>
165
166 <ul class="episode-list">
167 {% for soundfile in recent_soundfiles|slice:":20" %}
168 <li>{{ soundfile.last_update_timestamp|date:"d E o H:i"|lower }}
169 <a href="{% url 'emission-view' slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.emission.title }}</a> /
170 <a href="{% url 'episode-view' slug=soundfile.episode.slug emission_slug=soundfile.episode.emission.slug %}">{{ soundfile.episode.title }}</a>
171 {% if soundfile.fragment %} ({{soundfile.title}}){% endif %}
172 </li>
173 {% endfor %}
174 </ul>
175 </div>
176
177 {% endif %}
178
179 {% endblock %}
180
181 {% block sidebar %}
182 <aside id="sidebar">
183
184 <div class="block program" data-url="{% url 'nonstop-ajax-program' date='' %}">
185 <h3>{% trans "Program" %}</h3>
186 <div></div>
187 <script>
188 $(function() {
189   $('.block.program').each(function() {
190     var url = $(this).data('url');
191     $(this).find('> div').load(url);
192   });
193 });
194 </script>
195 </div>
196
197 {% if has_pige_download %}
198 {% include "pige-download.html" %}
199 {% endif %}
200
201 {% if perms.emissions.add_focus %}
202 <div class="newsitems block">
203 <h3>{% trans "Focus" %}</h3>
204
205 <ul class="episode-list">
206 {% for focus in focused_items %}
207 <li>
208   {% if focus.emission %}
209     <a href="{% url 'emission-view' slug=focus.emission.slug %}">{% trans "[EMISSION]" %} {{ focus.emission.title }}</a>
210   {% elif focus.episode %}
211     <a href="{% url 'episode-view' slug=focus.episode.slug emission_slug=focus.episode.emission.slug %}">{% trans "[EPISODE]" %} {{ focus.episode.title }}</a>
212   {% elif focus.newsitem %}
213     <a href="{% url 'newsitem-view' slug=focus.newsitem.slug %}">{% trans "[NEWSITEM]" %} {{ focus.newsitem.title }}</a>
214   {% elif focus.soundfile %}
215     <a href="{% url 'episode-view' slug=focus.soundfile.episode.slug emission_slug=focus.soundfile.episode.emission.slug %}">{% trans "[SOUND]" %} {{ focus.soundfile.episode.title }}</a>
216   {% elif focus.page %}
217     <a href="{% url 'combo-manager-page-view' pk=focus.page.id %}">{% trans "[TOPIK]" %} {{focus.page.title }}</a>
218   {% endif %}
219 </li>
220 {% endfor %}
221 </ul>
222 </div>
223 {% endif %}
224
225
226
227 </aside>
228 {% endblock %}
229
230 {% block page-end %}
231
232 <script>
233 $(document).ready(function() {
234   $('#other-emissions').click(function() {
235      $('#other-emissions-list').toggle('blind');
236   });
237   document.cookie = 'panikdb=on; domain=.radiopanik.org';
238 });
239 </script>
240 {% endblock %}