{% extends "structuretimers/base.html" %}
{% load bootstrap %}
{% load staticfiles %}
{% load i18n %}

{% block details %}
    <div class="col-lg-12">                
        {% include 'structuretimers/index_button.html' %}
        <div class="container-fluid">
            <div class="col-md-4 col-md-offset-4">
                <div class="row">
                    {% if form.errors %}
                        <p class="text-danger">
                            <i class="fas fa-exclamation-triangle"></i>
                            <strong> Please correct the input errors below</strong>
                        </p>
                    {% endif %}
                    <form id="add-timer-form" class="form-signin" role="form" action="" method="POST">
                        {% csrf_token %}
                        {{ form|bootstrap }}
                        <br/>
                        <p>
                            <i class="fas fa-asterisk"></i> required fields
                        </p>
                        <button class="btn btn-lg btn-primary btn-block" type="submit">
                            {% block submit_button_text %}
                            {% endblock %}
                        </button>
                    </form>                    
                </div>
            </div>
        </div>
    </div>

    <!-- share data with JS part -->
    <div 
        id="dataExport" 
        data-select2SolarSystemsUrl="{% url 'structuretimers:select2_solar_systems' %}" 
        data-select2StructureTypesUrl="{% url 'structuretimers:select2_structure_types' %}"> 
    </div>

{% endblock details %}

{% block extra_css %}
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2-bootstrap-theme/0.1.0-beta.10/select2-bootstrap.min.css" rel="stylesheet" />
<link href="{% static 'structuretimers/timer_edit.css' %}" rel="stylesheet" />
{% endblock extra_css %}

{% block extra_javascript %}
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script>
<script type="text/javascript" src="{% static 'structuretimers/timer_edit.js' %}"></script>
{% endblock extra_javascript %}
