networks: Don't show DNS-over-TLS when resolved is not installed

Tests:

- Ensure that systemd-resolved is not installed. The privacy section is entirely
hidden in the connection information page.

- Ensure that systemd-resolved is installed. The privacy section is shown in the
connection information page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2024-10-07 01:33:15 +03:00
1 parent 1f17728321
commit 64e244e24a
2 files changed
+11 -8

No files matched your search

@@ -256,14 +256,16 @@
<p>{% trans "This connection is not active." %}</p>
{% endif %}
<h3>{% trans "Privacy" %}</h3>
{% if is_resolved_installed %}
<h3>{% trans "Privacy" %}</h3>
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "DNS-over-TLS" %}</span>
<span class="secondary">{{ connection.dns_over_tls_string }}</span>
<div class="list-group list-group-two-column">
<div class="list-group-item">
<span class="primary">{% trans "DNS-over-TLS" %}</span>
<span class="secondary">{{ connection.dns_over_tls_string }}</span>
</div>
</div>
</div>
{% endif %}
<h3>{% trans "Security" %}</h3>
+3 -2
View File
@@ -13,7 +13,7 @@ from django.views.decorators.http import require_POST
from django.views.generic.edit import FormView
from plinth import network
from plinth.modules import first_boot, networks
from plinth.modules import first_boot, names, networks
from plinth.views import AppView
from .forms import (ConnectionTypeSelectForm, EthernetForm, GenericForm,
@@ -212,7 +212,8 @@ def show(request, uuid):
'connection': connection_status,
'active_connection': active_connection_status,
'device': device_status,
'access_point': access_point_status
'access_point': access_point_status,
'is_resolved_installed': names.is_resolved_installed()
})