power: Refactor display of package manager busy alerts

Tests:

- Trigger the message using code change and observe the messages displayed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2024-12-12 12:47:59 +02:00
1 parent 62dad9336b
commit f6f5b7a478
4 files changed
+23 -42

No files matched your search

+1 -14
View File
@@ -8,20 +8,7 @@
{% block configuration %}
{% if pkg_manager_is_busy %}
<div class="alert alert-danger d-flex align-items-center">
<div class="me-2">
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Caution:" %}</span>
</div>
<div>
{% blocktrans trimmed %}
Currently an installation or upgrade is running.
Consider waiting until it's finished before shutting down or restarting.
{% endblocktrans %}
</div>
</div>
{% endif %}
{% include "power_busy_warning.html" %}
<div class="btn-toolbar">
<a class="btn btn-default btn-md" href="{% url 'power:restart' %}">
@@ -0,0 +1,20 @@
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% if pkg_manager_is_busy %}
<div class="alert alert-danger d-flex align-items-center">
<div class="me-2">
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Caution:" %}</span>
</div>
<div>
{% blocktrans trimmed %}
Currently an installation or upgrade is running. Consider waiting
until it's finished before shutting down or restarting.
{% endblocktrans %}
</div>
</div>
{% endif %}
@@ -29,20 +29,7 @@
</p>
{% endif %}
{% if pkg_manager_is_busy %}
<div class="alert alert-danger d-flex align-items-center">
<div class="me-2">
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Caution:" %}</span>
</div>
<div>
{% blocktrans trimmed %}
Currently an installation or upgrade is running.
Consider waiting until it's finished before shutting down or restarting.
{% endblocktrans %}
</div>
</div>
{% endif %}
{% include "power_busy_warning.html" %}
<form class="form" method="post">
{% csrf_token %}
@@ -28,20 +28,7 @@
</p>
{% endif %}
{% if pkg_manager_is_busy %}
<div class="alert alert-danger d-flex align-items-center">
<div class="me-2">
<span class="fa fa-exclamation-triangle" aria-hidden="true"></span>
<span class="visually-hidden">{% trans "Caution:" %}</span>
</div>
<div>
{% blocktrans trimmed %}
Currently an installation or upgrade is running.
Consider waiting until it's finished before shutting down or restarting.
{% endblocktrans %}
</div>
</div>
{% endif %}
{% include "power_busy_warning.html" %}
<form class="form" method="post">
{% csrf_token %}