diff --git a/plinth/modules/tor/templates/tor.html b/plinth/modules/tor/templates/tor.html
index bd8f16171..100a35b99 100644
--- a/plinth/modules/tor/templates/tor.html
+++ b/plinth/modules/tor/templates/tor.html
@@ -1,4 +1,4 @@
-{% extends "simple_app.html" %}
+{% extends "app.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@@ -32,33 +32,16 @@
{% endblock %}
-
-{% block configuration %}
-
- {% include "clients.html" with clients=clients %}
-
-
{% trans "Status" %}
-
+{% block status %}
{% if config_running %}
+ {% trans "Status" %}
{% trans "Tor configuration is being updated" %}
-
{% else %}
-
-
- {% if status.is_running %}
-
- {% trans "Tor is running" %}
- {% else %}
-
- {% trans "Tor is not running" %}
- {% endif %}
-
-
- {% include "diagnostics_button.html" with module="tor" enabled=status.enabled %}
+ {{ block.super }}
{% if status.hs_enabled %}
{% endif %}
+ {% endif %}
+{% endblock %}
- {% include "internal-zone.html" %}
+{% block internal_zone %}
+ {% if not config_running %}
+ {{ block.super }}
+ {% endif %}
+{% endblock %}
- {% trans "Configuration" %}
+{% block configuration %}
-
+ {{ block.super }}
{% if status.relay_enabled %}
{% trans "Relay" %}
diff --git a/plinth/modules/tor/views.py b/plinth/modules/tor/views.py
index be1ecc4e4..a16668361 100644
--- a/plinth/modules/tor/views.py
+++ b/plinth/modules/tor/views.py
@@ -53,13 +53,18 @@ def index(request):
return TemplateResponse(
request, 'tor.html', {
'title': tor.name,
+ 'name': tor.name,
'description': tor.description,
'clients': tor.clients,
'manual_page': tor.manual_page,
'status': status,
'config_running': bool(config_process),
'form': form,
- 'firewall': tor.app.get_components_of_type(Firewall)
+ 'firewall': tor.app.get_components_of_type(Firewall),
+ 'diagnostics_module_name': 'tor',
+ 'is_enabled': status['enabled'],
+ 'show_status_block': True,
+ 'is_running': status['is_running'],
})
@@ -70,8 +75,9 @@ def _apply_changes(request, old_status, new_status):
except ActionError as exception:
messages.error(
request,
- _('Action error: {0} [{1}] [{2}]').format(
- exception.args[0], exception.args[1], exception.args[2]))
+ _('Action error: {0} [{1}] [{2}]').format(exception.args[0],
+ exception.args[1],
+ exception.args[2]))
def __apply_changes(request, old_status, new_status):
@@ -131,8 +137,9 @@ def __apply_changes(request, old_status, new_status):
else:
tor.app.disable()
- config_process = actions.superuser_run(
- 'tor', ['configure'] + arguments, run_in_background=True)
+ config_process = actions.superuser_run('tor',
+ ['configure'] + arguments,
+ run_in_background=True)
return
if arguments: