Sha256: 7f9c4ec259e47cac2b388d3800e70239101de6c75aa32b20af6b2eae9e7488ae

Contents?: true

Size: 789 Bytes

Versions: 26

Compression:

Stored size: 789 Bytes

Contents

- (poll_question.poll_question_options + [nil]).each do |poll_question_option|
  - responses = ballot_responses.select { |br| br.response.blank? } if poll_question_option.blank?
  - responses ||= ballot_responses.select { |br| Array(br.response).include?(poll_question_option) }

  - count = responses.length
  - total = ballot_responses.length
  - percent = (total.zero? ? 0 : ((count * 100.0) / total).round)

  - next if poll_question_option.blank? && count == 0

  .poll-result-option
    .d-flex
      .mr-auto= poll_question_option.blank? ? 'None of the Above' : poll_question_option
      .text-muted #{count} (#{percent}%)

    .progress.mb-3
      .progress-bar{role: 'progressbar', 'aria-valuenow': count, 'aria-valuemin': 0, 'aria-valuemax': total, style: "width: #{percent}%"}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
effective_polls-0.7.2 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.7.1 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.7.0 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.6.2 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.6.1 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.6.0 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.6 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.5 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.4 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.3 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.2 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.1 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.5.0 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.4.1 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.4.0 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.3.0 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.2.0 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.1.6 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.1.5 app/views/effective/poll_results/results/_poll_question_option.html.haml
effective_polls-0.1.4 app/views/effective/poll_results/results/_poll_question_option.html.haml