{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load static %}
{% load i18n %}

{% block page_title %}{% translate "SRP Fleet Create" %}{% endblock page_title %}
{% block extra_css %}
    {% include 'bundles/jquery-datetimepicker-css.html' %}
{% endblock extra_css %}

{% block content %}

    <div class="col-lg-12">
        <h1 class="page-header text-center">{% translate "Create SRP Fleet" %}</h1>

        <div class="container-fluid">
            <div class="col-md-4 col-md-offset-4">
                <div class="row">
                    {% if completed == False %}
                        <form class="form-signin" role="form" action="" method="POST">
                            {% csrf_token %}
                            {{ form|bootstrap }}
                            <br/>
                            <button class="btn btn-lg btn-primary btn-block" type="submit">{% translate "Create SRP Fleet" %}</button>
                        </form>
                    {% else %}
                        <div class="alert alert-info" role="alert">{% blocktrans %}Give this link to the line members{% endblocktrans %}.</div>
                        <div class="alert alert-info" role="alert">
                            {{ request.scheme }}://{{ request.get_host }}{% url 'srp:request' completed_srp_code %}</div>
                        <div class="text-center">
                            <a href="{% url 'srp:management' %}" class="btn btn-primary btn-lg">{% translate "Continue" %}</a>
                        </div>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>

{% endblock content %}

{% block extra_javascript %}
    {% include 'bundles/jquery-datetimepicker-js.html' %}
{% endblock %}

{% block extra_script %}
    $('#id_fleet_time').datetimepicker({
        setlocale: '{{ LANGUAGE_CODE }}',
        {% if NIGHT_MODE %}
            theme: 'dark',
        {% else %}
            theme: 'default',
        {% endif %}
        mask: true,
        format: 'Y-m-d H:i',
        minDate: 0
    });
{% endblock extra_script %}
