make radiostrips accessible

This commit is contained in:
codl 2018-04-25 15:04:08 +02:00
parent 07ad982b96
commit 022cf7520a
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
2 changed files with 33 additions and 7 deletions

View File

@ -268,38 +268,44 @@ section > pre.error-log {
display: inline-flex;
flex-direction: row;
flex-wrap: wrap;
}
.radiostrip .choice {
position: relative;
}
.radiostrip input[type=radio] {
position: absolute;
top: 0; left: 0;
height: 1px; width: 1px;
width: 100%; height: 100%;
margin: 0;
opacity: 0;
cursor: pointer;
}
.radiostrip label {
padding: .3em .5em;
cursor: pointer;
user-select: none;
background-color: transparent;
border: 1px solid rgba(0,0,0,0.3);
}
.radiostrip label:first-of-type {
.radiostrip span.choice:first-child label {
border-radius: .2rem 0 0 .2rem;
}
.radiostrip label:last-of-type {
.radiostrip span.choice:last-child label {
border-radius: 0 .2rem .2rem 0;
}
.radiostrip label:not(:first-of-type) {
.radiostrip span.choice:not(:first-child) label {
border-left-color: transparent;
}
.radiostrip label:not(:last-of-type) {
.radiostrip span.choice:not(:last-child) label {
border-right-color: transparent;
margin-right: 1px;
}
.radiostrip input[type=radio]:focus + label {

View File

@ -72,20 +72,35 @@
</p>
<p>Keep
<span class="radiostrip">
<span class="choice">
<input type=radio name=policy_keep_favourites value=keeponly id=policy_keep_favourites_keeponly {{ "checked" if g.viewer.account.policy_keep_favourites == 'keeponly' }}>
<label for=policy_keep_favourites_keeponly>favourited posts</label>
</span>
<span class="choice">
<input type=radio name=policy_keep_favourites value=deleteonly id=policy_keep_favourites_deleteonly {{ "checked" if g.viewer.account.policy_keep_favourites == 'deleteonly' }}>
<label for=policy_keep_favourites_deleteonly>non-favourited posts</label>
</span>
<span class="choice">
<input type=radio name=policy_keep_favourites value=none id=policy_keep_favourites_none {{ "checked" if g.viewer.account.policy_keep_favourites == 'none' }}>
<label for=policy_keep_favourites_none>neither</label>
</span>
</span>
</p>
<p>Keep
<span class="radiostrip">
<span class="choice">
<input type=radio name=policy_keep_media value=keeponly id=policy_keep_media_keeponly {{ "checked" if g.viewer.account.policy_keep_media == 'keeponly' }}>
<label for=policy_keep_media_keeponly>media posts</label>
</span>
<span class="choice">
<input type=radio name=policy_keep_media value=deleteonly id=policy_keep_media_deleteonly {{ "checked" if g.viewer.account.policy_keep_media == 'deleteonly' }}>
<label for=policy_keep_media_deleteonly>non-media posts</label>
</span>
<span class="choice">
<input type=radio name=policy_keep_media value=none id=policy_keep_media_none {{ "checked" if g.viewer.account.policy_keep_media == 'none' }}>
<label for=policy_keep_media_none>neither</label>
</span>
@ -93,10 +108,15 @@
{% if g.viewer.account.service == 'mastodon' %}
<p>Keep direct messages
<span class="radiostrip">
<span class="choice">
<input type=radio name=policy_keep_direct value=true id=policy_keep_direct_true {{ "checked" if g.viewer.account.policy_keep_direct }}>
<label for=policy_keep_direct_true>Yes</label>
</span>
<span class="choice">
<input type=radio name=policy_keep_direct value=false id=policy_keep_direct_false {{ "checked" if not g.viewer.account.policy_keep_direct }}>
<label for=policy_keep_direct_false>No</label>
</span>
</span>
</p>
{% endif %}