From b494f8a9934ec9705778eb9374315cdca6a61366 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 14 May 2025 13:17:04 -0700 Subject: [PATCH] names: Add information about adding static domains/subdomains Tests: - Visit the add static domain page. Notice that additional form description is visible. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- .../names/templates/names-domain-add.html | 25 +++++++++++++++++++ plinth/modules/names/views.py | 2 +- plinth/templates/form.html | 3 +++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 plinth/modules/names/templates/names-domain-add.html diff --git a/plinth/modules/names/templates/names-domain-add.html b/plinth/modules/names/templates/names-domain-add.html new file mode 100644 index 000000000..b05d204d9 --- /dev/null +++ b/plinth/modules/names/templates/names-domain-add.html @@ -0,0 +1,25 @@ +{% extends "form.html" %} +{% comment %} +# SPDX-License-Identifier: AGPL-3.0-or-later +{% endcomment %} + +{% load bootstrap %} +{% load i18n %} + +{% block form_description %} +

+ {% blocktrans trimmed %} + If you purchased a domain name from a domain registrar, you can configure + it here. The name servers responsible for the domain must be pointing (A + and AAAA records) to the public IP addresses of the {{ box_name }}. + {% endblocktrans %} +

+

+ {% blocktrans trimmed %} + If you wish to also use a subdomian of an already configured domain, add + another entry for it here. Ensure that the subdomain is configured to + point to {{ box_name }}. Subdomains are useful for hosting multiple + applications that each require a dedicted domain for themselves. + {% endblocktrans %} +

+{% endblock %} diff --git a/plinth/modules/names/views.py b/plinth/modules/names/views.py index 51e0b9745..5fd84be6e 100644 --- a/plinth/modules/names/views.py +++ b/plinth/modules/names/views.py @@ -106,7 +106,7 @@ class HostnameView(FormView): class DomainAddView(FormView): """View to update system's static domain name.""" - template_name = 'form.html' + template_name = 'names-domain-add.html' form_class = DomainAddForm prefix = 'domain-add' success_url = reverse_lazy('names:index') diff --git a/plinth/templates/form.html b/plinth/templates/form.html index 18a35ba59..f95279cfa 100644 --- a/plinth/templates/form.html +++ b/plinth/templates/form.html @@ -10,6 +10,9 @@

{{ title }}

+ {% block form_description %} + {% endblock %} +
{% csrf_token %}