diff --git a/plinth/modules/config/views.py b/plinth/modules/config/views.py index 69b4f0463..7318d0f4a 100644 --- a/plinth/modules/config/views.py +++ b/plinth/modules/config/views.py @@ -36,6 +36,7 @@ LOGGER = logging.getLogger(__name__) class ConfigAppView(views.AppView): """Serve configuration page.""" name = config.name + description = config.description form_class = ConfigurationForm app_id = 'config' manual_page = config.manual_page diff --git a/plinth/modules/deluge/urls.py b/plinth/modules/deluge/urls.py index 67cbb9c26..57b86e539 100644 --- a/plinth/modules/deluge/urls.py +++ b/plinth/modules/deluge/urls.py @@ -29,5 +29,5 @@ urlpatterns = [ AppView.as_view(name=deluge.name, description=deluge.description, diagnostics_module_name='deluge', clients=deluge.clients, app_id='deluge', - manual_page=deluge.manual_page), name='index'), + manual_page=deluge.manual_page, icon_filename=deluge.icon_filename), name='index'), ] diff --git a/plinth/modules/diagnostics/diagnostics.py b/plinth/modules/diagnostics/diagnostics.py index 72cf2018f..6bf0e8ec0 100644 --- a/plinth/modules/diagnostics/diagnostics.py +++ b/plinth/modules/diagnostics/diagnostics.py @@ -44,7 +44,6 @@ def index(request): return TemplateResponse( request, 'diagnostics.html', { - 'title': diagnostics.name, 'name': diagnostics.name, 'description': diagnostics.description, 'is_running': _running_task is not None, diff --git a/plinth/modules/firewall/views.py b/plinth/modules/firewall/views.py index abc05ef4c..fa17fd99e 100644 --- a/plinth/modules/firewall/views.py +++ b/plinth/modules/firewall/views.py @@ -30,7 +30,6 @@ def index(request): if not firewall.get_enabled_status(): return TemplateResponse( request, 'firewall.html', { - 'title': firewall.name, 'name': firewall.name, 'description': firewall.description, 'firewall_status': 'not_running' @@ -41,7 +40,6 @@ def index(request): return TemplateResponse( request, 'firewall.html', { - 'title': firewall.name, 'name': firewall.name, 'description': firewall.description, 'components': components.Firewall.list(), diff --git a/plinth/modules/gitweb/views.py b/plinth/modules/gitweb/views.py index 6b26cf5a4..da53efe86 100644 --- a/plinth/modules/gitweb/views.py +++ b/plinth/modules/gitweb/views.py @@ -44,6 +44,7 @@ class GitwebAppView(views.AppView): app_id = 'gitweb' show_status_block = False template_name = 'gitweb_configure.html' + icon_filename = gitweb.icon_filename def get_context_data(self, *args, **kwargs): """Add repositories to the context data.""" diff --git a/plinth/modules/i2p/views.py b/plinth/modules/i2p/views.py index 74dec44d8..e36544db1 100644 --- a/plinth/modules/i2p/views.py +++ b/plinth/modules/i2p/views.py @@ -47,6 +47,7 @@ class I2PAppView(AppView): diagnostics_module_name = i2p.service_name show_status_block = True template_name = 'i2p.html' + icon_filename = i2p.icon_filename def get_context_data(self, **kwargs): """Return the context data for rendering the template view.""" diff --git a/plinth/modules/ikiwiki/views.py b/plinth/modules/ikiwiki/views.py index 4db5a0ae4..2f1f1524e 100644 --- a/plinth/modules/ikiwiki/views.py +++ b/plinth/modules/ikiwiki/views.py @@ -40,6 +40,7 @@ class IkiwikiAppView(views.AppView): template_name = 'ikiwiki_configure.html' manual_page = ikiwiki.manual_page clients = ikiwiki.clients + icon_filename = ikiwiki.icon_filename def get_context_data(self, **kwargs): """Return the context data for rendering the template view.""" diff --git a/plinth/modules/jsxc/templates/jsxc.html b/plinth/modules/jsxc/templates/jsxc.html index 093f03f1e..a3dcf0f41 100644 --- a/plinth/modules/jsxc/templates/jsxc.html +++ b/plinth/modules/jsxc/templates/jsxc.html @@ -20,13 +20,5 @@ {% load i18n %} -{% block description %} - - {% for paragraph in description %} -
{{ paragraph|safe }}
- {% endfor %} - -{% endblock %} - {% block configuration %} {% endblock %} diff --git a/plinth/modules/jsxc/views.py b/plinth/modules/jsxc/views.py index 5dc674424..97cb0600c 100644 --- a/plinth/modules/jsxc/views.py +++ b/plinth/modules/jsxc/views.py @@ -34,7 +34,7 @@ class JSXCAppView(AppView): description = jsxc.description show_status_block = False clients = jsxc.clients - + icon_filename = jsxc.icon_filename class JsxcView(TemplateView): """A simple page to embed Javascript XMPP Client library.""" diff --git a/plinth/modules/letsencrypt/views.py b/plinth/modules/letsencrypt/views.py index e235875ea..183c4ed50 100644 --- a/plinth/modules/letsencrypt/views.py +++ b/plinth/modules/letsencrypt/views.py @@ -38,7 +38,6 @@ def index(request): status = letsencrypt.get_status() return TemplateResponse( request, 'letsencrypt.html', { - 'title': letsencrypt.name, 'name': letsencrypt.name, 'description': letsencrypt.description, 'status': status, diff --git a/plinth/modules/matrixsynapse/templates/matrix-synapse-pre-setup.html b/plinth/modules/matrixsynapse/templates/matrix-synapse-pre-setup.html index d61546c88..098b45e8d 100644 --- a/plinth/modules/matrixsynapse/templates/matrix-synapse-pre-setup.html +++ b/plinth/modules/matrixsynapse/templates/matrix-synapse-pre-setup.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of FreedomBox. @@ -21,13 +21,12 @@ {% load bootstrap %} {% load i18n %} -{% block content %} -{{ paragraph|safe }}
- {% endfor %} +{% block configuration %}diff --git a/plinth/modules/matrixsynapse/views.py b/plinth/modules/matrixsynapse/views.py index 3d4822a4b..f7cbcec09 100644 --- a/plinth/modules/matrixsynapse/views.py +++ b/plinth/modules/matrixsynapse/views.py @@ -38,6 +38,8 @@ class SetupView(FormView): template_name = 'matrix-synapse-pre-setup.html' form_class = DomainSelectionForm success_url = reverse_lazy('matrixsynapse:index') + icon_filename = matrixsynapse.icon_filename + title = matrixsynapse.name def form_valid(self, form): """Handle valid form submission.""" @@ -48,8 +50,9 @@ class SetupView(FormView): """Provide context data to the template.""" context = super().get_context_data(**kwargs) - context['title'] = matrixsynapse.name + context['name'] = matrixsynapse.name context['description'] = matrixsynapse.description + context['icon_filename'] = matrixsynapse.icon_filename context['domain_names'] = names.components.DomainName.list_names( 'matrix-synapse-plinth') @@ -65,6 +68,7 @@ class MatrixSynapseAppView(AppView): diagnostics_module_name = 'matrixsynapse' form_class = MatrixSynapseForm port_forwarding_info = matrixsynapse.port_forwarding_info + icon_filename = matrixsynapse.icon_filename def dispatch(self, request, *args, **kwargs): """Redirect to setup page if setup is not done yet.""" diff --git a/plinth/modules/mediawiki/views.py b/plinth/modules/mediawiki/views.py index 07f7615e0..dddd6eb51 100644 --- a/plinth/modules/mediawiki/views.py +++ b/plinth/modules/mediawiki/views.py @@ -43,6 +43,7 @@ class MediaWikiAppView(views.AppView): manual_page = mediawiki.manual_page show_status_block = False template_name = 'mediawiki.html' + icon_filename = mediawiki.icon_filename def get_initial(self): """Return the values to fill in the form.""" diff --git a/plinth/modules/minetest/views.py b/plinth/modules/minetest/views.py index 12ba4f61f..efc0cd85d 100644 --- a/plinth/modules/minetest/views.py +++ b/plinth/modules/minetest/views.py @@ -41,6 +41,7 @@ class MinetestAppView(AppView): # pylint: disable=too-many-ancestors clients = minetest.clients manual_page = minetest.manual_page port_forwarding_info = minetest.port_forwarding_info + icon_filename = minetest.icon_filename def get_initial(self): """Return the values to fill in the form.""" diff --git a/plinth/modules/mldonkey/urls.py b/plinth/modules/mldonkey/urls.py index 8c9c9a28c..9b15c7bb8 100644 --- a/plinth/modules/mldonkey/urls.py +++ b/plinth/modules/mldonkey/urls.py @@ -31,5 +31,7 @@ urlpatterns = [ description=mldonkey.description, clients=mldonkey.clients, manual_page=mldonkey.manual_page, - show_status_block=True), name='index'), + show_status_block=True, + icon_filename=mldonkey.icon_filename), + name='index'), ] diff --git a/plinth/modules/names/views.py b/plinth/modules/names/views.py index 64bcd211c..2781436ed 100644 --- a/plinth/modules/names/views.py +++ b/plinth/modules/names/views.py @@ -31,7 +31,6 @@ def index(request): return TemplateResponse( request, 'names.html', { - 'title': names.name, 'name': names.name, 'description': names.description, 'manual_page': names.manual_page, diff --git a/plinth/modules/openvpn/views.py b/plinth/modules/openvpn/views.py index 42e0f25a4..7b5b989b4 100644 --- a/plinth/modules/openvpn/views.py +++ b/plinth/modules/openvpn/views.py @@ -58,9 +58,8 @@ def index(request): return TemplateResponse( request, 'openvpn.html', { - 'title': openvpn.name, - 'name': openvpn.name, 'clients': openvpn.clients, + 'name': openvpn.name, 'description': openvpn.description, 'manual_page': openvpn.manual_page, 'port_forwarding_info': openvpn.port_forwarding_info, @@ -70,6 +69,7 @@ def index(request): 'is_running': status['is_running'], 'diagnostics_module_name': 'openvpn', 'is_enabled': status['enabled'], + 'icon_filename': openvpn.icon_filename }) diff --git a/plinth/modules/quassel/views.py b/plinth/modules/quassel/views.py index 62e018079..211b7f9fd 100644 --- a/plinth/modules/quassel/views.py +++ b/plinth/modules/quassel/views.py @@ -30,6 +30,7 @@ class QuasselAppView(AppView): manual_page = quassel.manual_page port_forwarding_info = quassel.port_forwarding_info form_class = QuasselForm + icon_filename = quassel.icon_filename def get_initial(self): """Return the values to fill in the form.""" diff --git a/plinth/modules/radicale/views.py b/plinth/modules/radicale/views.py index 70f174c84..6e3c25e60 100644 --- a/plinth/modules/radicale/views.py +++ b/plinth/modules/radicale/views.py @@ -38,6 +38,7 @@ class RadicaleAppView(AppView): form_class = RadicaleForm app_id = 'radicale' manual_page = radicale.manual_page + icon_filename = radicale.icon_filename def get_initial(self): """Return the values to fill in the form.""" diff --git a/plinth/modules/roundcube/urls.py b/plinth/modules/roundcube/urls.py index f1ba3a856..030d858a4 100644 --- a/plinth/modules/roundcube/urls.py +++ b/plinth/modules/roundcube/urls.py @@ -30,5 +30,6 @@ urlpatterns = [ diagnostics_module_name='roundcube', description=roundcube.description, show_status_block=False, clients=roundcube.clients, - manual_page=roundcube.manual_page), name='index'), + manual_page=roundcube.manual_page, + icon_filename=roundcube.icon_filename), name='index'), ] diff --git a/plinth/modules/searx/views.py b/plinth/modules/searx/views.py index d4b5b48f3..f90f2b2fc 100644 --- a/plinth/modules/searx/views.py +++ b/plinth/modules/searx/views.py @@ -38,6 +38,7 @@ class SearxAppView(views.AppView): form_class = SearxForm show_status_block = False manual_page = searx.manual_page + icon_filename = searx.icon_filename def get_initial(self): """Return the status of the service to fill in the form.""" diff --git a/plinth/modules/shadowsocks/views.py b/plinth/modules/shadowsocks/views.py index d9e13928d..19c4633c7 100644 --- a/plinth/modules/shadowsocks/views.py +++ b/plinth/modules/shadowsocks/views.py @@ -38,6 +38,7 @@ class ShadowsocksAppView(views.AppView): name = shadowsocks.name description = shadowsocks.description manual_page = shadowsocks.manual_page + icon_filename = shadowsocks.icon_filename def get_initial(self, *args, **kwargs): """Get initial values for form.""" diff --git a/plinth/modules/sharing/__init__.py b/plinth/modules/sharing/__init__.py index 06e96ede5..f3a2b3abe 100644 --- a/plinth/modules/sharing/__init__.py +++ b/plinth/modules/sharing/__init__.py @@ -42,6 +42,7 @@ description = [ app = None +icon_filename = 'sharing' class SharingApp(app_module.App): """FreedomBox app for sharing files.""" diff --git a/plinth/modules/sharing/templates/sharing.html b/plinth/modules/sharing/templates/sharing.html index e37ecb861..1e22a3372 100644 --- a/plinth/modules/sharing/templates/sharing.html +++ b/plinth/modules/sharing/templates/sharing.html @@ -33,11 +33,7 @@ {% block content %} -
{{ paragraph|safe }}
- {% endfor %} + {% include "header.html" with icon_filename=icon_filename name=title description='' %}
-
-
- {% block description %}
- {% for paragraph in description %}
- {{ paragraph|safe }}
-
- {% trans 'Learn more...' %}
-
- {{ paragraph|safe }} {{ paragraph|safe }}
+
+ {% endif %}
+
+
{% trans "Installation" %}: {{ short_description|default:'' }} ({{ name }})
+ {% else %}
+ {{ name }}
+ {% endif %}
+ {% endblock %}
+
+ {% block description %}
+ {% for paragraph in description %}
+
-
- {% endif %}
-
-
{% trans "Installation" %}: {{ setup_helper.module.short_description|default:'' }} ({{ setup_helper.module.name }})
-
- {% for paragraph in setup_helper.module.description %}
-