Merge remote-tracking branch 'parent/main' into upstream-20240822

This commit is contained in:
KMY 2024-08-22 09:18:29 +09:00
commit 55f11765ea
34 changed files with 401 additions and 601 deletions

View file

@ -1,11 +1,10 @@
:ruby
show_results = (user_signed_in? && poll.voted?(current_account)) || poll.expired?
own_votes = user_signed_in? ? poll.own_votes(current_account) : []
total_votes_count = poll.voters_count || poll.votes_count
.poll
%ul
- poll.loaded_options.each_with_index do |option, index|
- poll.loaded_options.each do |option|
%li
- if show_results
- percent = total_votes_count.positive? ? 100 * option.votes_count / total_votes_count : 0
@ -14,9 +13,6 @@
#{percent.round}%
%span.poll__option__text
= prerender_custom_emojis(h(option.title), status.emojis)
- if own_votes.include?(index)
%span.poll__voted
%i.poll__voted__mark.fa.fa-check
%progress{ max: 100, value: [percent, 1].max, 'aria-hidden': 'true' }
%span.poll__chart