mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-22 09:15:50 +03:00
[bugfix/chore] id poll options properly (#2379)
* aria-labels for polls, id poll options properly * my bad, aria labels are for interactive elements
This commit is contained in:
parent
7a9b493f47
commit
71e0aaee3c
3 changed files with 6 additions and 2 deletions
|
@ -113,6 +113,9 @@ type PollVoteRequest struct {
|
||||||
type WebPollOption struct {
|
type WebPollOption struct {
|
||||||
PollOption
|
PollOption
|
||||||
|
|
||||||
|
// ID of the parent poll.
|
||||||
|
PollID string
|
||||||
|
|
||||||
// Emojis contained on parent poll.
|
// Emojis contained on parent poll.
|
||||||
Emojis []Emoji
|
Emojis []Emoji
|
||||||
|
|
||||||
|
|
|
@ -709,6 +709,7 @@ func (c *Converter) StatusToWebStatus(
|
||||||
|
|
||||||
webPollOption := apimodel.WebPollOption{
|
webPollOption := apimodel.WebPollOption{
|
||||||
PollOption: option,
|
PollOption: option,
|
||||||
|
PollID: poll.ID,
|
||||||
Emojis: webStatus.Emojis,
|
Emojis: webStatus.Emojis,
|
||||||
LanguageTag: webStatus.LanguageTag,
|
LanguageTag: webStatus.LanguageTag,
|
||||||
VoteShare: voteShare,
|
VoteShare: voteShare,
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
<ul class="poll-options">
|
<ul class="poll-options">
|
||||||
{{- range $index, $pollOption := .WebPollOptions }}
|
{{- range $index, $pollOption := .WebPollOptions }}
|
||||||
<li class="poll-option">
|
<li class="poll-option">
|
||||||
<label aria-hidden="true" for="option-{{- increment $index -}}" lang="{{- .LanguageTag.TagStr -}}">{{- emojify .Emojis (noescape $pollOption.Title) -}}</label>
|
<label aria-hidden="true" for="poll-{{- $pollOption.PollID -}}-option-{{- increment $index -}}" lang="{{- .LanguageTag.TagStr -}}">{{- emojify .Emojis (noescape $pollOption.Title) -}}</label>
|
||||||
<meter aria-hidden="true" id="option-{{- increment $index -}}" min="0" max="100" value="{{- $pollOption.VoteShare -}}">{{- $pollOption.VoteShare -}}%</meter>
|
<meter aria-hidden="true" id="poll-{{- $pollOption.PollID -}}-option-{{- increment $index -}}" min="0" max="100" value="{{- $pollOption.VoteShare -}}">{{- $pollOption.VoteShare -}}%</meter>
|
||||||
<div class="sr-only">Option {{ increment $index }}: <span lang="{{ .LanguageTag.TagStr }}">{{ emojify .Emojis (noescape $pollOption.Title) -}}</span></div>
|
<div class="sr-only">Option {{ increment $index }}: <span lang="{{ .LanguageTag.TagStr }}">{{ emojify .Emojis (noescape $pollOption.Title) -}}</span></div>
|
||||||
<div class="poll-vote-summary">
|
<div class="poll-vote-summary">
|
||||||
<span class="poll-vote-share">{{- $pollOption.VoteShareStr -}}%</span>
|
<span class="poll-vote-share">{{- $pollOption.VoteShareStr -}}%</span>
|
||||||
|
|
Loading…
Reference in a new issue