-
Notifications
You must be signed in to change notification settings - Fork 162
/
base.html
640 lines (555 loc) · 33.2 KB
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
{% load staticfiles %}
{% load profile %}
{% load interventions %}
{% load topbar %}
{% load captureas %}
{% load date %}
{% load set %}
{% load captureas %}
{% load thumbnail %}
{% load i18n %}
<!DOCTYPE html>
<html class="no-js enable-mobile-menu wf-active" lang="fr">
<head>
<meta charset="utf-8">
<title>
{% captureas title %}
{% captureas title_blocks %}
{% block title %}{% endblock %}
{% block title_base %}{% endblock %}
{% endcaptureas %}
{% if title_blocks %}
{{ title_blocks|safe }}
•
{% endif %}
{{app.site.litteral_name}}
{% endcaptureas %}
{{ title|safe }}
</title>
<meta name="language" content="fr">
<meta http-equiv="content-language" content="fr">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0">
{# Description #}
{% captureas description %}
{% block description %}
{{app.site.long_description}}
{% endblock %}
{% endcaptureas %}
<meta name="description" content="{{ description|safe }}">
{% captureas meta_image %}
{{ app.site.dns }}{% block meta_image %}{% spaceless %}
{% static "images/apple-touch-icon-144x144-precomposed.png" %}
{% endspaceless %}{% endblock %}
{% endcaptureas %}
{# OpenGraph #}
<meta property="og:site_name" content="{{app.site.litteral_name}}">
<meta property="og:title" content="{{ title|safe }}">
<meta property="og:url" content="{{app.site.url}}{{ request.path }}">
<meta property="og:language" content="fr_FR">
<meta property="og:image:url" content="http://{{ meta_image }}">
<meta property="og:image:secure_url" content="https://{{ meta_image }}">
{% block opengraph %}
<meta property="og:type" content="website">
{% endblock %}
{# Twitter cards #}
<meta property="twitter:domain" content="{{app.site.url}}/">
<meta property="twitter:card" content="summary">
<meta property="twitter:url" content="{{app.site.url}}{{ request.path }}">
<meta property="twitter:title" content="{{ title|safe }}">
<meta property="twitter:description" content="{{ description|safe }}">
<meta property="twitter:site" content="@{{app.site.name}}">
<meta property="twitter:creator" content="@{% block twitter_creator %}{{app.site.name}}{% endblock %}">
<meta property="twitter:image" content="http://{{ meta_image }}">
{# Stylesheets #}
{% if debug %}
<link rel="stylesheet" href="{% static "css/main.css" %}">
{% else %}
<link rel="stylesheet" href="{% static "css/main.min.css" %}">
{% block canonical %}{% endblock %}
{% endif %}
<!--[if IE 9]>
<link rel="stylesheet" href="{% static "css/only-ie.min.css" %}">
<![endif]-->
{# Webfont async loading #}
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Source+Code+Pro:400,700|Merriweather:400,700' rel='stylesheet' type='text/css'>
{% block extra_css %}
{% endblock %}
{# favicons #}
<link rel="shortcut icon" type="image/png" href="{% static "images/favicon.png" %}">
<link rel="apple-touch-icon" sizes="144x144" href="{% static "images/apple-touch-icon-144x144-precomposed.png" %}">
<link rel="apple-touch-icon" sizes="114x114" href="{% static "images/apple-touch-icon-114x114-precomposed.png" %}">
<link rel="apple-touch-icon" sizes="72x72" href="{% static "images/apple-touch-icon-72x72-precomposed.png" %}">
<link rel="apple-touch-icon" sizes="57x57" href="{% static "images/apple-touch-icon-57x57-precomposed.png" %}">
<link rel="apple-touch-icon" href="{% static "images/apple-touch-icon-precomposed.png" %}">
<link rel="apple-touch-icon" href="{% static "images/apple-touch-icon.png" %}">
{# Fullsceen on iOS #}
<meta name="apple-mobile-web-app-capable" content="yes">
{# RSS links #}
<link rel="alternate" type="application/rss+xml" title="Forum" href="{% url "post-feed-rss" %}">
{# OpenSearch plugin autodiscovery #}
<link rel="search" type="application/opensearchdescription+xml" title="{{ app.site.litteral_name }}" href="{% url "zds.search.views.opensearch" %}">
</head>
<body class="{% block body_class %}{% endblock %}"
itemscope
itemtype="http://schema.org/WebPage"
>
<!--[if lt IE 9]>
<p class="chromeframe">Vous utilisez un navigateur <strong>dépassé</strong>. Merci de <a href="http://browsehappy.com/">mettre à jour celui-ci</a> pour améliorer votre expérience.</p>
<![endif]-->
<div class="mobile-menu" id="mobile-menu"></div>
<div class="page-container">
<ul id="accessibility">
<li>
<a href="#menu">{% trans "Aller au menu" %}</a>
</li>
<li>
<a href="#content" accesskey="s">{% trans "Aller au contenu" %}</a>
</li>
<li>
<a href="#search" accesskey="4">{% trans "Aller à la recherche" %}</a>
</li>
</ul>
<div id="cookies-eu-banner">
<span>
{% trans "Ce site utilise Google Analytics. En poursuivant votre navigation sur ce site, vous nous autorisez à déposer des cookies à des fins de mesure d'audience. Pour s'opposer à ce dépôt vous pouvez cliquer" %}
</span>
<button id="cookies-eu-reject">{% trans "ici" %}</button>.
<a href="/pages/cookies" id="cookies-eu-more">{% trans "En savoir plus" %}</a>
<button id="cookies-eu-accept">{% trans "OK" %}</button>
</div>
<div class="header-container">
<header class="clearfix">
<div class="wrapper">
<div class="mobile-menu-btn ico-after"></div>
{% captureas mobiletitle %}
{% block mobile_title %}
{{app.site.litteral_name}}
{% endblock %}
{% endcaptureas %}
{# Logo #}
<div class="header-logo">
<a href="{% url "zds.pages.views.home" %}"
class="header-logo-link"
data-title="{{ mobiletitle }}"
>
{{app.site.litteral_name}}
</a>
</div>
{# Menu #}
<nav class="header-menu mobile-menu-bloc" id="menu" data-title="Menu"
{% if user.is_authenticated %}
{% with profile=user.profile %}
data-is-hover="{{ profile.hover_or_click }}"
{% endwith %}
{% endif %}
>
<ul class="header-menu-list">
<li>
<a href="{% url "zds.tutorial.views.index" %}" class="mobile-menu-link {% block menu_tutorial %}{% endblock %}">
{% trans "Tutoriels" %}
</a>
<div class="dropdown header-menu-dropdown">
<a href="{% url "zds.tutorial.views.index" %}" class="dropdown-link-all">
{% trans "Tous les tutoriels" %}
</a>
<ul class="dropdown-list">
{% with categories='.'|top_categories_tuto %}
{% for title, subcats in categories.items %}
<li>
<ul>
<li class="dropdown-title">
{{ title }}
</li>
{% for subcat,slug in subcats %}
<li>
<a href="{% url "zds.tutorial.views.index" %}?tag={{ slug }}">
{{ subcat }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% empty %}
<ul>
<li class="dropdown-title">
{% trans "Aucun tutoriel disponible." %}
</li>
</ul>
{% endfor %}
{% endwith %}
</ul>
</div>
</li>
<li>
<a href="{% url "zds.article.views.index" %}" class="mobile-menu-link {% block menu_article %}{% endblock %}">
{% trans "Articles" %}
</a>
</li>
<li>
<a href="{% url "zds.forum.views.index" %}" class="mobile-menu-link {% block menu_forum %}{% endblock %}">
{% trans "Forums" %}
</a>
<div class="dropdown header-menu-dropdown">
<a href="{% url "zds.forum.views.index" %}" class="dropdown-link-all">
{% trans "Tous les forums" %}
</a>
<ul class="dropdown-list">
{% with top=user|top_categories %}
{% for title, forums in top.categories.items %}
<li>
<ul>
<li class="dropdown-title">
{{ title }}
</li>
{% for forum in forums %}
<li><a href="{{ forum.get_absolute_url }}">{{ forum.title }}</a></li>
{% endfor %}
</ul>
</li>
{% empty %}
<ul>
<li class="dropdown-title">
{% trans "Aucun forum disponible." %}
</li>
</ul>
{% endfor %}
{% if top.tags %}
<li>
<ul>
<li class="dropdown-title">
{% trans "Tags les plus utilisés" %}
</li>
{% for tag in top.tags %}
<li><a href="{{ tag.get_absolute_url }}">{{ tag.title }}</a></li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endwith %}
</ul>
</div>
</li>
</ul>
</nav>
{# Logbox #}
<div class="logbox header-right {% if not user.is_authenticated %}unlogged{% endif %}">
{% if user.is_authenticated %}
<div class="notifs-links">
{# MESSAGERIE PRIVEE #}
<div>
{% with topics=user|interventions_privatetopics %}
{% with unread_topics=topics.unread %}
{% with total_topics=topics.total %}
<a href="{% url "mp-list" %}" class="ico-link">
{% if total_topics > 0 %}
<span class="notif-count">{{ total_topics }}</span>
{% endif %}
<span class="notif-text ico ico-messages">{% trans "Messagerie privée" %}</span>
</a>
<div class="dropdown">
<span class="dropdown-title">{% trans "Messagerie privée" %}</span>
<ul class="dropdown-list">
{% for topic in unread_topics %}
{% with last_answer=topic.get_last_answer %}
<li>
{% if last_answer = None %}
{% set topic.last_read_post as last_answer %}
{% endif %}
<a href="{{ topic.last_read_post.get_absolute_url }}">
{% with p=last_answer.author.profile %}
<img src="{{ p.get_avatar_url }}" alt="" class="avatar">
{% endwith %}
<span class="username">{{ last_answer.author.username }}</span>
<span class="date">{{ last_answer.pubdate|format_date:True|capfirst }}</span>
<span class="topic">{{ topic.title }}</span>
</a>
</li>
{% endwith %}
{% endfor %}
{% if total_topics = 0 %}
<li class="dropdown-empty-message">
{% trans "Aucun nouveau message" %}
</li>
{% endif %}
</ul>
<a href="{% url "mp-list" %}" class="dropdown-link-all">
{% trans "Tous les messages" %}
</a>
</div>
{% endwith %}
{% endwith %}
{% endwith %}
</div>
{# NOTIFICATIONS #}
<div>
{% with unread_posts=user|interventions_topics %}
<a href="{% url "zds.forum.views.followed_topics" %}" class="ico-link">
{% if unread_posts|length > 0 %}
<span class="notif-count">{{ unread_posts|length }}</span>
{% endif %}
<span class="notif-text ico ico-notifs">{% trans "Notifications" %}</span>
</a>
<div class="dropdown">
<span class="dropdown-title">{% trans "Notifications" %}</span>
<ul class="dropdown-list">
{% for first_unread in unread_posts %}
<li>
<a href="{{ first_unread.url }}">
{% with p=first_unread.author.profile %}
<img src="{{ p.get_avatar_url }}" alt="" class="avatar">
{% endwith %}
<span class="username">{{ first_unread.author.username }}</span>
<span class="date">{{ first_unread.pubdate|format_date:True|capfirst }}</span>
<span class="topic">{{ first_unread.title }}</span>
</a>
</li>
{% endfor %}
{% if unread_posts|length == 0 %}
<li class="dropdown-empty-message">
{% trans "Aucune notification" %}
</li>
{% endif %}
</ul>
<a href="{% url "zds.forum.views.followed_topics" %}" class="dropdown-link-all">
{% trans "Toutes les notifications" %}
</a>
</div>
{% endwith %}
</div>
{# ALERTES MODERATION #}
{% if perms.forum.change_post %}
{% with alerts=user|alerts_list %}
{% with nb_alerts=alerts|length %}
<div>
<a href="{% url "zds.pages.views.alerts" %}" class="ico-link">
<span class="notif-text ico ico-alerts">{% trans "Alertes" %}</span>
{% if nb_alerts > 0 %}
<span class="notif-count">{{ nb_alerts }}</span>
{% endif %}
</a>
<div class="dropdown">
<span class="dropdown-title">{% trans "Alertes Modération" %}</span>
<ul class="dropdown-list">
{% for alert in alerts %}
<li>
<a href="{{ alert.url }}">
<span class="username">{{ alert.title }}</span>
<span class="date">{{ alert.pubdate|format_date:True|capfirst }}</span>
<span class="topic">{{ alert.text }}</span>
</a>
</li>
{% empty %}
<li class="dropdown-empty-message">
{% trans "Aucune alerte" %}
</li>
{% endfor %}
</ul>
<a href="{% url "zds.pages.views.alerts" %}" class="dropdown-link-all">
{% trans "Toutes les alertes" %}
</a>
</div>
</div>
{% endwith %}
{% endwith %}
{% else %}
<a href="{% url "update-member" %}"
id="open-my-account"
class="ico-link dont-click-if-sidebar"
data-click="my-account"
>
<span class="notif-text ico ico-params">{% trans "Mon Compte" %}</span>
</a>
{% endif %}
</div>
<div>
{% with profile=user.profile %}
<a href="{% url "update-member" %}"
id="my-account"
class="my-account mobile-menu-link mobile-menu-bloc dont-click-if-sidebar"
title="{% blocktrans %}Mon compte{% endblocktrans %}"
data-title="{% blocktrans %}Mon compte{% endblocktrans %}"
{% if not perms.forum.change_post %}
data-active="open-my-account"
{% endif %}
>
<img src="{{ profile.get_avatar_url }}" alt="" class="avatar">
<span class="username label">{{ user.username }}</span>
</a>
{% endwith %}
<div class="dropdown my-account-dropdown mobile-menu-bloc mobile-all-links" data-title="Mon compte">
<span class="dropdown-title">{{ user.username|truncatechars:25 }}</span>
<ul class="dropdown-list">
<li>
<a href="{% url "member-detail" user.username %}">{% trans "Mon profil" %}</a>
</li>
<li>
<a href="{% url "zds.member.views.tutorials" %}">{% trans "Mes tutoriels" %}</a>
</li>
<li>
<a href="{% url "zds.member.views.articles" %}">{% trans "Mes articles" %}</a>
</li>
<li>
<a href="{% url "zds.gallery.views.gallery_list" %}">{% trans "Galeries d'images" %}</a>
</li>
<li>
<a href="{% url "update-member" %}">{% trans "Paramètres" %}</a>
</li>
{% if perms.tutorial.change_tutorial %}
<li>
<a href="{% url "zds.tutorial.views.list_validation" %}">{% trans "Validation des tutoriels" %}</a>
</li>
{% endif %}
{% if perms.article.change_article %}
<li>
<a href="{% url "zds.article.views.list_validation" %}">{% trans "Validation des articles" %}</a>
</li>
{% endif %}
<li>
<form
method="post"
action="{% url "zds.member.views.logout_view" %}"
>
{% csrf_token %}
<button type="submit">{% trans "Déconnexion" %}</button>
</form>
</li>
</ul>
</div>
</div>
{% else %} {# Not logged #}
<a href="{% url "zds.member.views.login_view" %}?next={{ request.path }}">{% trans "Connexion" %}</a>
<a href="{% url "register-member" %}">{% trans "Inscription" %}</a>
{% endif %}
</div>
</div>
</header>
<div class="clearfix sub-header">
<div class="wrapper">
<div class="breadcrumb" itemprop="breadcrumb">
<ol>
<li>
<a href="{% url "zds.pages.views.home" %}" rel="home" itemprop="url">
<span itemprop="title">{% trans "Accueil" %}</span>
</a>
</li>
{% block breadcrumb_base %}{% endblock %}
{% block breadcrumb %}{% endblock %}
</ol>
</div>
<div class="search header-right" id="search">
<form action="{% url "haystack_search" %}">
<input type="text" name="q" placeholder="{% trans "Rechercher" %}">
<button type="submit" class="ico-after search-submit" title="{% trans "Lancer la recherche" %}">{% trans "OK" %}</button>
</form>
<a href="{% url "haystack_search" %}" title="{% trans "Recherche avancée" %}" class="search-more"></a>
</div>
</div>
</div>
</div>
<div class="main-container">
{% block doc_api %}
{% block pre_content %}
{% endblock %}
<div class="main wrapper clearfix">
<main class="content-container" role="main" id="content">
{% if messages %}
{% for message in messages %}
<div class="alert-box {{ message.tags }}">
<span>{{ message }}</span>
<a href="#close-alert-box" class="close-alert-box ico-after cross white">{% trans "Masquer l'alerte" %}</a>
</div>
{% endfor %}
{% endif %}
{% block content_out %}
{% captureas schema %}
{% block schema %}{% endblock %}
{% endcaptureas %}
<section class="content-wrapper" {{ schema|safe }}>
<h1 {% if schema %}itemprop="name"{% endif %}>
{% block headline %}{% endblock %}
</h1>
{% captureas headlinesub %}
{% block headline_sub %}{% endblock %}
{% endcaptureas %}
{% if headlinesub %}
<h2 class="subtitle" {% if schema %}itemprop="description"{% endif %}>{{ headlinesub|safe }}</h2>
{% endif %}
{% block content %}{% endblock %}
</section>
{% endblock %}
</main>
{% block sidebar %}{% endblock %}
</div>
{% endblock %}
</div>
<footer class="page-footer">
<div class="wrapper">
<p class="copyright">
{{app.site.litteral_name}}
<span class="version">
• {% trans "Version" %} : <a href="{{git_version.url}}">{{git_version.name}}</a>
</span>
</p>
<ul class="social">
{% if app.site.social.facebook %}
<li><a href="{{app.site.social.facebook}}" title="Aimez notre page Facebook" class="btn ico-after facebook light btn-facebook btn-holder"></a></li>
{% endif %}
{% if app.site.social.twitter %}
<li><a href="{{app.site.social.twitter}}" title="Suivez-nous sur Twitter" class="btn ico-after twitter light btn-twitter btn-holder"></a></li>
{% endif %}
{% if app.site.social.googleplus %}
<li><a href="{{app.site.social.googleplus}}" title="Retrouvez-nous sur Google+" class="btn ico-after google-plus light btn-google-plus btn-holder"></a></li>
{% endif %}
</ul>
<ul class="links">
<li><a href="{% url "django.swagger.base.view" %}">{% trans "API" %}</a></li>
<li><a href="{% url "zds.pages.views.eula" %}">{% trans "CGU" %}</a></li>
<li><a href="{% url "zds.pages.views.about" %}">{% trans "À propos" %}</a></li>
{% if app.site.association %}
<li><a href="{% url "zds.pages.views.association" %}">{% trans "L'association" %}</a></li>
{% if user.is_authenticated %}
<li><a href="{% url "zds.pages.views.assoc_subscribe" %}">{% trans "Adhérer" %}</a></li>
{% endif %}
{% endif %}
<li><a href="{% url "zds.pages.views.contact" %}">{% trans "Contact" %}</a></li>
</ul>
</div>
</footer>
</div>
{# Javascript stuff start #}
{% if debug %}
<script src="{% static "js/vendors.js" %}"></script>
<script src="{% static "js/main.js" %}"></script>
{% else %}
<script src="{% static "js/all.min.js" %}"></script>
{% endif %}
{% block extra_js %}
{% endblock %}
{# Google Analytics #}
{% if app.site.googleAnalyticsID and app.site.googleTagManagerID %}
<script>
new CookiesEuBanner(function(){
dataLayer = [{'gaTrackingId': '{{ app.site.googleAnalyticsID }}'}];
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{{ app.site.googleTagManagerID }}');
});
</script>
{% endif %}
{# MathJax #}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$', '$']],
displayMath: [['$$','$$']],
processEscapes: true,
},
TeX: { extensions: ["color.js", "cancel.js", "enclose.js", "bbox.js", "mathchoice.js", "newcommand.js", "verb.js", "unicode.js", "autobold.js", "mhchem.js"] },
messageStyle: "none",
});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</body>
</html>