file poll-bar.tpl.php

Default theme implementation to display bar for a single choice in a poll.

Variables available:

  • $title: The title of the poll.
  • $votes: The number of votes for this choice
  • $total_votes: The number of votes for this choice
  • $percentage: The percentage of votes for this choice.
  • $vote: The choice number of the current user's vote.
  • $voted: Set to TRUE if the user voted for this choice.
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to display bar for a single choice in a poll.
  5. *
  6. * Variables available:
  7. * - $title: The title of the poll.
  8. * - $votes: The number of votes for this choice
  9. * - $total_votes: The number of votes for this choice
  10. * - $percentage: The percentage of votes for this choice.
  11. * - $vote: The choice number of the current user's vote.
  12. * - $voted: Set to TRUE if the user voted for this choice.
  13. *
  14. * @see template_preprocess_poll_bar()
  15. *
  16. * @ingroup templates
  17. */
  18. ?>
  19. <div class="text"><?php print $title; ?></div>
  20. <div class="progress">
  21. <div class="progress-bar" role="progressbar" aria-valuenow="<?php print $percentage; ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php print $percentage; ?>%;">
  22. <?php print $percentage; ?>% (<?php print format_plural($votes, '1 vote', '@count votes'); ?>)
  23. </div>
  24. </div>

Related topics