dynamicdns: Simplify template inheritance

- Fix issue with form messages not showing up.

- Remove unnecessary duplication of code from base template.

- Minor docstring styling.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2019-03-08 14:19:40 -08:00
parent b3bbfcda3d
commit f81cd5c799
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
4 changed files with 23 additions and 46 deletions

View File

@ -75,7 +75,7 @@ def setup(helper, old_version=None):
def get_enabled_services(domain_name):
""" Get enabled services for the domain name"""
"""Get enabled services for the domain name."""
if domain_name != None and domain_name != '':
try:
domainname_services = firewall.get_enabled_services(

View File

@ -21,48 +21,25 @@
{% load i18n %}
{% load plinth_extras %}
{% block content %}
{% block pagetitle %}
<h2>{{ title }}</h2>
{% endblock %}
{% block configuration %}
{% for paragraph in description %}
<p>{{ paragraph|safe }}</p>
{% endfor %}
<p>
{% blocktrans trimmed %}
If you are looking for a free dynamic DNS account, you may find
a free GnuDIP service at <a href='http://gnudip.datasystems24.net'
target='_blank'>gnudip.datasystems24.net</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>
{% if manual_page %}
<p class="manual-page">
<a href="{% url 'help:manual-page' manual_page %}">
{% trans 'Learn more...' %}
</a>
</p>
{% endif %}
{% block subsubmenu %}
{% if subsubmenu %}
{% show_subsubmenu subsubmenu %}
{% endif %}
{% endblock %}
{% block subpage %}
<p>
{% blocktrans trimmed %}
If you are looking for a free dynamic DNS account, you may find
a free GnuDIP service at <a href='http://gnudip.datasystems24.net'
target='_blank'>gnudip.datasystems24.net</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>
<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>
{% endblock %}
<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>
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "dynamicdns.html" %}
{% extends "service-subsubmenu.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@ -22,7 +22,7 @@
{% load i18n %}
{% load static %}
{% block subpage %}
{% block configuration %}
<form class="form" method="post">
{% csrf_token %}

View File

@ -1,4 +1,4 @@
{% extends "dynamicdns.html" %}
{% extends "service-subsubmenu.html" %}
{% comment %}
#
# This file is part of FreedomBox.
@ -20,7 +20,7 @@
{% load i18n %}
{% block subpage %}
{% block configuration %}
<h3>{% trans "NAT type" %}</h3>
<p>