mirror of
https://github.com/simple-login/app.git
synced 2024-11-17 22:21:38 +08:00
7ef78c991f
* Using CSS variable as a solution * The new darkmode css is now live in another file so that upgarding dashboard.css doesn't affect the darkmode itself * Used a naive darkmode controller by client javascript. No persistance state is stored in the backend at the moment
203 lines
No EOL
6.8 KiB
HTML
203 lines
No EOL
6.8 KiB
HTML
{% from "_formhelpers.html" import render_field, render_field_errors %}
|
|
|
|
<!doctype html>
|
|
<html lang="en" dir="ltr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport"
|
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<meta http-equiv="Content-Language" content="en"/>
|
|
<meta name="msapplication-TileColor" content="#2d89ef">
|
|
<meta name="theme-color" content="#4188c9">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="HandheldFriendly" content="True">
|
|
<meta name="MobileOptimized" content="320">
|
|
<link rel="icon" href="/static/favicon.ico" type="image/x-icon"/>
|
|
<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico"/>
|
|
|
|
<title>
|
|
{% block title %}{% endblock %} | SimpleLogin
|
|
</title>
|
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='node_modules/font-awesome/css/font-awesome.css') }}">
|
|
|
|
<!-- Dashboard Core -->
|
|
<link href="/static/assets/css/dashboard.css" rel="stylesheet"/>
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='assets/css/darkmode.css') }}?v={{ VERSION }}">
|
|
|
|
<!-- Tabler JS -->
|
|
<script src="/static/assets/js/vendors/jquery-3.2.1.min.js"></script>
|
|
<script src="/static/assets/js/vendors/bootstrap.bundle.min.js"></script>
|
|
<script src="/static/assets/js/vendors/jquery.sparkline.min.js"></script>
|
|
<script src="/static/assets/js/vendors/selectize.min.js"></script>
|
|
<script src="/static/assets/js/vendors/jquery.tablesorter.min.js"></script>
|
|
<script src="/static/assets/js/vendors/jquery-jvectormap-2.0.3.min.js"></script>
|
|
<script src="/static/assets/js/vendors/jquery-jvectormap-de-merc.js"></script>
|
|
<script src="/static/assets/js/vendors/jquery-jvectormap-world-mill.js"></script>
|
|
<script src="/static/assets/js/vendors/circle-progress.min.js"></script>
|
|
<script src="/static/assets/js/core.js"></script>
|
|
|
|
<!-- ClipboardJS -->
|
|
<script src="/static/vendor/clipboard.min.js"></script>
|
|
|
|
<!-- IntroJS -->
|
|
<link rel="stylesheet" type="text/css"
|
|
href="{{ url_for('static', filename='node_modules/intro.js/minified/introjs.min.css') }}">
|
|
<script src="{{ url_for('static', filename='node_modules/intro.js/minified/intro.min.js') }}"></script>
|
|
|
|
<!-- Sentry -->
|
|
<script src="{{ url_for('static', filename='node_modules/@sentry/browser/build/bundle.min.js') }}">
|
|
</script>
|
|
|
|
<link rel="stylesheet" href="/static/vendor/bootstrap-social.min.css">
|
|
|
|
<!-- Toastr library -->
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='node_modules/toastr/build/toastr.min.css') }}">
|
|
<script src="{{ url_for('static', filename='node_modules/toastr/build/toastr.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='node_modules/bootbox/dist/bootbox.min.js') }}"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/static/style.css?v={{ VERSION }}">
|
|
|
|
<script>
|
|
toastr.options.closeButton = true;
|
|
</script>
|
|
|
|
<!-- For additional head -->
|
|
{% block head %}
|
|
{% endblock %}
|
|
</head>
|
|
<body class="">
|
|
<div class="page">
|
|
<div class="container">
|
|
<!-- For flash messages -->
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
<!-- Categories: success (green), info (blue), warning (yellow), danger (red) -->
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<script>
|
|
toastr.{{category}}("{{ message }}");
|
|
</script>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
</div>
|
|
|
|
{% block content %}
|
|
{% endblock %}
|
|
</div>
|
|
|
|
<script>
|
|
{% if SENTRY_DSN %}
|
|
console.log("Init sentry");
|
|
try {
|
|
Sentry.init({
|
|
dsn: '{{SENTRY_DSN}}',
|
|
// https://docs.sentry.io/platforms/javascript/#filter-events--custom-logic
|
|
// Original gist https://gist.github.com/impressiver/5092952
|
|
ignoreErrors: [
|
|
// Random plugins/extensions
|
|
'top.GLOBALS',
|
|
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
|
|
'originalCreateNotification',
|
|
'canvas.contentDocument',
|
|
'MyApp_RemoveAllHighlights',
|
|
'http://tt.epicplay.com',
|
|
'Can\'t find variable: ZiteReader',
|
|
'jigsaw is not defined',
|
|
'ComboSearch is not defined',
|
|
'http://loading.retry.widdit.com/',
|
|
'atomicFindClose',
|
|
// Facebook borked
|
|
'fb_xd_fragment',
|
|
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
|
|
// reduce this. (thanks @acdha)
|
|
// See http://stackoverflow.com/questions/4113268
|
|
'bmi_SafeAddOnload',
|
|
'EBCallBackMessageReceived',
|
|
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
|
|
'conduitPage'
|
|
],
|
|
blacklistUrls: [
|
|
// Facebook flakiness
|
|
/graph\.facebook\.com/i,
|
|
// Facebook blocked
|
|
/connect\.facebook\.net\/en_US\/all\.js/i,
|
|
// Woopra flakiness
|
|
/eatdifferent\.com\.woopra-ns\.com/i,
|
|
/static\.woopra\.com\/js\/woopra\.js/i,
|
|
// Chrome extensions
|
|
/extensions\//i,
|
|
/^chrome:\/\//i,
|
|
// Other plugins
|
|
/127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
|
|
/webappstoolbarba\.texthelp\.com\//i,
|
|
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i
|
|
]
|
|
});
|
|
} catch (error) {
|
|
console.log("Sentry error, probably due to AdBlocker ...")
|
|
}
|
|
{% endif %}
|
|
|
|
// default options for bootbox
|
|
bootbox.setDefaults({
|
|
closeButton: false,
|
|
backdrop: true
|
|
})
|
|
|
|
var clipboard = new ClipboardJS('.clipboard');
|
|
|
|
clipboard.on('success', function (e) {
|
|
toastr.success("Copied to clipboard");
|
|
e.clearSelection();
|
|
});
|
|
|
|
// Handle back or close button
|
|
$('.back-or-close').on("click", function () {
|
|
// the window is actually a popup, in this case just close it
|
|
if (history.length == 1) {
|
|
window.close();
|
|
} else {
|
|
history.back();
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
<script src="/static/local-storage-polyfill.js"></script>
|
|
|
|
<!-- For additional script -->
|
|
{% block script %}
|
|
{% endblock %}
|
|
|
|
<script>
|
|
(function () {
|
|
// only enable on prod
|
|
if (!window.location.host.endsWith('simplelogin.io')) {
|
|
console.log("GoatCounter should only be enabled in prod");
|
|
return;
|
|
}
|
|
|
|
if (store.get('goatcounter-ignore') === 't') {
|
|
console.log("GoatCounter is disabled");
|
|
return;
|
|
}
|
|
|
|
console.log("init GoatCounter");
|
|
|
|
var script = document.createElement('script');
|
|
window.counter = 'https://app.goatcounter.com/count'
|
|
script.async = 1;
|
|
script.src = '//gc.zgo.at/count.js';
|
|
|
|
var ins = document.getElementsByTagName('script')[0];
|
|
ins.parentNode.insertBefore(script, ins)
|
|
})();
|
|
</script>
|
|
|
|
</body>
|
|
</html> |