{% extends "layouts/base-fullscreen.html" %}

{% block title %} Login {% endblock %} 

<!-- Specific Page CSS goes HERE  -->
{% block stylesheets %}{% endblock stylesheets %}

{% block content %}

    <div class="content">
        <div class="container">
            <div class="row pt-5">
                <div class="col-md-6 mt-5 offset-md-3 pt-5 mt-5">
                    <div class="card">
                        
                        <div class="card-header text-center py-4">
                            <h4 class="title">
                                Sign IN
                            </h4>

                            <h6 class="card-category">
                                {% if msg %}
                                  <span class="text-danger">{{ msg | safe }}</span>
                                {% else %}
                                <span>
                                  Add your credentials
                                </span>
                                {% endif %}  
                            </h6>
                        </div>

                        <form role="form" method="post" action="">
                                
                            {{ form.hidden_tag() }} 

                            <div class="card-body px-5 py-3"> 

                                <div class="row">
                                    <div class="col-md-12 px-md-1">
                                        <div class="form-group">
                                            <label>Username</label>
                                            {{ form.username(class="form-control") }}
                                        </div>
                                    </div>

                                    <div class="col-md-12 px-md-1">
                                        <div class="form-group">
                                            <label>Password</label>
                                            {{ form.password(class="form-control", type="password") }}
                                        </div>
                                    </div>
                                </div>

                                
                            </div>
                            
                            <div class="card-footer text-center">
                                <button type="submit" name="login" class="btn btn-fill btn-primary">Login</button>
                                
                                <br /><br />

                                <p>
                                    Don't have an account? <a href="{{ url_for('authentication_blueprint.register') }}" class="text-primary">Register</a>                            
                                </p>
                            </div>

                            {% if config.SOCIAL_AUTH_GITHUB %}

                                <div class="text-center">
            
                                <span class="text-muted">or Sign IN with</span> 
                                    
                                    <br />
                                    <br />
                                    
                                    <div class="text-center mx-auto">
            
                                    {% if config.SOCIAL_AUTH_GITHUB %}
                                        <a href="{{url_for('authentication_blueprint.login_github')}}" class="btn btn-github btn-sm">
                                        <i class="fab fa-github"></i>
                                        </a>
                                    {% endif %}
            
                                    </div>
            
                                </div>  

                                <br />
        
                            {% endif %}


                        </form>

                    </div>
                </div>

            </div>
        </div>

    </div>

    <br />

{% endblock content %}

<!-- Specific Page JS goes HERE  -->
{% block javascripts %}{% endblock javascripts %}
