Skip to content
Snippets Groups Projects
Commit 17a23c50 authored by Geoffrey Spear's avatar Geoffrey Spear Committed by Demian Katz
Browse files

Accessibility improvements (#1222)

* Add aria-label attributes to search form inputs and selects

Guidelines:
WCAG 2.0 A F68
Section 508 1194.22 (n)

* Add title element to FacetList page

Guideline: https://www.w3.org/TR/WCAG20-TECHS/F25.html

* Add aria-label to initial similar items carousel

This widget has a label added by JS after it's clicked, but doesn't start with a label, which
is triggering WCAG 2.0 A F89 failure.
parent 5c54edfd
Branches
Tags
No related merge requests found
......@@ -364,6 +364,7 @@ external_auth_heading = "Access to licensed material"
external_auth_login_message = "Login to access licensed material"
external_auth_unauthorized = "You are not authorized to access licensed material"
external_auth_unauthorized_desc = "Your login method does not provide access to licensed material. Please log out and then log in using another method."
facet_list_for = "Facet list for %%field%%"
FAQs = "FAQs"
fav_delete = "Delete Selected Favorites"
fav_delete_deleting = "Your favorite(s) are being deleted."
......@@ -897,6 +898,7 @@ search_match = "Match"
search_NOT = "NO Terms"
search_OR = "ANY Terms"
search_save_success = "Search saved successfully."
search_terms = "Search terms"
search_unsave_success = "Saved search removed successfully."
seconds_abbrev = "s"
see all = "see all"
......
......@@ -41,10 +41,10 @@
</div>
<!-- Controls -->
<a class="left carousel-control" href="#similar-items-carousel" role="button" data-slide="prev">
<a class="left carousel-control" href="#similar-items-carousel" role="button" data-slide="prev" aria-label="<?=$this->transEsc('Prev') ?>">
<span class="fa fa-chevron-left glyphicon-chevron-left" title="<?=$this->transEsc('Prev') ?>"></span>
</a>
<a class="right carousel-control" href="#similar-items-carousel" role="button" data-slide="next">
<a class="right carousel-control" href="#similar-items-carousel" role="button" data-slide="next" aria-label="<?=$this->transEsc('Next') ?>">
<span class="fa fa-chevron-right glyphicon-chevron-right" title="<?=$this->transEsc('Next') ?>"></span>
</a>
</div>
......
......@@ -22,9 +22,9 @@
<option value="OR"><?=$this->transEsc("OR")?></option>
<option value="NOT"><?=$this->transEsc("NOT")?></option>
</select>
<input id="search_lookfor0_<?=$search ?>" name="lookfor0[]" class="adv-term-input form-control" type="text" value=""/>
<input id="search_lookfor0_<?=$search ?>" name="lookfor0[]" class="adv-term-input form-control" type="text" value="" aria-label="<?=$this->transEsc("search_terms")?>"/>
<span class="help-block hidden-xs"><?=$this->transEsc("in")?></span>
<select id="search_type0_<?=$search ?>" name="type0[]" class="adv-term-type form-control">
<select id="search_type0_<?=$search ?>" name="type0[]" class="adv-term-type form-control" aria-label="<?=$this->transEsc("Search type")?>">
<?php foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?>
<option value="<?=$this->escapeHtml($searchVal)?>"><?=$this->transEsc($searchDesc)?></option>
<?php endforeach; ?>
......
......@@ -64,7 +64,7 @@
<option value="<?=$this->escapeHtmlAttr($searchVal)?>"<?=($currRow && $currRow->getOperator() == $searchVal)?' selected="selected"':''?>><?=$this->transEsc($searchDesc)?></option>
<?php endforeach; ?>
</select>
<input id="search_lookfor<?=$i?>_<?=$j?>" type="text" value="<?=$currRow?$this->escapeHtmlAttr($currRow->getString()):''?>" size="30" name="lookfor<?=$i?>[]" class="form-control primo-adv-input"/>
<input id="search_lookfor<?=$i?>_<?=$j?>" type="text" value="<?=$currRow?$this->escapeHtmlAttr($currRow->getString()):''?>" size="30" name="lookfor<?=$i?>[]" class="form-control primo-adv-input" aria-label="<?=$this->transEsc("search_terms")?>"/>
</div>
<?php endfor; ?>
</div>
......
......@@ -105,8 +105,8 @@
<div id="new_search_template">
<?php endif; ?>
<div id="search<?=$group . '_' . $search ?>" class="adv-search">
<input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group . '_' . $search ?>" class="adv-term-input form-control" type="text"<?php if (isset($setQueries[$group][$search])): ?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?php endif; ?>>
<select class="adv-term-type form-control" name="type<?=$group ?>[]">
<input name="lookfor<?=$group ?>[]" id="search_lookfor<?=$group . '_' . $search ?>" class="adv-term-input form-control" type="text"<?php if (isset($setQueries[$group][$search])): ?> value="<?=$this->escapeHtml($setQueries[$group][$search]->getString())?>"<?php endif; ?> aria-label="<?=$this->transEsc("search_terms")?>">
<select class="adv-term-type form-control" name="type<?=$group ?>[]" aria-label="<?=$this->transEsc("Search type")?>">
<?php foreach ($this->options->getAdvancedHandlers() as $searchVal => $searchDesc): ?>
<option value="<?=$this->escapeHtml($searchVal)?>"<?php if (isset($setQueries[$group][$search]) && $searchVal == $setQueries[$group][$search]->getHandler()): ?> selected<?php endif; ?>><?=$this->transEsc($searchDesc)?></option>
<?php endforeach; ?>
......
......@@ -11,6 +11,7 @@
$searchAction .= urlencode($this->baseUriExtra);
$urlBase .= '&amp;baseUriExtra=' . urlencode($this->baseUriExtra);
}
$this->headTitle($this->translate('facet_list_for', ['%%field%%' => $this->facetLabel]));
?>
<h2><?=$this->transEsc($this->facetLabel) ?></h2>
<?php if (count($this->sortOptions) > 1): ?>
......
......@@ -44,9 +44,9 @@
<form id="searchForm" class="searchForm navbar-form navbar-left flip" method="get" action="<?=$this->url($basicSearch)?>" name="searchForm" autocomplete="off">
<?= $this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $tabConfig['tabs']]); ?>
<?php $placeholder = $this->searchbox()->getPlaceholderText($tabConfig['selected']['id'] ?? null); ?>
<input id="searchForm_lookfor" class="searchForm_lookfor form-control search-query<?php if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId) ?><?php endif ?>" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<?php if ($placeholder): ?> placeholder="<?=$this->transEsc($placeholder) ?>"<?php endif ?> />
<input id="searchForm_lookfor" class="searchForm_lookfor form-control search-query<?php if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId) ?><?php endif ?>" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<?php if ($placeholder): ?> placeholder="<?=$this->transEsc($placeholder) ?>"<?php endif ?> aria-label="<?=$this->transEsc("search_terms")?>" />
<?php if ($handlerCount > 1): ?>
<select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false">
<select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false" aria-label="<?=$this->transEsc("Search type")?>">
<?php foreach ($handlers as $handler): ?>
<option value="<?=$this->escapeHtmlAttr($handler['value'])?>"<?=$handler['selected'] ? ' selected="selected"' : ''?>><?=$handler['indent'] ? '-- ' : ''?><?=$this->transEsc($handler['label'])?></option>
<?php endforeach; ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment