mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-02 07:52:15 +02:00
fix aria warning
This commit is contained in:
parent
e9432ccd0e
commit
20ff3541b4
1 changed files with 26 additions and 0 deletions
26
src/registrar/templates/admin/search_form.html
Normal file
26
src/registrar/templates/admin/search_form.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% comment %} This is an override of the django search bar to add better accessibility compliance.
|
||||
There are no blocks defined here, so we had to copy the code.
|
||||
https://github.com/django/django/blob/main/django/contrib/admin/templates/admin/search_form.html
|
||||
{% endcomment %}
|
||||
{% load i18n static %}
|
||||
{% if cl.search_fields %}
|
||||
<div id="toolbar"><form id="changelist-search" method="get" role="search">
|
||||
<div><!-- DIV needed for valid HTML -->
|
||||
{% comment %} .gov override - removed for="searchbar" {% endcomment %}
|
||||
<label><img src="{% static "admin/img/search.svg" %}" alt="Search"></label>
|
||||
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar"{% if cl.search_help_text %} aria-describedby="searchbar_helptext"{% endif %}>
|
||||
<input type="submit" value="{% translate 'Search' %}">
|
||||
{% if show_result_count %}
|
||||
<span class="small quiet">{% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}{{ is_popup_var }}=1{% if cl.add_facets %}&{% endif %}{% endif %}{% if cl.add_facets %}{{ is_facets_var }}{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)</span>
|
||||
{% endif %}
|
||||
{% for pair in cl.params.items %}
|
||||
{% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}">{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if cl.search_help_text %}
|
||||
<br class="clear">
|
||||
{% comment %} .gov override - added for="searchbar" {% endcomment %}
|
||||
<label class="help" id="searchbar_helptext" for="searchbar">{{ cl.search_help_text }}</label>
|
||||
{% endif %}
|
||||
</form></div>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue