{% extends "cosinnus/base.html" %}
{% load i18n cosinnus_tags widget_tweaks %}

{% block page_title %}{% trans "Login" %}{% endblock %}

{% block jshead %}
    {% comment %} This page deals with authentication data and loads only the most necessary vendor scripts! {% endcomment %}
{% endblock jshead %}

{% block override_breadcrumb %}
{% endblock override_breadcrumb %}

{% block leftnav %}
    {% if not SETTINGS.COSINNUS_IS_SSO_PORTAL %}
        {% include "cosinnus/registration/leftnav.html"  with current_page="login" %}
    {% endif %}
{% endblock leftnav %}

{% block content %}

{% if not SETTINGS.COSINNUS_IS_SSO_PORTAL %}

<form action="" method="post" class="cosinnus-form form-horizontal" role="form">
    {% csrf_token %}
    <input type="hidden" name="next" value="{% if request.GET.next %}{{ request.GET.next }}{% else %}{% url 'cosinnus:user-dashboard' %}{% endif %}">
    {{ form.non_field_errors }}
    
    <!-- a box with semi transparent background -->
    <div class="content-box">
        <h2>{% trans "Log in" %}</h2>
    
        {# Regular Field #}
		{% trans "Email" as login_label %}
		{% trans "Email" as login_placeholder %}
		{% include 'cosinnus/fields/default_field.html' with field=form.username label=login_label placeholder=login_placeholder first=True %}
	        
	    {# Regular Field #}
		{% trans "Password" as password_label %}
		{% trans "Password" as password_placeholder %}
		{% include 'cosinnus/fields/default_field.html' with field=form.password label=password_label placeholder=password_placeholder %}
	        
    </div><!-- content-box -->

    <button type="submit" class="btn btn-emphasized">
        <ul class="media-list">
            <li class="media">
                <span class="pull-left" href="#" tabindex="-1">
                    <i class="fa fa-hand-o-right"></i>
                </span>
                <div class="media-body">
                    {% trans "Login" %}
                </div>
            </li>
        </ul>
    </button>


</form>
{% else %}
    
    
    <div class="content-box cms-content">
        
	    <h1>{% trans "Login" %}</h1>
	    
	    <br/>
        {% include 'cosinnus/registration/sso_login_button.html' %}                        
        <br/>
        
    </div><!-- content-box -->

{% endif %}

{% endblock content %}


