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


{% block extra_head %}
{# DateTimePicker #}
<script src={% static 'vendor/datepicker/datetimepicker.js' %}></script>
<link rel="stylesheet" href="{% static 'vendor/datepicker/datetimepicker.css' %}">

<script>
  $(document).ready(function($) {
    $('#id_start_date').datetimepicker({
      format: 'Y-m-d H:i'
    });
    $('#id_end_date').datetimepicker({
      format: 'Y-m-d H:i'
    });
  });

</script>
{% endblock %}

{% block content %}

{% for error in form.non_field_errors %}
<div class="notification is-danger">
  {{ error }}
</div>
{% endfor %}

<h1 class="title">{% trans "Création d'une élection" %}</h1>
<hr>

<form action="" method="post">
  {% csrf_token %}

  {% include "elections/forms/form.html" with errors=False %}

  <div class="field">
    <div class="control">
      <button class="button is-fullwidth is-outlined is-primary is-light">{% trans "Enregistrer" %}</button>
    </div>
  </div>
</form>

{% endblock %}
