Skip to content

Commit 29798f0

Browse files
kartbendleach02
authored andcommitted
doc: extensions: boards: add labels to search form fields
Add proper labels to the form fields for better UX/accessibility Updated the placeholder for the "board name" field to be more informative. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 52efa3b commit 29798f0

File tree

2 files changed

+55
-28
lines changed

2 files changed

+55
-28
lines changed

doc/_extensions/zephyr/domain/static/css/board-catalog.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
font-size: 14px;
2222
border-radius: 50px;
2323
padding: 10px 18px;
24-
flex: 1 1 200px;
2524
background-color: var(--input-background-color);
2625
color: var(--body-color);
2726
transition: all 0.3s ease;
@@ -31,8 +30,23 @@
3130
.filter-form input:focus, .filter-form select:focus {
3231
border-color: var(--input-focus-border-color);
3332
}
34-
.select-container {
33+
34+
.form-group {
3535
flex: 1 1 200px;
36+
display: grid;
37+
grid-template-rows: auto 1fr;
38+
margin-bottom: 10px;
39+
}
40+
41+
.filter-form .form-group label {
42+
color: var(--body-color);
43+
font-size: 10px;
44+
text-transform: uppercase;
45+
padding-left: 18px;
46+
margin-bottom: 5px;
47+
}
48+
49+
.select-container {
3650
position: relative;
3751
}
3852

doc/_extensions/zephyr/domain/templates/board-catalog.html

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,47 @@
44
#}
55

66
<form class="filter-form" aria-label="Filter boards by name, architecture, and vendor">
7-
<input type="text" id="name" placeholder="Name" style="flex-basis: 100%"
8-
aria-label="Name" />
9-
<div class="select-container">
10-
<select id="arch" aria-label="Architecture">
11-
<option value="" disabled selected>Select an architecture</option>
12-
<option value="nios2">Altera Nios II</option>
13-
<option value="arm">ARM</option>
14-
<option value="arm64">ARM 64</option>
15-
<option value="mips">MIPS</option>
16-
<option value="posix">POSIX</option>
17-
<option value="riscv">RISC-V</option>
18-
<option value="sparc">SPARC</option>
19-
<option value="arc">Synopsys DesignWare ARC</option>
20-
<option value="x86">x86</option>
21-
<option value="xtensa">Xtensa</option>
22-
</select>
7+
8+
<div class="form-group" style="flex-basis: 100%">
9+
<label for="name">Name</label>
10+
<input type="text" id="name"
11+
placeholder='Name (or partial name) of the board, e.g. "reel board", "nucleo", &hellip;'
12+
oninput="filterBoards()" />
2313
</div>
24-
<div class="select-container" style="flex-basis: 400px">
25-
<select id="vendor" aria-label="Vendor">
26-
<option value="" disabled selected>Select a vendor</option>
27-
{# Only show those vendors that have actual boards in the catalog.
28-
Note: as sorting per vendor name is not feasible in Jinja, the option list is sorted in the
29-
JavaScript code later #}
30-
{% for vendor in (catalog.boards | items | map(attribute='1.vendor') | unique ) %}
31-
<option value="{{ vendor }}">{{ catalog.vendors[vendor] }}</option>
32-
{% endfor %}
33-
</select>
14+
15+
<div class="form-group">
16+
<label for="arch">Architecture</label>
17+
<div class="select-container">
18+
<select id="arch">
19+
<option value="" disabled selected>Select an architecture</option>
20+
<option value="nios2">Altera Nios II</option>
21+
<option value="arm">ARM</option>
22+
<option value="arm64">ARM 64</option>
23+
<option value="mips">MIPS</option>
24+
<option value="posix">POSIX</option>
25+
<option value="riscv">RISC-V</option>
26+
<option value="sparc">SPARC</option>
27+
<option value="arc">Synopsys DesignWare ARC</option>
28+
<option value="x86">x86</option>
29+
<option value="xtensa">Xtensa</option>
30+
</select>
31+
</div>
3432
</div>
33+
34+
<div class="form-group" style="flex-basis: 400px">
35+
<label for="vendor">Vendor</label>
36+
<div class="select-container">
37+
<select id="vendor">
38+
<option value="" disabled selected>Select a vendor</option>
39+
{# Only show those vendors that have actual boards in the catalog.
40+
Note: as sorting per vendor name is not feasible in Jinja, the option list is sorted in the JavaScript code later #}
41+
{% for vendor in (catalog.boards | items | map(attribute='1.vendor') | unique ) %}
42+
<option value="{{ vendor }}">{{ catalog.vendors[vendor] }}</option>
43+
{% endfor %}
44+
</select>
45+
</div>
46+
</div>
47+
3548
</form>
3649

3750
<div id="form-options" style="text-align: center; margin-bottom: 20px">

0 commit comments

Comments
 (0)