dynamicdns: Drop about page and merge into description

Rename dynamicdns_configuration.html to dynamicdns.html.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-01-31 16:17:03 -08:00 committed by James Valleroy
parent 84a7323b42
commit 4705f1883f
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
5 changed files with 26 additions and 65 deletions

View File

@ -29,7 +29,12 @@ _description = [
'<a href=\'http://gnudip2.sourceforge.net/\' target=\'_blank\'> '
'GnuDIP</a> server. Afterwards, the server will assign your DNS name '
'to the new IP, and if someone from the Internet asks for your DNS '
'name, they will get a response with your current IP address.')
'name, they will get a response with your current IP address.'),
_('If you are looking for a free dynamic DNS account, you may find a free '
'GnuDIP service at <a href=\'https://ddns.freedombox.org\' '
'target=\'_blank\'>ddns.freedombox.org</a> or you may find free update '
'URL based services at <a href=\'http://freedns.afraid.org/\' '
'target=\'_blank\'>freedns.afraid.org</a>.'),
]
app = None

View File

@ -3,28 +3,29 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load plinth_extras %}
{% load static %}
{% block configuration %}
<form class="form" method="post">
{% csrf_token %}
<p>
{% blocktrans trimmed %}
If you are looking for a free dynamic DNS account, you may find
a free GnuDIP service at <a href='https://ddns.freedombox.org'
target='_blank'>ddns.freedombox.org</a> or you may find
free update URL based services at
<a href='http://freedns.afraid.org/' target='_blank'>
freedns.afraid.org</a>.
{% endblocktrans %}
</p>
<noscript>
{% blocktrans trimmed %}
You have disabled Javascript. Dynamic form mode is disabled
and some helper functions may not work (but the main
functionality should work).
{% endblocktrans %}
</noscript>
<p>
{% blocktrans trimmed %}
If your {{ box_name }} is connected behind a NAT router, don't forget
to add port forwarding for standard ports, including TCP port 80 (HTTP)
and TCP port 443 (HTTPS).
{% endblocktrans %}
</p>
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Update setup" %}"/>
</form>
{% endblock %}
{% block page_js %}
<script type="text/javascript" src="{% static 'dynamicdns/dynamicdns.js' %}"></script>
{% endblock %}

View File

@ -1,31 +0,0 @@
{% extends "app.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block configuration %}
<form class="form" method="post">
{% csrf_token %}
<noscript>
{% blocktrans trimmed %}
You have disabled Javascript. Dynamic form mode is disabled
and some helper functions may not work (but the main
functionality should work).
{% endblocktrans %}
</noscript>
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Update setup" %}"/>
</form>
{% endblock %}
{% block page_js %}
<script type="text/javascript" src="{% static 'dynamicdns/dynamicdns.js' %}"></script>
{% endblock %}

View File

@ -9,7 +9,6 @@ from . import views
urlpatterns = [
re_path(r'^sys/dynamicdns/$', views.index, name='index'),
re_path(r'^sys/dynamicdns/configure/$', views.configure, name='configure'),
re_path(r'^sys/dynamicdns/statuspage/$', views.statuspage,
name='statuspage'),
]

View File

@ -23,9 +23,6 @@ EMPTYSTRING = 'none'
subsubmenu = [{
'url': reverse_lazy('dynamicdns:index'),
'text': gettext_lazy('About')
}, {
'url': reverse_lazy('dynamicdns:configure'),
'text': gettext_lazy('Configure')
}, {
'url': reverse_lazy('dynamicdns:statuspage'),
@ -34,16 +31,6 @@ subsubmenu = [{
def index(request):
"""Serve Dynamic DNS page."""
return TemplateResponse(
request, 'dynamicdns.html', {
'app_info': dynamicdns.app.info,
'title': dynamicdns.app.info.name,
'subsubmenu': subsubmenu
})
def configure(request):
"""Serve the configuration form."""
status = dynamicdns.get_status()
form = None
@ -58,7 +45,7 @@ def configure(request):
form = ConfigureForm(initial=status)
return TemplateResponse(
request, 'dynamicdns_configure.html', {
request, 'dynamicdns.html', {
'title': _('Configure Dynamic DNS'),
'app_info': dynamicdns.app.info,
'form': form,