{% extends "modal_delete_form.html" %}

{% load i18n %}
{% load inventree_extras %}

{% block pre_form_content %}
<div class='alert alert-block alert-danger'>
    {% trans "Are you sure you want to delete this stock location?" %}
</div>
    
{% if location.children.all|length > 0 %}
<div class='alert alert-block alert-warning'>
    {% blocktrans with n=location.children.all|length %}This location contains {{ n }} child locations{% endblocktrans %}.<br>
    {% if location.parent %}
    {% blocktrans with location=location.parent.name %}If this location is deleted, these child locations will be moved to {{ location }}{% endblocktrans %}.
    {% else %}
    {% trans "If this location is deleted, these child locations will be moved to the top level stock location" %}.
    {% endif %}
</div>
{% endif %}


{% if location.stock_items.all|length > 0 %}
<div class='alert alert-block alert-warning'>
    {% blocktrans with n=location.stock_items.all|length %}This location contains {{ n }} stock items{% endblocktrans %}.<br>
    {% if location.parent %}
    {% blocktrans with location=location.parent.name %}If this location is deleted, these stock items will be moved to {{ location }}{% endblocktrans %}.
    {% else %}
    {% trans "If this location is deleted, these stock items will be moved to the top level stock location" %}.
    {% endif %}
</div>
{% endif %}

{% endblock %}