Merge remote-tracking branch 'parent/main' into upstream-20240822
This commit is contained in:
commit
55f11765ea
34 changed files with 401 additions and 601 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue