summaryrefslogtreecommitdiff
path: root/searx/templates/simple/preferences.html
diff options
context:
space:
mode:
authorMarkus <markus@venom.fritz.box>2024-09-15 17:14:52 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-09-21 15:23:21 +0200
commit5ad0214bd42f6615fd0b171a96519ba55d826315 (patch)
treef8e55cd0cafb0dd34f59fa20aaa7d62786b8f837 /searx/templates/simple/preferences.html
parent8b8d830fd367386c5f06ae5a427028dc12642cd1 (diff)
[fix] simple template: macro checkbox_onoff_reversed
In its previous implementation, the macro ``checkbox_onoff_reversed`` always created an ``aria-labelledby`` attribute, even if there was no descriptive tag with the generated ID (used as the value of the ``aria-labelledby``). Before this patch, the Nu-HTML-Checker [1] reported 255 issues of this type:: The aria-labelledby attribute must point to an element in the same document. (255) [1] https://validator.w3.org/nu/ Signed-off-by: Markus <markus@venom.fritz.box>
Diffstat (limited to 'searx/templates/simple/preferences.html')
-rw-r--r--searx/templates/simple/preferences.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html
index 5b72d5f9e..c04d442f2 100644
--- a/searx/templates/simple/preferences.html
+++ b/searx/templates/simple/preferences.html
@@ -27,11 +27,11 @@
{%- endif -%}
{%- endmacro -%}
-{%- macro checkbox_onoff_reversed(name, checked) -%}
+{%- macro checkbox_onoff_reversed(name, checked, labelledby) -%}
<input type="checkbox" {{- ' ' -}}
name="{{ name }}" {{- ' ' -}}
id="{{ name }}" {{- ' ' -}}
- aria-labelledby="pref_{{ name }}"{{- ' ' -}}
+ {%- if labelledby -%} aria-labelledby="{{ labelledby }}"{{- ' ' -}}{%- endif -%}
class="checkbox-onoff reversed-checkbox"{{- ' ' -}}
{%- if checked -%} checked{%- endif -%}>
{%- endmacro -%}
@@ -42,9 +42,9 @@
<fieldset>{{- '' -}}
<legend>{{ _(plugin.name) }}</legend>{{- '' -}}
<div class="value">
- {{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
+ {{- checkbox_onoff_reversed('plugin_' + plugin.id, plugin.id not in allowed_plugins, 'plugin_labelledby' + plugin.id) -}}
</div>{{- '' -}}
- <div class="description">
+ <div class="description" id="{{ 'plugin_labelledby' + plugin.id }}">
{{- _(plugin.description) -}}
</div>{{- '' -}}
</fieldset>