Skip to content

Commit

Permalink
Merge pull request #2197 from GSA/2133-small-a11y-updates
Browse files Browse the repository at this point in the history
2133 small a11y updates
  • Loading branch information
stvnrlly authored Dec 18, 2024
2 parents 89fe517 + e0738dd commit 38da133
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 40 deletions.
4 changes: 2 additions & 2 deletions app/templates/components/components/back-link/template.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav class="usa-breadcrumb" aria-label="Breadcrumb">
<a href="{{ params.href or '#' }}" class="usa-link usa-back-link display-inline-flex {{ params.classes or '' }}"
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}" {% endfor %}>{{ params.html | safe or params.text or 'Back' }}</a>
<a href="{{ params.href.url or params.href or '#' }}" class="usa-link usa-back-link display-inline-flex {{ params.classes or '' }}"
{%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}" {% endfor %}>{{ params.html | safe or params.href.text or 'Back' }}</a>
</nav>
5 changes: 4 additions & 1 deletion app/templates/components/folder-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
<span class="folder-heading-folder">{{ folder.name }}</span>
{% endif %}
{% else %}
<a href="{{ url_for('.choose_template', service_id=service_id, template_type=template_type) }}" class="usa-link {% if loop.length > 2 %}folder-heading-folder-root-truncated{% endif %}">Templates</a>
<a href="{{ url_for('.choose_template', service_id=service_id, template_type=template_type) }}" class="usa-link {% if loop.length > 2 %}folder-heading-folder-root-truncated{% endif %}">
<span class="usa-sr-only">Return to all</span>
Templates
</a>
{% endif %}
{% if not loop.last %}{{ folder_path_separator() }}{% endif %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/partials/jobs/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ <h2 class="recipient-list">Recipient list</h2>
<div>
<ul class="usa-icon-list">
<li class="usa-icon-list__item">
<img src="{{ url_for('static', filename='img/material-icons/description.svg') }}" alt="Description Icon">
<img src="{{ url_for('static', filename='img/material-icons/description.svg') }}" alt="">
<div class="usa-icon-list__content">
<h3>{{ job.original_file_name }}</h3>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/views/check/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2>Recipients list</h2>
<div>
<ul class="usa-icon-list">
<li class="usa-icon-list__item">
<img src="{{ url_for('static', filename='img/material-icons/description.svg') }}" alt="Description Icon">
<img src="{{ url_for('static', filename='img/material-icons/description.svg') }}" alt="">
<div class="usa-icon-list__content">
<h3>{{ original_file_name }}</h3>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/templates/views/send.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


{% block backLink %}
{{ usaBackLink({ "href": url_for('main.send_one_off', service_id=current_service.id, template_id=template.id) }) }}
{{ usaBackLink(params) }}
{% endblock %}

{% block maincolumn_content %}
Expand All @@ -31,10 +31,10 @@
<h2 class="font-body-lg">Your file needs to look like this example</h2>
<p class="hint">
Save your file as a
<acronym title="Comma Separated Values">CSV</acronym>,
<acronym title="Tab Separated Values">TSV</acronym>,
<acronym title="Open Document Spreadsheet">ODS</acronym>,
or Microsoft Excel spreadsheet
<abbr title="Comma Separated Values">CSV</abbr><span aria-hidden="true">, </span>
<abbr title="Tab Separated Values">TSV</abbr><span aria-hidden="true">, </span>
<abbr title="Open Document Spreadsheet">ODS</abbr>
or Microsoft Excel spreadsheet.
</p>

<div class="spreadsheet" data-module="fullscreen-table">
Expand Down
3 changes: 1 addition & 2 deletions app/templates/views/templates/_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
{% endif %}
{% if current_user.has_permissions('manage_templates') %}
<a href="{{ url_for(".edit_service_template", service_id=current_service.id, template_id=template.id) }}" class="usa-button usa-button--outline usa-pill-separate-item">
Edit
Edit this template
</a>
{% endif %}
</div>
</div>
{% endif %}
</div>

54 changes: 28 additions & 26 deletions app/templates/views/templates/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,44 @@ <h1 class="font-body-2xl line-height-sans-2 folder-heading margin-top-0">
</div>
<div class="template-footer">
{% if template._template.updated_at %}
<h2 class="font-body-lg">
<span class="font-body-lg text-bold">
Last edited
<time class="timeago" datetime="{{ template._template.updated_at }}">
<time datetime="{{ template._template.updated_at }}">
{{ template._template.updated_at|format_delta }}
</time>
</h2>
<h3 class="margin-bottom-0">More actions</h3>
</span>
<h2 class="margin-bottom-1 font-body-lg">More actions</h2>
<ul class="usa-list usa-list--unstyled">
<li>
<a class="usa-link margin-right-3"
href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">See previous
versions</a>
href="{{ url_for('.view_template_versions', service_id=current_service.id, template_id=template.id) }}">
See previous versions
</a>
</li>
</ul>
{% endif %}
{% if current_user.has_permissions('manage_templates') and user_has_template_permission %}
{% if not template._template.archived %}
<ul class="usa-list usa-list--unstyled">
<li>
<a class="usa-link margin-right-3"
href="{{ url_for('.delete_service_template', service_id=current_service.id, template_id=template.id) }}">Delete this
template</a>
</li>
</ul>
{% if not template._template.archived %}
<li>
<a class="usa-link margin-right-3"
href="{{ url_for('.delete_service_template', service_id=current_service.id, template_id=template.id) }}">
Delete this template
</a>
</li>
{% endif %}
{% if not template._template.redact_personalisation %}
<li>
<a class="usa-link"
href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">
Hide all personalized and conditional content after sending
</a> for increased privacy protection
</li>
{% else %}
<li>
<p class="hint">Personalization is hidden after sending</p>
</li>
{% endif %}
{% endif %}
{% if not template._template.redact_personalisation %}
<ul class="usa-list usa-list--unstyled">
<li>
<a class="usa-link" href="{{ url_for('.confirm_redact_template', service_id=current_service.id, template_id=template.id) }}">Hide all personalized and conditional content after sending</a> for increased privacy protection
</li>
</ul>
{% else %}
<p class="hint">Personalization is hidden after sending</p>
{% endif %}
</ul>
{% endif %}

</div>

<!--<div class="">
Expand Down
4 changes: 2 additions & 2 deletions tests/app/main/views/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,15 @@ def test_user_with_only_send_and_view_redirected_to_set_sender_for_one_off(
(
["manage_templates"],
[
(".edit_service_template", "Edit"),
(".edit_service_template", "Edit this template"),
],
None,
),
(
["send_messages", "manage_templates"],
[
(".set_sender", "Use this template"),
(".edit_service_template", "Edit"),
(".edit_service_template", "Edit this template"),
],
None,
),
Expand Down

0 comments on commit 38da133

Please sign in to comment.