devicehub-django/lot/templates/delete_lot.html

61 lines
2 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% load django_bootstrap5 %}
{% block content %}
<div class="row">
<div class="col">
<h3>{{ subtitle }}</h3>
</div>
</div>
<div class="row mb-3">
<div class="col">
<div class="card {% if object.devices.count > 0 %}border border-danger{% else %}border border-light{% endif %}">
<div class="card-body">
<h5 class="card-title">{% trans "Delete Lot" %}</h5>
<div class="card-text mt-4">
{% blocktranslate with name=object.name count devices=object.devices.count %}
Are you sure you want to remove the lot "{{ name }}" with {{ devices }} device?
{% plural %}
Are you sure you want to remove the lot "{{ name }}" with {{ devices }} devices?
{% endblocktranslate %}
</div>
{% if object.devices.count > 0 %}
<div class="mt-3 text-danger">
<i class="bi bi-exclamation-circle-fill"></i>
{% trans "All associated devices will be deassigned." %}
</div>
{% else %}
<div class="mt-3 text-muted">
<i class="bi bi-info-circle-fill"></i>
{% trans "No devices are associated with this lot." %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
<form role="form" method="post">
{% csrf_token %}
{% if form.errors %}
<div class="alert alert-danger alert-icon alert-icon-border alert-dismissible" role="alert">
<div class="icon"><span class="mdi mdi-close-circle-o"></span></div>
<div class="message">
{% for field, error in form.errors.items %}
{{ error }}<br />
{% endfor %}
<button class="btn-close" type="button" data-dismiss="alert" aria-label="Close"></button>
</div>
</div>
{% endif %}
{% bootstrap_form form %}
<div class="form-actions-no-box">
<a class="btn btn-grey" href="{{ request.META.HTTP_REFERER }}">{% translate "Cancel" %}</a>
<input class="btn btn-danger" type="submit" name="submit" value="{% translate 'Delete' %}"/>
</div>
</form>
{% endblock %}