use filter on address

This commit is contained in:
zandercymatics 2024-08-15 10:12:38 -06:00
parent 06b66f4400
commit cc1dd66553
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 14 additions and 8 deletions

View file

@ -898,20 +898,26 @@ function initializeWidgetOnList(list, parentId) {
const phoneSpan = contactList.querySelector("#contact_info_phone"); const phoneSpan = contactList.querySelector("#contact_info_phone");
if (titleSpan) { if (titleSpan) {
titleSpan.textContent = data.title || ""; titleSpan.textContent = data.title || "None";
}; };
// Update the email field and the content for the clipboard // Update the email field and the content for the clipboard
if (emailSpan) { if (emailSpan) {
emailSpan.textContent = data.email || ""; let copyButton = contactList.querySelector(".admin-icon-group");
const clipboardInput = contactList.querySelector(".admin-icon-group input"); emailSpan.textContent = data.email || "None";
if (clipboardInput) { if (data.email) {
clipboardInput.value = data.email || ""; const clipboardInput = contactList.querySelector(".admin-icon-group input");
}; if (clipboardInput) {
clipboardInput.value = data.email;
};
showElement(copyButton);
}else {
hideElement(copyButton);
}
} }
if (phoneSpan) { if (phoneSpan) {
phoneSpan.textContent = data.phone || ""; phoneSpan.textContent = data.phone || "None";
}; };
} }
})(); })();

View file

@ -1,7 +1,7 @@
{% load i18n static %} {% load i18n static %}
{% load custom_filters %} {% load custom_filters %}
<address class="{% if no_title_top_padding %}margin-top-neg-1__detail-list{% endif %} {% if user.has_contact_info %}margin-bottom-1{% endif %} dja-address-contact-list"> <address class="{% if no_title_top_padding %}margin-top-neg-1__detail-list{% endif %} {% if user|has_contact_info %}margin-bottom-1{% endif %} dja-address-contact-list">
{% if show_formatted_name %} {% if show_formatted_name %}