Skip to content

Commit

Permalink
addresses review feedback
Browse files Browse the repository at this point in the history
Adds explicit ARIA-LABEL attributes to elements whose strings are in
all caps to support idiomatic translation (cf. #5821, #6003).

thread: #6041 (comment)
  • Loading branch information
cfm committed Jul 27, 2021
1 parent c6cd5af commit 79b5924
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion securedrop/source_templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>{{ gettext("We're sorry, our SecureDrop is currently offline.") }}</h1>

{% if 'logged_in' in session %}
<nav>
<a href="{{ url_for('main.logout') }}" class="btn pull-right" id="logout">{{ gettext('LOG OUT') }}</a>
<a href="{{ url_for('main.logout') }}" class="btn pull-right" id="logout" aria-label="{{ gettext('Log Out') }}">{{ gettext('LOG OUT') }}</a>
</nav>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/generate.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>{{ gettext('Welcome') }}</h1>
<form id="create-form" method="post" action="/create" autocomplete="off">
<input name="csrf_token" type="hidden" value="{{ csrf_token() }}">
<input name="tab_id" type="hidden" value="{{ tab_id }}">
<button type="submit" class="btn--space pull-right" id="continue-button">
<button type="submit" class="btn--space pull-right" id="continue-button" aria-label="{{ gettext('Submit Documents') }}">
{{ gettext('SUBMIT DOCUMENTS') }}
</button>
</form>
Expand Down
6 changes: 3 additions & 3 deletions securedrop/source_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ <h2 id="first-submission-heading" class="welcome-text">
</h2>
<p class="extended-welcome-text">{{ gettext('First time submitting to our SecureDrop? Start here.') }}</p>
</div>
<div class="index-column-bottom-container" aria-label="">
<a href="{{ url_for('main.generate') }}" id="submit-documents-button" class="btn alt">
<div class="index-column-bottom-container">
<a href="{{ url_for('main.generate') }}" id="submit-documents-button" class="btn alt" aria-label="gettext('Get Started') }}">
{{ gettext('GET STARTED') }}
</a>
</div>
Expand All @@ -75,7 +75,7 @@ <h2 id="return-visit-heading" class="welcome-text">
<p class="extended-welcome-text">{{ gettext('Already have a codename? Check for replies or submit something new.') }}</p>
</div>
<div class="index-column-bottom-container">
<a href="{{ url_for('main.login') }}" id="login-button" class="btn secondary">
<a href="{{ url_for('main.login') }}" id="login-button" class="btn secondary" aria-label="{{ gettext('Log In') }}">
{{ gettext('LOG IN') }}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions securedrop/source_templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ <h1>{{ gettext('Enter Codename') }}</h1>
</div>

<div class="pull-right section-spacing">
<button type="submit" id="login">
<button type="submit" id="login" aria-label="{{ gettext('Continue') }}">
{{ gettext('CONTINUE') }}
</button>
<a href="{{ url_for('main.index') }}" class="btn secondary" id="cancel">
<a href="{{ url_for('main.index') }}" class="btn secondary" id="cancel" aria-label="{{ gettext('Cancel') }}">
{{ gettext('CANCEL') }}</a>
</div>

Expand Down
2 changes: 1 addition & 1 deletion securedrop/source_templates/logout.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block body %}
<nav>
<a href="{{ url_for('main.login') }}" class="btn pull-right"> {{ gettext('LOG IN') }}</a>
<a href="{{ url_for('main.login') }}" class="btn pull-right" aria-label="{{ gettext('Log In') }}"> {{ gettext('LOG IN') }}</a>
</nav>
<section>
<h1>{{ gettext('One more thing...') }}</h1>
Expand Down
8 changes: 4 additions & 4 deletions securedrop/source_templates/lookup.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ <h2 id="submit-heading" class="headline">{{ gettext('Submit Messages') }}</h2>
</div>

<div class="pull-right section-spacing">
<button type="submit" id="submit-doc-button">
<button type="submit" id="submit-doc-button" aria-label="{{ gettext('Submit') }}">
{{ gettext('SUBMIT') }}
</button>



<a href="{{ url_for('main.lookup') }}" class="btn secondary" id="cancel">
<a href="{{ url_for('main.lookup') }}" class="btn secondary" id="cancel" aria-label="{{ gettext('Cancel') }}">
{{ gettext('CANCEL') }}
</a>
</div>
Expand Down Expand Up @@ -88,15 +88,15 @@ <h2 id="replies-heading" class="headline">{{ gettext('Read Replies') }}</h2>
<h3 id="delete-heading-{{ reply.filename }}" hidden>Delete reply from {{ reply.date|rel_datetime_format(relative=True) }}?</h3>
<p>{{ gettext('Delete this reply?') }}
<a href="#delete">{{ gettext('Cancel') }}</a>
<button type="submit" class="danger" id="confirm-delete-reply-button-{{ reply.filename }}">{{ gettext('DELETE') }}</button>
<button type="submit" class="danger" id="confirm-delete-reply-button-{{ reply.filename }}" aria-label="{{ gettext('Delete') }}>{{ gettext('DELETE') }}</button>
</p>
</dialog>
</form>
<blockquote>{{ reply.decrypted | nl2br }}</blockquote>
</article>
{% endfor %}
<form id="delete-all" method="post" action="{{ url_for('main.batch_delete') }}">
<a class="btn danger" href="#delete-all-confirm">{{ gettext('DELETE ALL REPLIES') }}</a>
<a class="btn danger" href="#delete-all-confirm" aria-label="{{ gettext('Delete All Replies') }}">{{ gettext('DELETE ALL REPLIES') }}</a>
<input name="csrf_token" type="hidden" value="{{ csrf_token() }}">
<dialog open id="delete-all-confirm" class="hidden-prompt" aria-labelledby="delete-all-heading">
<h3 id="delete-all-heading">{{ gettext('Are you finished with the replies?') }}</h3>
Expand Down

0 comments on commit 79b5924

Please sign in to comment.