From ccf217f2f7d8c7fec98e6829cb1f3e616d86b71f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 4 Jun 2016 08:47:47 +0530 Subject: [PATCH] pagekite: Fix regression not showing description After the recent cleanup, pagekite no longer shows description before installation. Only after installation does it show the insturctions about why it is needed. Also in the description {box_name} is not substituted and there are incorrect escape sequences. Revert this earlier change that causes these regressions. --- plinth/modules/pagekite/__init__.py | 36 +++++++++++++- .../templates/pagekite_introduction.html | 48 ++----------------- plinth/modules/pagekite/views.py | 1 + 3 files changed, 39 insertions(+), 46 deletions(-) diff --git a/plinth/modules/pagekite/__init__.py b/plinth/modules/pagekite/__init__.py index c4310e3fe..5c2b51b8c 100644 --- a/plinth/modules/pagekite/__init__.py +++ b/plinth/modules/pagekite/__init__.py @@ -20,9 +20,10 @@ Plinth module to configure PageKite """ from django.utils.translation import ugettext_lazy as _ -from plinth import cfg from . import utils +from plinth import cfg +from plinth.utils import format_lazy version = 1 @@ -30,6 +31,39 @@ depends = ['system', 'names'] title = _('Public Visibility (PageKite)') +description = [ + format_lazy( + _('PageKite is a system for exposing {box_name} services when ' + 'you don\'t have a direct connection to the Internet. You only ' + 'need this if your {box_name} services are unreachable from ' + 'the rest of the Internet. This includes the following ' + 'situations:'), box_name=_(cfg.box_name)), + + format_lazy( + _('{box_name} is behind a restricted firewall.'), + box_name=_(cfg.box_name)), + + format_lazy( + _('{box_name} is connected to a (wireless) router which you ' + 'don\'t control.'), box_name=_(cfg.box_name)), + + _('Your ISP does not provide you an external IP address and ' + 'instead provides Internet connection through NAT.'), + + _('Your ISP does not provide you a static IP address and your IP ' + 'address changes evertime you connect to Internet.'), + + _('Your ISP limits incoming connections.'), + + format_lazy( + _('PageKite works around NAT, firewalls and IP-address limitations ' + 'by using a combination of tunnels and reverse proxies. You can ' + 'use any pagekite service provider, for example ' + 'pagekite.net. In future it ' + 'might be possible to use your buddy\'s {box_name} for this.'), + box_name=_(cfg.box_name)) +] + def init(): """Intialize the PageKite module""" diff --git a/plinth/modules/pagekite/templates/pagekite_introduction.html b/plinth/modules/pagekite/templates/pagekite_introduction.html index 2f21aadf1..43140a6b9 100644 --- a/plinth/modules/pagekite/templates/pagekite_introduction.html +++ b/plinth/modules/pagekite/templates/pagekite_introduction.html @@ -23,51 +23,9 @@ {% block content %}

{{ title }}

-

- {% blocktrans trimmed %} - PageKite is a system for exposing {box_name} services when - you don\'t have a direct connection to the Internet. You only - need this if your {{ box_name }} services are unreachable from - the rest of the Internet. This includes the following - situations: - {% endblocktrans %} -

- - -

- {% blocktrans trimmed %} - PageKite works around NAT, firewalls and IP-address limitations - by using a combination of tunnels and reverse proxies. You can - use any pagekite service provider, for example - pagekite.net. In future it - might be possible to use your buddy's {{ box_name }} for this. - {% endblocktrans %} -

+ {% for paragraph in description %} +

{{ paragraph|safe }}

+ {% endfor %}

diff --git a/plinth/modules/pagekite/views.py b/plinth/modules/pagekite/views.py index 4c170bf55..583f072dc 100644 --- a/plinth/modules/pagekite/views.py +++ b/plinth/modules/pagekite/views.py @@ -42,6 +42,7 @@ def index(request): """Serve introduction page""" return TemplateResponse(request, 'pagekite_introduction.html', {'title': pagekite.title, + 'description': pagekite.description, 'subsubmenu': subsubmenu})