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

{% if not roles.part.change %}
    <div class='alert alert-danger alert-block'>
        {% trans "You do not have permission to edit the BOM." %}
    </div>
{% endif %}

{% if part.bom_checked_date %}
{% if part.is_bom_valid %}
<div class='alert alert-block alert-info'>
{% else %}
<div class='alert alert-block alert-danger'>
    {% trans "The BOM this part has been changed, and must be validated" %}
{% endif %}
    {% blocktrans with part=part.full_name checker=part.bom_checked_by check_date=part.bom_checked_date %}This BOM was last checked by {{ checker }} on {{ check_date }}{% endblocktrans %}
</div>
{% else %}
<div class='alert alert-danger alert-block'>
    <strong>{% trans "This BOM has not been validated." %}</strong>
</div>
{% endif %}

<div id='bom-button-toolbar'>
    {% include "filter_list.html" with id="bom" %}
</div>

<table class='table table-bom table-condensed' data-toolbar="#bom-button-toolbar" id='bom-table'>
</table>
