This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
/
base.html
201 lines (174 loc) · 8.69 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
{% set untrusted = settings.ENABLE_RESTRICTIONS_BY_HOST and (request.get_host() in (settings.ATTACHMENT_ORIGIN, settings.ATTACHMENT_HOST)) %}
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}" class="no-js">
<head {%- if not untrusted %} prefix="og: http://ogp.me/ns#"{% endif %}>
<meta charset="utf-8">
{%- block experiment_js %}{% endblock %}
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script>(function(d) { d.className = d.className.replace(/\bno-js/, ''); })(document.documentElement);</script>
<title>{% block title %}{{ _('MDN Web Docs') }}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content=
{%- if request.get_host() in settings.ALLOW_ROBOTS_WEB_DOMAINS -%}
"{% block robots_value%}index, follow{% endblock %}"
{%- else -%}
"noindex, nofollow"
{%- endif -%}
>
{% include "includes/preload.html" %}
{%- if not untrusted %}
<link rel="home" href="{{ url('home') }}">
<link rel="license" href="#license">
{% endif %}
{% block site_css %}
{% stylesheet 'mdn' %}
{% for style in styles %}
{% stylesheet style %}
{% endfor %}
{% endblock %}
{%- if settings.MAINTENANCE_MODE %}
{% stylesheet 'maintenance-mode-global' %}
{%- endif %}
{#- If the stylesheet exists, include it. Otherwise, does nothing. #}
{% stylesheet 'locale-%s' % LANG %}
{% block site_analytics %}
{% javascript 'dnt-helper' %}
{% include "includes/google_analytics.html" %}
{% endblock %}
{%- if not untrusted %}
<!-- common social tags -->
{% set social_logo = request.build_absolute_uri(static('img/opengraph-logo.png')) %}
<meta property="og:type" content="website">
<meta property="og:image" content="{{ social_logo }}">
<meta property="og:site_name" content="{{ _('MDN Web Docs') }}">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="{{ social_logo }}">
<meta name="twitter:site" content="@MozDevNet">
<meta name="twitter:creator" content="@MozDevNet">
<link rel="search" type="application/opensearchdescription+xml" href="{{ settings.SITE_URL }}/{{ request.LANGUAGE_CODE }}/search/xml" title="{{ _('MDN Web Docs') }}">
{% endif %}
<!-- third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ static('img/favicon144.png') }}">
<!-- iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ static('img/favicon114.png') }}">
<!-- first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ static('img/favicon72.png') }}">
<!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="{{ static('img/favicon57.png') }}">
<!-- basic favicon -->
<!-- basic favicon -->
{% if settings.DOMAIN == settings.PRODUCTION_DOMAIN %}
{% set favicon_suffix = '' %}
{% elif settings.DOMAIN == settings.STAGING_DOMAIN %}
{% set favicon_suffix = '-staging' %}
{% else %}
{% set favicon_suffix = '-local' %}
{% endif %}
<link rel="shortcut icon" href="{{ static('img/favicon32{}.png'.format(favicon_suffix)) }}">
<!--[if IE]>
<meta http-equiv="imagetoolbar" content="no">
{% javascript 'html5shiv' %}
<![endif]-->
{% block extrahead %}{% endblock %}
</head>
<body {% block body_attributes %}{% endblock %} class="{% block bodyclass %}{% endblock %}{% if settings.MAINTENANCE_MODE %} maintenance-mode{% endif %}"{% if request.user and request.user.is_authenticated() %} data-login-service="{{ request.session.sociallogin_provider }}"{% endif %}>
{% include "includes/config.html" %}
{%- if settings.MAINTENANCE_MODE %}
<div class="global-notice maintenance-mode-notice">
<div class="wrap center">
<p>
<bdi>
{{ _('MDN is currently in read-only maintenance mode.') }}
{%- if not untrusted %}
<a href="{{ url('maintenance_mode') }}">{{ _('Learn more') }}</a>.
{%- endif %}
</bdi>
</p>
</div>
</div>
{%- else %}
{{ soapbox_messages(get_soapbox_messages(request.path)) }}
{%- endif %}
{%- if not untrusted %}
{% include "includes/a11y-nav.html" %}
<!-- Header -->
<header id="main-header" class="header-main">
<a href="{{ url('home') }}" class="logo">{{ _('MDN Web Docs') }}</a>
<div class="nav-toolbox-wrapper">
{% include "includes/header-main-nav.html" %}
{% include "includes/header-toolbox.html" %}
</div>
{% include "includes/nav-main-search.html" %}
</header>
{%- endif %} {# if not untrusted #}
<!-- Content will go here -->
<main id="content">
{% block document_head %}{% endblock %}
<div class="center clear">
{% block content %}{% endblock %}
</div>
</main>
{%- if not untrusted %}
<!-- Footer -->
<footer id="nav-footer" class="nav-footer">
<div class="center">
<a href="{{ url('home') }}" class="nav-footer-logo">{{ _('MDN Web Docs') }}</a>
<div class="footer-group footer-group-mdn">
<h2 class="footer-title">MDN</h2>
<ul class="footer-list">
<li><a href="{{ wiki_url('Web') }}">{{ _('Web Technologies') }}</a></li>
<li><a href="{{ wiki_url('Learn') }}">{{ _('Learn Web Development') }}</a></li>
<li><a href="/docs/MDN/About">{{ _('About MDN') }}</a></li>
<li><a href="{{ wiki_url('MDN/Feedback') }}">{{ _('Feedback') }}</a></li>
<li class="footer-social"><a href="https://twitter.com/mozdevnet" class="only-icon"><i aria-hidden="true" class="icon-twitter"></i> <span>{{ _('Twitter') }}</span></a></li>
<li class="footer-social"><a href="https://github.com/mdn/" class="only-icon"><i aria-hidden="true" class="icon-github"></i> <span>{{ _('GitHub') }}</span></a></li>
</ul>
</div>
<a href="https://mozilla.org" class="nav-footer-mozilla">{{ _('Mozilla') }}</a>
<div class="footer-group footer-group-mozilla">
<h2 class="footer-title">Mozilla</h2>
<ul class="footer-list">
<li><a href="https://www.mozilla.org/about/">{{ _('About') }}</a></li>
<li><a href="https://www.mozilla.org/contact/">{{ _('Contact Us') }}</a></li>
<li><a href="https://donate.mozilla.org/?utm_source=developer.mozilla.org&utm_medium=referral&utm_content=footer">{{ _('Donate') }}</a></li>
<li><a href="https://www.mozilla.org/firefox/?utm_source=developer.mozilla.org&utm_campaign=footer&utm_medium=referral">Firefox</a></li>
<li class="footer-social"><a href="https://twitter.com/mozilla" class="only-icon"><i aria-hidden="true" class="icon-twitter"></i> <span>{{ _('Twitter') }}</span></a></li>
<li class="footer-social"><a href="https://www.facebook.com/mozilla" class="only-icon"><i aria-hidden="true" class="icon-facebook"></i> <span>{{ _('Facebook') }}</span></a></li>
<li class="footer-social"><a href="https://www.instagram.com/mozillagram/" class="only-icon"><i aria-hidden="true" class="icon-instagram"></i> <span>{{ _('Instagram') }}</span></a></li>
</ul>
</div>
{% block lang_switcher %}
{% include "includes/lang_switcher.html" %}
{% endblock %}
{% block footer_copyright %}
<ul class="footer-tos">
<li><a href="https://www.mozilla.org/about/legal/terms/mozilla">{{ _('Terms') }}</a></li>
<li><a href="https://www.mozilla.org/privacy/websites/">{{ _('Privacy') }}</a></li>
<li><a href="https://www.mozilla.org/privacy/websites/#cookies">{{ _('Cookies') }}</a></li>
</ul>
<div id="license" class="contentinfo">
{% trans copyright_url='/en-US/docs/MDN/About#Copyrights_and_licenses', thisyear=thisyear() %}
<p>© 2005-{{ thisyear }} Mozilla and individual contributors.</p>
<p>Content is available under <a href="{{ copyright_url }}">these licenses</a>.</p>
{% endtrans %}
</div>
{% endblock %}
</div>
</footer>
{%- endif %} {# if not untrusted #}
<!-- site js -->
{% block site_js %}
<!--[if lte IE 8]>{% javascript 'selectivizr' %}<![endif]-->
{{ providers_media_js() }}
<script src="{{ statici18n(request.LANGUAGE_CODE) }}"></script>
{% javascript 'main' %}
<script>
if (window.mdn && mdn.analytics) mdn.analytics.trackOutboundLinks();
</script>
{% for script in scripts %}
{% javascript script %}
{% endfor %}
{% endblock %}
{% block js %}{% endblock %}
</body>
</html>