{% load i18n localcosmos_tags %}
{% if deleted %}
	
	{% block success_js %}
		<script>
			var object = $("#ctype-{{ content_type.id }}-{{ deleted_object_id }}");
			if (object.length){
				object.remove();
			}
			$("#Modal").modal("hide");
		</script>
	{% endblock %}
	{% block extra_success_js %}{% endblock %}
	
{% else %}
	<form method="POST" action="{{ url }}" class="xhr">{% csrf_token %}

		<div class="modal-header">
			<h5 class="modal-title">{% block title %}{% blocktrans %}Delete {{ verbose_name }}{% endblocktrans %}{% endblock %}</h5>
			<button type="button" class="close" data-dismiss="modal" aria-label="Close">
				<span aria-hidden="true">&times;</span>
			</button>
		</div>
		<div class="modal-body">
			<p>
				{% block deletion_text %}
					{% if deletion_message %}
						{{ deletion_message }}
					{% else %}
						{% blocktrans %}Do you really want to delete {{ verbose_name }}?{% endblocktrans %}
					{% endif %}
				{% endblock %}
			</p>
		</div>
		<div class="modal-footer">
			{% block footer %}
				<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">{% trans 'Close' %}</button>
				<button type="submit" class="btn btn-danger">{% trans 'Delete' %}</button>
			{% endblock %}
		</div>
	</form>
	{% block script %}
		<script>
			$("#LargeModal").modal("hide");
			$("#Modal").modal("show");
		</script>
	{% endblock %}
{% endif %}
