Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static/frontend: add a11y attributes to interactive elements #99

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions static/frontend/unit/main/_meta.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@

{{define "unit-meta-details-check"}}
<img class="go-Icon{{if .}} go-Icon--accented{{end}}"
tabindex="0"
role="button"
{{- if . -}}
src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked"
src="/static/shared/icon/check_circle_gm_grey_24dp.svg" alt="checked" aria-label="Valid file, toggle tooltip"
{{- else -}}
src="/static/shared/icon/cancel_gm_grey_24dp.svg" alt="unchecked"
src="/static/shared/icon/cancel_gm_grey_24dp.svg" alt="unchecked" aria-label="Missing or invalid file, toggle tooltip"
{{- end -}}
height="24" width="24">
{{end}}
Expand All @@ -74,9 +76,9 @@
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Unit.HasGoMod}}
Valid {{if .Unit.HasGoMod}}<a href="{{.Details.ModFileURL}}" target="_blank" rel="noopener">{{end}}go.mod{{if .Unit.HasGoMod}}</a>{{end}} file
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
<img class="go-Icon" role="button" tabindex="0" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" aria-label="Toggle go.mod validity tooltip" height="24" width="24">
</summary>
<p>
<p aria-live="polite" role="tooltip">
The Go module system was introduced in Go 1.11 and is the official dependency management
solution for Go.
</p>
Expand All @@ -87,9 +89,9 @@
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Unit.IsRedistributable}}
Redistributable license
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
<img class="go-Icon" role="button" tabindex="0" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" aria-label="Toggle redistributable help tooltip" height="24" width="24">
</summary>
<p>
<p aria-live="polite" role="tooltip">
Redistributable licenses place minimal restrictions on how software can be used,
modified, and redistributed.
</p>
Expand All @@ -100,19 +102,19 @@
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Details.IsTaggedVersion}}
Tagged version
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
<img class="go-Icon" role="button" tabindex="0" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" aria-label="Toggle tagged version tooltip" height="24" width="24">
</summary>
<p>Modules with tagged versions give importers more predictable builds.</p>
<p aria-live="polite" role="tooltip">Modules with tagged versions give importers more predictable builds.</p>
</details>
</li>
<li>
<details class="go-Tooltip js-tooltip" data-gtmc="tooltip">
<summary class="go-textSubtle">
{{template "unit-meta-details-check" .Details.IsStableVersion}}
Stable version
<img class="go-Icon" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
<img class="go-Icon" role="button" tabindex="0" aria-label="Toggle stable version tooltip" src="/static/shared/icon/help_gm_grey_24dp.svg" alt="" height="24" width="24">
</summary>
<p>When a project reaches major version v1 it is considered stable.</p>
<p aria-live="polite" role="tooltip">When a project reaches major version v1 it is considered stable.</p>
</details>
</li>
<li class="UnitMeta-detailsLearn">
Expand Down