{% extends "admin/formative/confirmation.html" %}
{% load i18n %}

{% block content_title %} {% trans 'Unpublish' %} {% endblock %}

{% block cardtitle %}
        {% trans 'Unpublish' %} {{ object }}
{% endblock %}

{% block cardcontent %}
    <p>
      Are you sure you want to unpublish the form "{{ object }}"?<br>
    </p>
    {% if submissions %}
      <p>
        It is NOT recommended to unpublish a form that has submissions.<br>
        Consider making the form hidden, instead. TODO: link to export
      </p>
      <p>All of the following related items will be deleted:</p>
    {% endif %}
{% endblock %}

{% block rowcontent %}
      <div class="col-12 col-sm-9">
        {% if submissions %}<h4>{% trans "Objects" %}</h4>{% endif %}
        <ol>
        {% for rec in submissions %}
          <li>
            Submission: {{ rec.0 }}
            {% if rec.1 %}<ul>{{ rec.1 }} items</ul>{% endif %}
          </li>
        {% endfor %}
        </ol>
      </div>
{% endblock %}

{% block formcontrols %}
        <div class="form-group">
          <input type="submit" name="_unpublish_confirmed"
                 class="btn {{ jazzmin_ui.button_classes.danger }}
                        form-control" value="{% trans "Yes, I'm sure" %}">
        </div>
        <div class="form-group">
          <a href="#" class="btn {{ jazzmin_ui.button_classes.primary }}
                             cancel-link form-control">
            {% trans "No, take me back" %}
          </a>
        </div>
{% endblock %}
