-
-
Notifications
You must be signed in to change notification settings - Fork 811
Expand file tree
/
Copy pathlayout.html
More file actions
218 lines (194 loc) Β· 10.4 KB
/
layout.html
File metadata and controls
218 lines (194 loc) Β· 10.4 KB
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
{%- from "macros/translation.html" import transbag -%}
{%- macro menu_item(identifier) -%}
{%- set identifier_url = '/' + identifier -%}
{%- set trans_url = identifier_url|url(alt=this.alt) -%}
{%- set this_is_child = this.is_child_of(identifier_url) -%}
<li class="nav-item{% if this_is_child %} active{% endif %}">
<a class="nav-link" href="{{ trans_url }}">{{- transbag('menu', this.alt, identifier) -}}{%- if this_is_child -%}<span class="sr-only">(current)</span>{%- endif -%}</a>
</li>
{%- endmacro -%}
{%- set t_languages = transbag('menu', this.alt, 'languages') -%}
{%- set t_sitemap = transbag('translate', this.alt, 'sitemap') -%}
{%- set t_welcome = transbag('translate', this.alt, 'welcome') -%}
{%- set t_edit_on_github = transbag('translate', this.alt, 'edit_on_github') -%}
{%- set t_create_on_github = transbag('translate', this.alt, 'create_on_github') -%}
{%- set t_translation_out_of_date = transbag('translate', this.alt, 'translation_out_of_date') -%}
{%- set t_see_original_content = transbag('translate', this.alt, 'see_original_content') -%}
{%- set t_update_translation = transbag('translate', this.alt, 'update_translation') -%}
{%- set diff = alt_outdated_diff(this) -%}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags always come first -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{%- block title %}{{- t_welcome -}}{% endblock -%} β BeeWare</title>
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/images/brutus-144.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/images/brutus-114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/images/brutus-72.png">
<link rel="apple-touch-icon-precomposed" href="/static/images/brutus-57.png">
<link rel="shortcut icon" href="/static/images/brutus-32.png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/static/bootstrap/css/bootstrap-grid.min.css">
<!-- Project CSS -->
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Cutive">
<link rel="stylesheet" type="text/css" href="/static/beeware.css">
{%- if diff -%}
<!-- Project CSS -->
{{- get_pygments_css_styles('default')|safe -}}
{%- endif -%}
{%- if this.alt in ['ar', 'fa'] -%}
<link rel="stylesheet" type="text/css" href="/static/rtl.css">
{%- endif -%}
<!-- Font Awesome -->
<script src="https://kit.fontawesome.com/078c86a30a.js" crossorigin="anonymous"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-2943925-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-2943925-4');
</script>
{%- block extra_head -%}{%- endblock -%}
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<div class="nav-top">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsDefault" aria-controls="navbarsDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-brand-block">
<a class="navbar-brand" href="{{ '/'|url(alt=this.alt) }}"><img class="mx-2" src="{{ '/static/images/brutus-32.png'|asseturl }}">BeeWare</a>
</div>
</div>
<div class="collapse navbar-collapse" id="navbarsDefault">
<ul class="navbar-nav mr-auto">
{{ menu_item('about') }}
{{ menu_item('project') }}
{{ menu_item('community') }}
{{ menu_item('contributing') }}
{{ menu_item('news') }}
<li class="nav-item">
<a class="nav-link" href={{ "/membership"|url(alt=this.alt) }}>
{{ transbag('menu', this.alt, 'donate') }}
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
{%- set extra_slash = '/' if this.path[-1] != '/' else '' -%}
{%- set alt_path = '%2B' + this.alt if this.alt and this.alt != 'en' else '' -%}
<li class="nav-item">
{%- if this.alt in get_alts(source=this, fallback=False) -%}
{%- set edit_link = 'https://github.com/beeware/beeware.github.io/edit/lektor/content' + this.path.split('@')[0] + extra_slash + 'contents' + alt_path + '.lr' -%}
<a class="nav-link" href="{{ edit_link }}" rel="noopener noreferrer" target="_blank">
<i class="fa fa-github "></i><small> {{ t_edit_on_github }}</small>
</a>
{%- else -%}
{# This method is provided by a custom plugin found in /packages/lektor_beeware_plugin/ #}
{%- set content_value = urlencode_limit(site.get(this.path, alt='_primary').contents.as_text(), limit=5000) -%}
{%- if content_value and '@' not in this.path -%}
<a class="nav-link" href="https://github.com/beeware/beeware.github.io/new/lektor/content{{ this.path }}/contents{{ alt_path }}.lr?filename=contents{{ alt_path }}.lr&value={{ content_value }}" target="_blank">
<i class="fa fa-github "></i><small> {{ t_create_on_github }}</small>
</a>
{%- endif -%}
{%- endif -%}
</li>
<li class="nav-item dropdown dropdown-pull-right">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-globe" aria-hidden="true"></i> <span class="caret"></span>
</a>
<div class="dropdown-menu" aria-labelledby="dropdown01">
{%- set eng_active = this.alt == 'en' %}
<a class="dropdown-item {% if eng_active %}active{% endif %}" href="{{ '.'|url(alt='en') }}">
English
</a>
{%- for alt, alternative in config.ALTERNATIVES.items()|sort -%}
{%- set alt_active = alt == this.alt -%}
{%- if alt != config.primary_alternative %}
<a class="dropdown-item{% if alt_active %} active{% endif %}" href="{{ '.'|url(alt=alt) }}">
{{- transbag('translate', alt, alternative.name.en.lower()) -}}
</a>
{%- endif -%}
{%- endfor %}
</div>
</li>
</ul>
</div>
</nav>
<div class="content">
{%- block preamble -%}
{%- endblock -%}
<div class="container">
{%- if this.alt in get_alts(source=this, fallback=False) and diff -%}
<div class="alert alert-warning">
<i class="fa fa-warning"></i> {{ t_translation_out_of_date }}
<a href="{{ site.get(this.path, alt='_primary')|url }}" data-toggle="modal" data-target="#myModal">{{ t_see_original_content }}</a>
</div>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<a href="{{ edit_link }}" target="_blank">
<i class="fa fa-github "></i> {{ t_update_translation }}
</a>
</h4>
</div>
<div class="modal-body">
<small>
{{- diff|safe -}}
</small>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- End Modal content -->
</div>
</div>
<!-- End Modal -->
{%- endif -%}
{%- block body -%}{%- endblock -%}
</div>
</div>
<footer class="footer">
<div class="container text-muted">
<div class="d-block d-sm-none copyright">© Russell Keith-Magee {{ none|dateformat('Y') }}</div>
<div class="float-right clearfix d-sm-block d-none">© Russell Keith-Magee {{ none|dateformat('Y') }}</div>
<p class="d-sm-block d-none">
<a href="https://github.com/beeware/"><i class="fa fa-github fa-lg" aria-hidden="true"></i> GitHub</a> |
<a href="https://beeware.org/bee/chat/"><i class="fa-brands fa-discord fa-lg" aria-hidden="true"></i> Discord</a> |
<a href="https://fosstodon.org/@beeware"><i class="fa-brands fa-mastodon fa-lg" aria-hidden="true"></i> Mastodon</a> |
<a href="{{ '/sitemap'|url(alt=this.alt) }}"><i class="fa fa-sitemap fa-lg" aria-hidden="true"></i> {{ t_sitemap }}</a>
</p>
<p class="d-block d-sm-none footer-social">
<a href="https://github.com/beeware/"><i class="fa fa-github fa-lg" aria-hidden="true"></i> GitHub</a> |
<a href="https://beeware.org/bee/chat/"><i class="fa-brands fa-discord fa-lg" aria-hidden="true"></i> Discord</a> |
<a rel="me" href="https://fosstodon.org/@beeware"><i class="fa-brands fa-mastodon fa-lg" aria-hidden="true"></i> Mastodon</a>
</p>
<p class="d-block d-sm-none footer-sitemap">
<a href="{{ '/sitemap'|url(alt=this.alt) }}"><i class="fa fa-sitemap fa-lg" aria-hidden="true"></i> {{ t_sitemap }}</a>
</p>
{% set team = site.query('/about/team', alt=this.alt).all() %}
{% for member in team %}
{% if member.mastodon_handle %}
<a rel="me" href="https://{{ member.mastodon_handle.split('@')[2] }}/@{{ member.mastodon_handle.split('@')[1] }}" style="display:none" ></a>
{% endif %}
{% endfor %}
</div>
</footer>
<!-- jQuery first, then Bootstrap JS. -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="/static/tether-1.3.3/js/tether.min.js"></script>
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
{%- block extra_script -%}{%- endblock -%}
</body>
</html>