-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
layout.html
340 lines (325 loc) · 17.6 KB
/
layout.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/font-awesome.min.css">
<link rel="search" type="application/opensearchdescription+xml" title="{{ site_name }}" href="/static/opensearch.xml" />
<meta property="og:image" content="/static/og.png" />
<link rel="apple-touch-icon" sizes="57x57" href="/static/57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/static/60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/static/72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/static/76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/static/114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/static/120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/static/144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/static/152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/static/180x180.png">
<link rel="icon" type="image/png" href="/static/16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/static/32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/static/96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/static/192x192.png" sizes="192x192">
<link rel="manifest" href="/static/manifest.json">
<link rel="mask-icon" href="/static/fav.svg" color="#204499">
<link rel="shortcut icon" href="/static/57x57.ico">
<meta name="msapplication-TileColor" content="#204499">
<meta name="msapplication-TileImage" content="/static/144x144.png">
<meta name="msapplication-config" content="/static/browserconfig.xml">
<meta name="theme-color" content="#204499">
{% block title %}
<title>{{ site_name }}</title>
{% endblock %}
<link href="/static/bootstrap.min.css" rel="stylesheet">
<link href="/static/bootstrap-theme.css" rel="stylesheet">
{% block styles %}
{% endblock %}
<!-- Piwik -->
{% if admin %}
{% set VisitorType = 'Admin' %}
{% else %}
{% if not user %}
{% set VisitorType = 'Guest' %}
{% else %}
{% set VisitorType = 'Member' %}
{% endif %}
{% endif %}
{% if results is defined %}
{% set SearchResultCount = results|length %}
{% else %}
{% set SearchResultCount = 0 %}
{% endif %}
<noscript><p><img src="//stats.52k.de/piwik.php?idsite=10" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
</head>
<body class="{% if user %}logged-in{% endif %}">
{% block nav %}
<nav class="navbar navbar-default navbar-fixed-top {% if user and user.admin %}navbar-admin{% endif %}" role="navigation" >
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand space-left-right" id="pagetitle" href="/" style="display: inline;vertical-align: middle;padding-top: 2.5mm;margin-right: 0;padding-right: 0; width: auto; ">
<span class="darker"><img class="logoimg" src="/static/logo4.png" alt="SpaceDock" border="0" height="85%"/> {% if ga %}<img class="sublogo" src="/static/sublogo.png" alt=">" border="0" height="85%"/> <a style="position: relative; top: 3mm;" class="gamename" href="/{{ ga.short }}">{{ ga.name }}</a>{% endif %}</span>
</a>
<!--
{% if admin %}
<p class="navbar-text" style="color: white">Admin</p>
{% endif %}
-->
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
{% if not user %}
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" ><span class="glyphicon glyphicon-menu-hamburger"></span></a>
<ul class="dropdown-menu" >
<li>
<a href="#" data-toggle="modal" data-target="#loginModal">Login</a>
</li>
{% if registration %}
<li><a href="{{ url_for("accounts.register") }}">Register</a></li>
{% endif %}
<li class="divider"></li>
<li><a href="{{ donation_link }}" target="_BLANK">Donate</a></li>
<li class="divider"></li>
<li><a href="/random">Random Mod</a></li>
<li><a href="/blog">Blog</a></li>
</ul>
</li>
</ul>
{% else %}
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Welcome, {{ user.username }} <span class="glyphicon glyphicon-menu-hamburger"></span></a>
<ul class="dropdown-menu{% if user and user.admin %} dropdown-menu-admin{% endif %}" >
<li><a href="/random">Random Mod</a></li>
<li><a href="/blog">Blog</a></li>
<li class="divider"></li>
<li><a href="{{ donation_link }}">Donate</a></li>
<li class="divider"></li>
<li>
<a href="/create/mod">
<span class="glyphicon glyphicon-open"></span> Create a New Mod
</a>
</li>
<li>
<a href="/create/pack">
<span class="glyphicon glyphicon-list"></span> Create a New Pack
</a>
</li>
<li>
<a href="{{ url_for("profile.view_profile", username=user.username) }}">
<span class="glyphicon glyphicon-user"></span> View Your Profile
</a>
</li>
<li>
<a href="{{ url_for("profile.profile", username=user.username) }}">
<span class="glyphicon glyphicon-pencil"></span> Edit Your Profile
</a>
</li>
{% if admin %}
<li>
<a href="{{ url_for("admin.admin_main") }}">
<span class="glyphicon glyphicon-fire"></span> Admin Stuff
</a>
</li>
{% endif %}
<li class="divider"></li>
<li>
<a href="{{ url_for("accounts.logout") }}">
<span class="glyphicon glyphicon-remove"></span> Log Out
</a>
</li>
</ul>
</li>
</ul>
{% endif %}
{% block search %}
<form class="navbar-form navbar-search" role="search" action="{% if ga %}/{{ ga.short }}{% endif %}/search" method="GET">
<div class="form-group">
<input type="text" class="form-control search-box" name="query" placeholder="Search mods...">
</div>
</form>
{% endblock %}
</div>
</div>
</nav>
{% endblock %}
{%- if announcements %}
<div class="container">
{%- for announcement in announcements %}
<div class="well alert alert-danger" style="padding:0.5em 1em;">
<h1>{{ announcement.title }} <small>{{ announcement.created.strftime("%Y-%m-%d %H:%M") }}</small></h1>
<div class="">{{ announcement.text | markdown }}</div>
</div>
{%- endfor %}
</div>
{%- endif %}
<div class="alert alert-info alert-dismissable alert-fixed hidden" id="alert-follow">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>Done!</strong> You'll get emailed updates for this mod.
</div>
{% if donation_header_link %}
<div class="centered alert alert-danger alert-dismissable no-margin" id="alert-donate">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{{ site_name }} needs your help! Please consider <a href="{{ donation_link }}" class="alert-link">donating</a> to keep us online.
</div>
{% endif %}
{% block body %}{% endblock %}
<footer>
<div class="container centered">
<hr />
<div class="row">
<div class="col-lg-12">
<ul class="nav nav-pills nav-justified">
<li><a href="{{ source_code }}">Source Code</a></li>
<li><a href="{{ source_code }}/blob/master/api.md">API</a></li>
<li><a href="/privacy">Terms & Privacy</a></li>
<li><a href="mailto:{{ support_mail }}">Support</a></li>
{% for key, value in support_channels.items() %}
{% if value %}
<li><a href="{{ value }}" target="_blank">{{ key }}</a></li>
{% endif %}
{% endfor %}
{% if donation_link %}
<li><a href="{{ donation_link }}">Donate</a></li>
{% endif %}
</ul>
</div>
</div>
</div>
</footer>
<!-- Modal -->
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="Login"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">Login</h4>
</div>
<form role="form" action="/login" method="POST">
<div class="modal-body">
<input type="text" id="username" placeholder="Username" name="username">
<input type="password" id="password" placeholder="Password"
name="password">
<div class="checkbox">
<label>
<input type="checkbox" name="remember-me" id="remember-me">
Remember Me
</label>
</div>
<input type="hidden" name="return_to" value="{{ request.path }}">
{% for provider in oauth_providers %}
{% set provider_icon = oauth_providers[provider].icon %}
{% set provider_full_name = oauth_providers[provider].full_name %}
<form action="/login-oauth" method="POST">
<input type="hidden" name="provider" value="{{ provider }}">
<button type="submit" value="" class="btn btn-primary">
<i class="fa fa-{{ provider_icon }}"></i> Log In
using {{ provider_full_name }}
</button>
</form>
{% endfor %}
<a href="{{ url_for("accounts.forgot_password") }}">
<span class="glyphicon glyphicon-question-sign"></span> Forgot
Password
</a>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close
</button>
<input type="submit"
onclick="javascript:_paq.push(['trackEvent', 'Menu', 'Login']);"
value="Log In" class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
<!-- End Modal -->
</body>
<script src="/static/jquery.min.js"></script>
<script src="/static/underscore.min.js"></script>
<script src="/static/bootstrap.min.js"></script>
<script src="/static/jscroll.min.js"></script>
<script src="/static/global.js"></script>
<script src="/static/piwik_loader.js"></script>
<!--[if lt IE 9]>
<script src="/static/html5shiv.js"></script>
<script src="/static/respond.min.js"></script>
<![endif]-->
{% if not dnt %}
{% if analytics_id and analytics_domain %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ analytics_id }}', '{{ analytics_domain }}');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
{% endif %}
{% endif %}
<script>
function resize_boxes() {
var x = $(".modbox, .gamebox").outerWidth();
$(".modbox, .gamebox").css('height', (((x / 16) * 9) + 40) + 'px');
x = $(".packbox").outerWidth();
$(".packbox").css('height', (((x / 16) * 9) + 40) + 'px');
}
$( document ).ready(function() {
resize_boxes();
$(window).on('resize', resize_boxes);
$(".changer").mouseover(function (el, index) {
$(this).children(".front").hide();
$(this).children(".back").show();
});
$(".changer").mouseout(function (el, index) {
$(this).children(".front").show();
$(this).children(".back").hide();
});
$("#loginModal").on('shown.bs.modal', function () {
$("#username").focus();
});
});
var searchCount = {{ SearchResultCount }};
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.http"]);
_paq.push(["setDomains", ["*.http","*.spacedock.info"]]);
_paq.push(['enableHeartBeatTimer']);
new Fingerprint2().get(function(result, components){
var fp = parseInt(result,16);
_paq.push(['setUserId', fp.toString(36)]);
});
_paq.push(['setCustomVariable','1','VisitorType','{{ VisitorType }}','visit']);
_paq.push(['setCustomVariable','2','ThemeType','{{ user.dark_theme }}','visit']);
{% if admin or user %}
_paq.push(['setCustomVariable','2','UserName','{{ user.username }}','visit']);
{% else %}
_paq.push(['setCustomVariable','2','UserName','','visit']);
{% endif %}
_paq.push(['setCustomUrl', document.URL + '&search_count=' + searchCount]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['trackAllContentImpressions',true,750]);
(function() {
var u="//stats.52k.de/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 10]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
{% block scripts %}{% endblock %}
</html>