{% extends "wiki/base.html" %}
{% from "wiki/includes/document_macros.html" import build_document_crumbs with context %}
{% block title %}{{ page_title(_('Delete Document | {document}')|f(document=document.title)) }}{% endblock %}
{% block content %}

  <article class="delete-document">

    {% if prevent %}
        <p class="warning">{{ _('Cannot delete pages with children until we fix this bug:') }} <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=972541">https://bugzilla.mozilla.org/show_bug.cgi?id=972541</a>
        </p>
    {% else %}

    {{ build_document_crumbs(document) }}

    <h1>{{ _('Delete') }} <a href="{{ url('wiki.document', document.full_path, locale=document.locale) }}">{{ _('{title}')|fe(title=document.title) }}</a></h1>

    <strong>{{ _('Creator') }}</strong>
    <p><a href="{{ revision.creator.get_absolute_url() }}">{{ revision.creator }}</a></p>

    <strong>{{ _('Creation Date') }}</strong>
    <p>{{ datetimeformat(revision.created, format='longdatetime') }}</p>

    <p>{{ _('You are about to delete this document and all of its revisions.  Please let us know why this page should be deleted.') }}</p>

    <form action="" method="post">
      {{ csrf() }}

      {{ form }}

      <p>{{ _('Are you sure you want to continue?') }}</p>

      <input type="submit" value="{{ _('Delete') }}" />
      <a href="{{ url('wiki.document', document.slug) }}">{{ _('Cancel') }}</a>

    </form>

    {% endif %}
  </article>

{% endblock %}
