{% extends 'generic/_base.html' %} {% load i18n %} {% comment %} Confirm page for the "Apply design" action: apply.py's plan()/run() pair. GET renders the dry run (this template, driven by `result` = plan()); a successful POST redirects away, a refused one re-renders this same template with the refusal (run() returns the SAME ApplyResult shape) -- see views.DesignApplyView. Context: - object: the Design being applied - result: an apply.ApplyResult -- .problems/.created/.updated/.removed/ .deleted/.reverted (see apply.py's dataclasses) - return_url: where Cancel/Back goes {% endcomment %} {% block title %}{% trans "Apply design" %} {{ object }}{% endblock %} {% block content %}
{% blocktrans trimmed with title=object %} Applying {{ title }} materializes its placements in DCIM: a planned device is created (or updated) for every add/move, and the real device behind every remove is flagged for decommissioning. The design's own status is not changed here. {% endblocktrans %}
{% if result.problems %}| {% trans "Action" %} | {% trans "Count" %} | {% trans "Detail" %} |
|---|---|---|
| {% trans "Create" %} | {{ result.created|length }} |
{% for entry in result.created %}
{{ entry.name }}
{% if entry.rack %}
→ {{ entry.rack }} U{{ entry.position }} {{ entry.face }}
{% endif %}
{% if entry.recreated %}
{% trans "recreated" %}
{% endif %}
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Update" %} | {{ result.updated|length }} |
{% for entry in result.updated %}
{{ entry.device }}: {{ entry.changes.keys|join:", " }}
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Flag for removal" %} | {{ result.removed|length }} |
{% for entry in result.removed %}
{{ entry.device }}
({% trans "was" %} {{ entry.prior_status }})
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Delete" %} | {{ result.deleted|length }} |
{% for entry in result.deleted %}
{{ entry.device_name }}
{% empty %}
{% trans "none" %}
{% endfor %}
|
| {% trans "Revert" %} | {{ result.reverted|length }} |
{% for entry in result.reverted %}
{{ entry.device_name }} → {{ entry.prior_status }}
{% empty %}
{% trans "none" %}
{% endfor %}
|