some tweaks to optimize code in templates

This commit is contained in:
Rachid Mrad 2023-09-26 11:50:40 -04:00
parent 903a3bf369
commit 29d003eb4a
No known key found for this signature in database
GPG key ID: EF38E4CEC4A8F3CF
2 changed files with 15 additions and 22 deletions

View file

@ -6,7 +6,7 @@
<div class="margin-top-4 tablet:grid-col-10">
<div
class="usa-summary-box dotgov-status-box margin-top-3 padding-left-2{% if domain.state == 'unknown' or domain.state == 'dns needed'%} dotgov-status-box--action-need{% endif %}"
class="usa-summary-box dotgov-status-box margin-top-3 padding-left-2{% if domain.state == domain.State.UNKNOWN or domain.state == domain.State.DNS_NEEDED%} dotgov-status-box--action-need{% endif %}"
role="region"
aria-labelledby="summary-box-key-information"
>
@ -17,7 +17,7 @@
<span class="text-bold text-primary-darker">
Status:
</span>
{% if domain.state == "unknown" or domain.state == 'dns needed'%}
{% if domain.state == domain.State.UNKNOWN or domain.state == domain.State.DNS_NEEDED%}
DNS Needed
{% else %}
{{ domain.state|title }}

View file

@ -47,28 +47,21 @@
</td>
<td>
<a href="{% url "domain" pk=domain.pk %}">
<svg
class="usa-icon"
aria-hidden="true"
focusable="false"
role="img"
width="24"
>
{% if domain.state == "deleted" or domain.state == "on hold" %}
<svg
class="usa-icon"
aria-hidden="true"
focusable="false"
role="img"
width="24"
>
<use xlink:href="{%static 'img/sprite.svg'%}#visibility"></use>
</svg>
View <span class="usa-sr-only">{{ domain.name }}</span>
<use xlink:href="{%static 'img/sprite.svg'%}#visibility"></use>
</svg>
View <span class="usa-sr-only">{{ domain.name }}</span>
{% else %}
<svg
class="usa-icon"
aria-hidden="true"
focusable="false"
role="img"
width="24"
>
<use xlink:href="{%static 'img/sprite.svg'%}#settings"></use>
</svg>
Manage <span class="usa-sr-only">{{ domain.name }}</span>
<use xlink:href="{%static 'img/sprite.svg'%}#settings"></use>
</svg>
Manage <span class="usa-sr-only">{{ domain.name }}</span>
{% endif %}
</a>
</td>