{% extends "maraudes/base.html" %}
{% load bootstrap4 %}
{% block title %} {{ block.super }} Compte-rendu du {{ object.date }} {% endblock %}

{% block breadcrumbs %}
  <h6 class="navbar-text my-2 text-white">Transmission</h6>
{% endblock %}


{% block page_content %}
{% if object.est_terminee %}<div class="alert alert-warning"><p>Ce compte-rendu a déjà été finalisé !</p></div>
{% else %}
<div class="col-lg-12">
<form method="post" action="{% url 'maraudes:finalize' maraude.pk %}">
    {% csrf_token %}
      <div class="card shadow">
        <h4 class="card-header">Envoyer un message</h4>
        <div class="card-body">
          {% bootstrap_form form %}
        </div>
        <div class="card-footer text-right">
          {% bootstrap_button "Pas de message" button_type="link" href="?no_mail=True" button_class="btn btn-danger btn-sm" %}
          <button class="btn btn-success btn-sm" id="send-button" data-loading-text="Envoi en cours..." type="submit">Envoyer</button>
        </div>
      </div>
    </form>
    <script>$('#send-button').on('click', function () {$(this).button('loading')})</script>
</div>
{% endif %}

{% endblock %}
