diff --git a/plinth/templates/setup.html b/plinth/templates/setup.html
index 08c9ff131..d7a96b060 100644
--- a/plinth/templates/setup.html
+++ b/plinth/templates/setup.html
@@ -23,7 +23,7 @@
{% load static %}
{% block page_head %}
- {% if setup_helper.current_operation %}
+ {% if setup_current_operation or setup_state == 'up-to-date' %}
@@ -48,14 +48,18 @@
{% include "clients.html" with clients=setup_helper.module.clients %}
- {% if not setup_helper.current_operation %}
+ {% if setup_state == 'up-to-date' %}
+
+ {% trans "Application installated." %}
+
+ {% elif not setup_current_operation %}
- {% if setup_helper.get_state == 'needs-setup' %}
+ {% if setup_state == 'needs-setup' %}
{% blocktrans trimmed %}
Install this application?
{% endblocktrans %}
- {% elif setup_helper.get_state == 'needs-update' %}
+ {% elif setup_state == 'needs-update' %}
{% blocktrans trimmed %}
This application needs an update. Update now?
{% endblocktrans %}
@@ -87,27 +91,26 @@
{% if package_manager_is_busy or setup_helper.has_unavailable_packages %}
disabled="disabled"
{% endif %}
- {% if setup_helper.get_state == 'needs-setup' %}
+ {% if setup_state == 'needs-setup' %}
value="{% trans "Install" %}"
- {% elif setup_helper.get_state == 'needs-upgrade' %}
+ {% elif setup_state == 'needs-upgrade' %}
value="{% trans "Update" %}"
{% endif %} />
-
{% else %}
- {% if setup_helper.current_operation.step == 'pre' %}
+ {% if setup_current_operation.step == 'pre' %}
{% trans "Performing pre-install operation" %}
- {% elif setup_helper.current_operation.step == 'post' %}
+ {% elif setup_current_operation.step == 'post' %}
{% trans "Performing post-install operation" %}
- {% elif setup_helper.current_operation.step == 'install' %}
- {% with transaction=setup_helper.current_operation.transaction %}
+ {% elif setup_current_operation.step == 'install' %}
+ {% with transaction=setup_current_operation.transaction %}
{% blocktrans trimmed with package_names=transaction.package_names|join:", " status=transaction.status_string %}
Installing {{ package_names }}: {{ status }}
@@ -135,7 +138,7 @@
{% block page_js %}
- {% if setup_helper.current_operation %}
+ {% if setup_current_operation or setup_state == 'up-to-date' %}
{% endif %}
diff --git a/plinth/views.py b/plinth/views.py
index 42dbe80ec..b31d5cd36 100644
--- a/plinth/views.py
+++ b/plinth/views.py
@@ -177,7 +177,13 @@ class SetupView(TemplateView):
def get_context_data(self, **kwargs):
"""Return the context data rendering the template."""
context = super(SetupView, self).get_context_data(**kwargs)
- context['setup_helper'] = self.kwargs['setup_helper']
+ setup_helper = self.kwargs['setup_helper']
+ context['setup_helper'] = setup_helper
+
+ # Reuse the value of setup_state throughout the view for consistency.
+ context['setup_state'] = setup_helper.get_state()
+ context['setup_current_operation'] = setup_helper.current_operation
+
context['package_manager_is_busy'] = package.is_package_manager_busy()
return context