Upate summary item for user lists and edit button option

This commit is contained in:
igorkorenfeld 2023-05-18 19:14:37 -04:00
parent a3606d6497
commit 1511b5deca
No known key found for this signature in database
GPG key ID: 826947A4B867F659

View file

@ -1,49 +1,77 @@
{% load static url_helpers %}
<section class="summary-item margin-top-3">
<hr class="" />
<p class="summary-item__title
text-primary-dark text-semibold
margin-top-0 margin-bottom-05"
>
{{ title }}
</p>
{% if address %}
{% include "includes/organization_address.html" with organization=value %}
{% elif contact %}
{% if list %}
{% if value|length == 1 %}
{% include "includes/contact.html" with contact=value|first %}
{% else %}
<ul class="usa-list usa-list--unstyled margin-top-0">
{% for item in value %}
<li>
<p class="text-semibold margin-top-1 margin-bottom-0">
Conatct {{forloop.counter}}
</p>
{% include "includes/contact.html" with contact=item %}</li>
{% empty %}
<li>None</li>
{% endfor %}</ul></p>
</ul>
{% endif %}
{% else %}
{% include "includes/contact.html" with contact=value %}
{% endif %}
{% elif list %}
{% if value|length == 1 %}
<p class="margin-top-0">{{ value | first }} </p>
{% else %}
<ul class="usa-list margin-top-0">
{% for item in value %}
<li>{{ item }}</li>
{% empty %}
<li>None</li>
{% endfor %}</ul></p>
</ul>
{% endif %}
{% else %}
<p class="margin-top-0">
{{ value }}
</p>
{% endif %}
<div class="display-flex flex-justify">
<div>
<p class="summary-item__title
text-primary-dark text-semibold
margin-top-0 margin-bottom-05"
>
{{ title }}
</p>
{% if address %}
{% include "includes/organization_address.html" with organization=value %}
{% elif contact %}
{% if list %}
{% if value|length == 1 %}
{% include "includes/contact.html" with contact=value|first %}
{% else %}
<ul class="usa-list usa-list--unstyled margin-top-0">
{% for item in value %}
<li>
<p class="text-semibold margin-top-1 margin-bottom-0">
Conatct {{forloop.counter}}
</p>
{% include "includes/contact.html" with contact=item %}</li>
{% empty %}
<li>None</li>
{% endfor %}</ul></p>
</ul>
{% endif %}
{% else %}
{% include "includes/contact.html" with contact=value %}
{% endif %}
{% elif list %}
{% if value|length == 1 %}
<p class="margin-top-0">{{ value | first }} </p>
{% else %}
<ul class="usa-list margin-top-0">
{% for item in value %}
<li>{{ item }}</li>
{% empty %}
<li>None</li>
{% endfor %}</ul></p>
</ul>
{% endif %}
{% elif users %}
{% if value|length == 1 %}
<p class="margin-top-0">{{ user.email }} <span class="padding-left-2px text-base"> ({{ value.first.role }}) </span></p>
{% else %}
<ul class="usa-list usa-list--unstyled margin-top-0">
{% for item in value %}
<li>{{ user.email }} <span class="padding-left-2px text-base"> ({{ item.role }}) </span></li>
{% endfor %}
{% endif %}
{% else %}
<p class="margin-top-0">
{{ value }}
</p>
{% endif %}
</div>
{% if edit_link %}
<a
aria-describedby="summary-item__title"
href="{{ edit_link }}"
>
Edit<span class="sr-only"> {{ title }}</span>
</a>
{% endif %}
</div>
</section>