Merge pull request #2076 from GSA/2056-template-creation-flow-voiceover-gets-stuck-in-a-loop

Template voiceover gets stuck in a loop #2056
This commit is contained in:
Jonathan Bobel
2024-11-08 10:13:32 -05:00
committed by GitHub
2 changed files with 26 additions and 18 deletions

View File

@@ -38,22 +38,28 @@
{% for item in template_list %}
{% set item_link_content %}
{% if item.is_folder %}
<a href="{{ url_for('.choose_template', service_id=current_service.id, template_type=template_type, template_folder_id=item.id) }}"
class="usa-link template-list-folder">
<span class="live-search-relevant">{{- format_item_name(item.name) -}}</span>
</a>
{% elif not item.ancestors %}
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}"
class="usa-link template-list-template">
<span class="live-search-relevant">
{%- if current_service.api_keys -%}
<span class="display-none">{{ item.id }} </span>
{%- endif -%}
{{- format_item_name(item.name) -}}
</span>
</a>
{% endif %}
{% if item.is_folder %}
<a href="{{ url_for('.choose_template', service_id=current_service.id, template_type=template_type, template_folder_id=item.id) }}"
class="usa-link template-list-folder"
tabindex="0"
role="link"
aria-label="{{ item.name }}">
<span class="live-search-relevant">{{- format_item_name(item.name) -}}</span>
</a>
{% elif not item.ancestors %}
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}"
class="usa-link template-list-template"
tabindex="0"
role="link"
aria-label="{{ item.name }}">
<span class="live-search-relevant">
{%- if current_service.api_keys -%}
<span class="display-none">{{ item.id }} </span>
{%- endif -%}
{{- format_item_name(item.name) -}}
</span>
</a>
{% endif %}
{% endset %}
{% set label_content %}
@@ -82,6 +88,8 @@
"id": "templates-or-folder-" ~ item.id,
"classes": "template-list-item template-list-item-with-checkbox {}".format(
"template-list-item-hidden-by-default" if item.ancestors else "template-list-item-without-ancestors"),
"attributes": { "role": "checkbox", "aria-describedby": item.id ~ "-item-hint" },
"after": item_link_content ~ item_meta
} %}
{% set _ = checkboxes_data.append(checkbox_config) %}

View File

@@ -33,7 +33,7 @@
{% else %}
<div class="grid-row">
<div class="grid-row flex-column">
<div class="{% if current_user.has_permissions('manage_templates') %} grid-col-10 {% else %} grid-col-12 {% endif %}">
<div class="usa-alert usa-alert--slim usa-alert--info">
<div class="usa-alert__body">
@@ -51,7 +51,7 @@
</div>
{% if current_user.has_permissions('manage_templates') and current_template_folder_id and user_has_template_folder_permission %}
<div class="grid-col-2">
<a href="{{ url_for('.manage_template_folder', service_id=current_service.id, template_folder_id=current_template_folder_id) }}" class="usa-link folder-heading-manage-link">Manage<span class="usa-sr-only"> this folder</span></a>
<a href="{{ url_for('.manage_template_folder', service_id=current_service.id, template_folder_id=current_template_folder_id) }}" class="usa-link folder-heading-manage-link">Manage this folder<span class="usa-sr-only">Manage this folder</span></a>
</div>
{% endif %}
</div>