aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/templates/views/login.html
blob: e03b06c0e68c3215ea0745232e659a3d4bb44ffc (plain) (blame)
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
{% extends "layouts/default" %}
{% block content %}
    <script>
        function showLoginForm() {
            var form = document.getElementById('signinform');
            form.style.display = 'block';
            var nick = document.getElementById('nickinput');
            nick.focus();
            return false;
        }
        function ready(fn) {
            if (document.readyState != 'loading') {
                fn();
            } else {
                document.addEventListener('DOMContentLoaded', fn);
            }
        }
        ready(function() {
            var params = new URLSearchParams(window.location.search);
            if (params.has('error')) {
                showLoginForm();
            }
        });
    </script>
    <div id="signup">
        {{ i18n("messages","label.register") }}:
        <div id="facebook"><a href="/_fblogin" rel="nofollow">Facebook</a></div>
        <div id="vk"><a href="/_vklogin" rel="nofollow">ВКонтакте</a></div>
        <div id="tg">
            <script async src="https://telegram.org/js/telegram-widget.js?21" data-telegram-login="{{ tgBot }}"
                data-size="medium" data-radius="0" data-auth-url="https://{{ domain }}/_tglogin"
                data-request-access="write"></script>
        </div>
        <div id="apple">
            <a href="/_apple" rel="nofollow"></a>
        </div>
    </div>
    <div id="signin">
        <a href="#" onclick="return showLoginForm();">
            {{ i18n("messages","question.areRegistered") }}
        </a>
        <div id="signinform">
            <form action="/login" method="POST">
                <p class="err">{{ authErrorMessage | default('') }}</p>
                <input class="txt" type="text" name="username" placeholder='{{ i18n("messages","label.username") }}'
                    id="nickinput" autocomplete="username" />
                <input class="txt" type="password" name="password"
                    placeholder='{{ i18n("messages","label.password") }}' autocomplete="current-password" />
                <input class="submit" type="submit" value="OK" />
            </form>
        </div>
    </div>
{% endblock %}
{% block "column" %}
{% include "views/partial/homecolumn" %}
{% endblock %}