From d6c0b983753a08aff9d34870713ead450b29f84b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 1 Oct 2019 21:36:17 -0700 Subject: [PATCH] i2p: Use app.html instead of app-subsubmenu.html - Gain ability to show internal zone warning for I2P proxies. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/i2p/__init__.py | 4 +-- plinth/modules/i2p/templates/i2p.html | 30 +------------------ plinth/modules/i2p/templates/i2p_service.html | 2 +- plinth/modules/i2p/views.py | 1 + 4 files changed, 5 insertions(+), 32 deletions(-) diff --git a/plinth/modules/i2p/__init__.py b/plinth/modules/i2p/__init__.py index 02806b2b6..b7041f676 100644 --- a/plinth/modules/i2p/__init__.py +++ b/plinth/modules/i2p/__init__.py @@ -29,7 +29,7 @@ from plinth.modules.firewall.components import Firewall from plinth.modules.i2p.resources import FAVORITES from plinth.modules.users import register_group -from .manifest import backup, clients # noqa, pylint: disable=unused-import +from .manifest import backup, clients # noqa, pylint: disable=unused-import version = 1 @@ -97,7 +97,7 @@ class I2PApp(app_module.App): is_external=True) self.add(firewall) - firewall = Firewall('firewall-i2p-proxies', name, + firewall = Firewall('firewall-i2p-proxies', _('I2P Proxy'), ports=tunnels_to_manage.values(), is_external=False) self.add(firewall) diff --git a/plinth/modules/i2p/templates/i2p.html b/plinth/modules/i2p/templates/i2p.html index 4eda093dc..415338dcc 100644 --- a/plinth/modules/i2p/templates/i2p.html +++ b/plinth/modules/i2p/templates/i2p.html @@ -1,4 +1,4 @@ -{% extends "app-subsubmenu.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of FreedomBox. @@ -22,34 +22,6 @@ {% load i18n %} {% block configuration %} - {% block status %} - {% if show_status_block %} -

{% trans "Status" %}

-

- {% with service_name=name %} - {% if is_running %} - - {% blocktrans trimmed %} - Service {{ service_name }} is running. - {% endblocktrans %} - {% else %} - - {% blocktrans trimmed %} - Service {{ service_name }} is not running. - {% endblocktrans %} - {% endif %} - {% endwith %} -

- {% endif %} - {% endblock %} - - {% block diagnostics %} - {% if diagnostics_module_name %} - {% include "diagnostics_button.html" with module=diagnostics_module_name enabled=is_enabled %} - {% endif %} - {% endblock %} - - {% include "port-forwarding-info.html" with service_name=title %}

{% trans "Configuration" %}

diff --git a/plinth/modules/i2p/templates/i2p_service.html b/plinth/modules/i2p/templates/i2p_service.html index 7ddb303c7..49172df8c 100644 --- a/plinth/modules/i2p/templates/i2p_service.html +++ b/plinth/modules/i2p/templates/i2p_service.html @@ -1,4 +1,4 @@ -{% extends "app-subsubmenu.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of FreedomBox. diff --git a/plinth/modules/i2p/views.py b/plinth/modules/i2p/views.py index 0ad916e1e..62892ed93 100644 --- a/plinth/modules/i2p/views.py +++ b/plinth/modules/i2p/views.py @@ -71,6 +71,7 @@ class ServiceBaseView(TemplateView): """Add context data for template.""" context = super().get_context_data(**kwargs) context['title'] = i2p.name + context['name'] = i2p.name context['description'] = i2p.description context['clients'] = i2p.clients context['manual_page'] = i2p.manual_page