{% extends 'base.html' %}

{% block content_body %}
<div class="login-box">
    <div class="login-logo">
        <a href='{% url "home" %}'><b>{{ SITE_NAME }} </b>Login</a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg">Sign in to start your session</p>

        <form action="../auth/" method="post" onsubmit="">
            <input id="next_input" type="hidden" name="next" class="form-control">
            {% csrf_token %}
            <div class="form-group has-feedback">
                <input type="username" name="username" class="form-control" placeholder="Username" required>
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" name="password" class="form-control" placeholder="Password" required>
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">
                <div class="col-xs-8">

                </div>
                <!-- /.col -->
                <div class="col-xs-4">
                    <button type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
                </div>
                <!-- /.col -->
            </div>
        </form>


    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->
{% endblock %}

{% block resource_block %}
<script>
    $(document).ready(function () {
        var next_value = getUrlParameter('next');
        console.log('next_value', next_value);
        if(next_value)
            $('#next_input').val(next_value);
    });
</script>
{% endblock %}
