A11Y: improves search-in-options filter accessibility (#11809)

This commit is contained in:
Joffrey JAFFEUX 2021-01-22 14:39:16 +01:00 committed by GitHub
parent 7521cb51c4
commit 314e7be2b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 28 deletions

View File

@ -60,59 +60,69 @@
<div class="container advanced-search-topics-posts-group">
<div class="control-group pull-left">
<label class="control-label" for="search-in-options">{{i18n "search.advanced.filters.label"}}</label>
<div class="controls">
{{#if currentUser}}
<section class="field">
<label>
<fieldset class="grouped-control">
<legend class="grouped-control-label" for="search-in-options">{{i18n "search.advanced.filters.label"}}</legend>
{{#if currentUser}}
<div class="grouped-control-field">
{{input
id="matching-title-only"
type="checkbox"
class="in-title"
checked=searchedTerms.special.in.title
click=(action "onChangeSearchTermForSpecialInTitle" value="target.checked")
}}
{{i18n "search.advanced.filters.title"}}
</label>
<label>
<label for="matching-title-only">
{{i18n "search.advanced.filters.title"}}
</label>
</div>
<div class="grouped-control-field">
{{input
id="matching-liked"
type="checkbox"
class="in-likes"
checked=searchedTerms.special.in.likes
click=(action "onChangeSearchTermForSpecialInLikes" value="target.checked")
}}
{{i18n "search.advanced.filters.likes"}}
</label>
<label>
<label for="matching-liked">{{i18n "search.advanced.filters.likes"}}</label>
</div>
<div class="grouped-control-field">
{{input
id="matching-in-messages"
type="checkbox"
class="in-private"
checked=searchedTerms.special.in.personal
click=(action "onChangeSearchTermForSpecialInPersonal" value="target.checked")
}}
{{i18n "search.advanced.filters.private"}}
</label>
<label>
<label for="matching-in-messages">{{i18n "search.advanced.filters.private"}}</label>
</div>
<div class="grouped-control-field">
{{input
id="matching-seen"
type="checkbox"
class="in-seen"
checked=searchedTerms.special.in.seen
click=(action "onChangeSearchTermForSpecialInSeen" value="target.checked")
}}
{{i18n "search.advanced.filters.seen"}}
</label>
</section>
{{/if}}
{{combo-box
id="in"
valueProperty="value"
content=inOptions
value=searchedTerms.in
onChange=(action "onChangeSearchTermForIn")
options=(hash
none="user.locale.any"
clearable=true
)
}}
<label for="matching-seen">{{i18n "search.advanced.filters.seen"}}</label>
</div>
{{/if}}
{{combo-box
id="in"
valueProperty="value"
content=inOptions
value=searchedTerms.in
onChange=(action "onChangeSearchTermForIn")
options=(hash
none="user.locale.any"
clearable=true
)
}}
</fieldset>
</div>
</div>
<div class="control-group pull-left">

View File

@ -859,3 +859,24 @@ table {
z-index: z("max");
color: var(--secondary);
}
.controls {
.grouped-control {
display: flex;
flex-direction: column;
.grouped-control-label {
padding: 0.25em 0;
}
.grouped-control-field {
flex: 1 0 auto;
display: flex;
padding-bottom: 0.25em;
label {
margin: 0;
}
}
}
}