mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-22 03:36:39 +00: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
|
@ -113,6 +113,9 @@ type PollVoteRequest struct {
|
|||
type WebPollOption struct {
|
||||
PollOption
|
||||
|
||||
// ID of the parent poll.
|
||||
PollID string
|
||||
|
||||
// Emojis contained on parent poll.
|
||||
Emojis []Emoji
|
||||
|
||||
|
|
|
@ -709,6 +709,7 @@ func (c *Converter) StatusToWebStatus(
|
|||
|
||||
webPollOption := apimodel.WebPollOption{
|
||||
PollOption: option,
|
||||
PollID: poll.ID,
|
||||
Emojis: webStatus.Emojis,
|
||||
LanguageTag: webStatus.LanguageTag,
|
||||
VoteShare: voteShare,
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
<ul class="poll-options">
|
||||
{{- range $index, $pollOption := .WebPollOptions }}
|
||||
<li class="poll-option">
|
||||
<label aria-hidden="true" for="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>
|
||||
<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="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="poll-vote-summary">
|
||||
<span class="poll-vote-share">{{- $pollOption.VoteShareStr -}}%</span>
|
||||
|
|
Loading…
Reference in a new issue