{% extends "pretixpresale/organizers/base.html" %}
{% load i18n %}
{% load icon %}
{% load eventurl %}
{% load bootstrap3 %}
{% block title %}{% trans "Log in" %}{% endblock %}
{% block content %}
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
            {% if request.organizer.settings.customer_accounts_native %}
                <form action="" method="post" class="form-horizontal blank-after">
                    {% csrf_token %}
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <h2 class="panel-title">   
                            {% blocktrans trimmed with org=request.organizer.name %}
                                Sign in to your account at {{ org }}
                            {% endblocktrans %}
                            </h2>
                        </div>
                        <div class="panel-body">
                            {% bootstrap_form form layout="checkout" %}

                            <div class="row">
                                <div class="col-md-8 col-sm-6 hidden-xs">
                                    <a class="btn btn-link btn-lg"
                                       href="{% eventurl request.organizer "presale:organizer.customer.register" %}">
                                        <small>
                                            {% icon "address-book-o" %}
                                            {% trans "Create account" %}
                                        </small>
                                    </a>
                                </div>
                                <div class="col-md-4 col-sm-6">
                                    <button class="btn btn-block btn-primary btn-lg" type="submit">
                                        {% icon "sign-in" %}
                                        {% trans "Log in" %}
                                    </button>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                            <div class="row visible-xs">
                                <div class="col-xs-12 text-center"><br>
                                    <a
                                       href="{% eventurl request.organizer "presale:organizer.customer.register" %}">
                                            {% icon "address-book-o" %}
                                            {% trans "Create account" %}
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            {% else %}
                <h2 class="blank-after">
                {% blocktrans trimmed with org=request.organizer.name %}
                    Sign in to your account at {{ org }}
                {% endblocktrans %}
                </h2>
            {% endif %}

            {% if providers %}
                <ul id="customer-account-login-providers" class="list-inline text-center blank-after">
                {% for provider in providers %}
                    <li>
                        <a href="{% eventurl request.organizer "presale:organizer.customer.login" provider=provider.pk %}?{{ request.META.QUERY_STRING }}"
                           class="btn {% if request.organizer.settings.customer_accounts_native %}btn-default{% else %}btn-primary btn-lg btn-block{% endif %}">
                            {% icon "sign-in" %} {{ provider.button_label }}
                        </a>
                    </li>
                {% endfor %}
                </ul>
            {% endif %}
        </div>
    </div>
    <p>&nbsp;</p>
{% endblock %}
