Refactor to use include - for the most part

This commit is contained in:
zandercymatics 2024-07-22 10:11:31 -06:00
parent 2c9916b214
commit 4e59f0d866
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -3,14 +3,10 @@
<div class="margin-bottom-4 tablet:margin-bottom-0"> <div class="margin-bottom-4 tablet:margin-bottom-0">
<nav aria-label="Domain sections"> <nav aria-label="Domain sections">
<ul class="usa-sidenav"> <ul class="usa-sidenav">
<li class="usa-sidenav__item">
{% url 'domain' pk=domain.id as url %} {% with url_name="domain" %}
<a href="{{ url }}" {% include "includes/domain_sidenav_item.html" with item_text="Domain overview" %}
{% if request.path == url %}class="usa-current"{% endif %} {% endwith %}
>
Domain overview
</a>
</li>
{% if domain.is_editable %} {% if domain.is_editable %}
<li class="usa-sidenav__item"> <li class="usa-sidenav__item">
@ -55,50 +51,35 @@
{% endif %} {% endif %}
</li> </li>
{% if is_org_user %} {% if portfolio %}
{% include "includes/domain_sidenav_item.html" with url_name="domain-suborganization" item_text="Suborganization"%} {% with url_name="domain-suborganization" %}
{% include "includes/domain_sidenav_item.html" with item_text="Suborganization" %}
{% endwith %}
{% else %} {% else %}
{% include "includes/domain_sidenav_item.html" with url_name="domain-org-name-address" item_text="Organization name and mailing address"%} {% with url_name="domain-org-name-address" %}
{% include "includes/domain_sidenav_item.html" with item_text="Organization name and mailing address" %}
{% endwith %}
{% endif %} {% endif %}
<li class="usa-sidenav__item"> {% with url_name="domain-senior-official" %}
{% url 'domain-senior-official' pk=domain.id as url %} {% include "includes/domain_sidenav_item.html" with item_text="Senior official" %}
<a href="{{ url }}" {% endwith %}
{% if request.path == url %}class="usa-current"{% endif %}
>
Senior official
</a>
</li>
{% if not has_profile_feature_flag %} {% if not has_profile_feature_flag %}
{# Conditionally display profile link in main nav #} {# Conditionally display profile link in main nav #}
<li class="usa-sidenav__item"> {% with url_name="domain-your-contact-information" %}
{% url 'domain-your-contact-information' pk=domain.id as url %} {% include "includes/domain_sidenav_item.html" with item_text="Your contact information" %}
<a href="{{ url }}" {% endwith %}
{% if request.path == url %}class="usa-current"{% endif %}
>
Your contact information
</a>
</li>
{% endif %} {% endif %}
<li class="usa-sidenav__item"> {% with url_name="domain-security-email" %}
{% url 'domain-security-email' pk=domain.id as url %} {% include "includes/domain_sidenav_item.html" with item_text="Security email" %}
<a href="{{ url }}" {% endwith %}
{% if request.path == url %}class="usa-current"{% endif %}
> {% with url_name="domain-users" %}
Security email {% include "includes/domain_sidenav_item.html" with item_text="Domain managers" %}
</a> {% endwith %}
</li>
<li class="usa-sidenav__item">
{% url 'domain-users' pk=domain.id as url %}
<a href="{{ url }}"
{% if request.path|startswith:url %}class="usa-current"{% endif %}
>
Domain managers
</a>
</li>
{% endif %} {% endif %}
</ul> </ul>
</nav> </nav>