logic in domain_sidebar which determines display of DS Data and Key Data

This commit is contained in:
David Kennedy 2023-10-05 16:11:56 -04:00
parent 7ace7fa27c
commit 7bd6e7f593
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 6 additions and 1 deletions

View file

@ -34,7 +34,7 @@
>
DNSSEC
</a>
{% if domain.dnssec_enabled %}
{% if domain.dnssecdata is not None or request.path|startswith:url and request.path|endswith:'data' %}
<ul class="usa-sidenav__sublist">
<li class="usa-sidenav__item">
{% url 'domain-dns-dnssec-dsdata' pk=domain.id as url %}

View file

@ -18,6 +18,11 @@ def startswith(text, starts):
return text.startswith(starts)
return False
@register.filter("endswith")
def endswith(text, ends):
if isinstance(text, str):
return text.endswith(ends)
return False
@register.simple_tag
def public_site_url(url_path):