added no results found and no live search on /template page

This commit is contained in:
Beverly Nguyen
2025-06-09 17:58:43 -07:00
parent fa158cd762
commit 312cdf08fa
3 changed files with 7 additions and 2 deletions

View File

@@ -293,10 +293,12 @@
if (this.currentState === 'add-new-template') {
this.$form.find('.template-list-item').addClass('js-hidden');
$('.live-search').addClass('js-hidden');
this.$form.find('input[type=checkbox]').prop('checked', false);
this.selectionStatus.update({ total: 0, templates: 0, folders: 0 });
} else {
this.$form.find('.template-list-item').removeClass('js-hidden');
$('.live-search').removeClass('js-hidden');
}
if (currentStateObj && 'setFocus' in currentStateObj) {

View File

@@ -40,7 +40,7 @@
<nav id="template-list" aria-label="Choose reply">
<ul>
{% for item in templates_and_folders %}
<li class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
<li class="template-list-item {% if item.ancestors %}template-list-item-hidden-by-default{% else %}template-list-item-without-ancestors{% endif %}">
{% for ancestor in item.ancestors %}
<a href="{{ url_for('.conversation_reply', service_id=current_service.id, notification_id=notification_id, from_folder=ancestor.id) }}" class="usa-link template-list-folder">
{{ ancestor.name }}

View File

@@ -25,11 +25,14 @@
form=search_form,
autofocus=True
) }}
<div class="js-live-search-no-results" style="display: none;">
<p class="usa-body margin-top-2">No templates found</p>
</div>
<nav id="template-list" aria-label="Copy template list">
<ul>
{% for item in services_templates_and_folders %}
<li class="template-list-item margin-bottom-2 {% if item.ancestors %}template-list-item-hidden-by-default{% endif %} {% if not item.ancestors %}template-list-item-without-ancestors{% endif %}">
<li class="template-list-item margin-bottom-2">
{% if item.is_service %}
{% elif item.is_folder %}
{% else %}