Commit 1127c4c6 authored by Dries's avatar Dries
Browse files

- Patch #1315616 by amateescu: use a definition list for the poll results.

parent 73c878b0
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
<?php if ($block): ?> <?php if ($block): ?>
<h3 class="poll-title"><?php print $title; ?></h3> <h3 class="poll-title"><?php print $title; ?></h3>
<?php endif; ?> <?php endif; ?>
<dl>
<?php print $results; ?> <?php print $results; ?>
</dl>
<div class="total"> <div class="total">
<?php print t('Total votes: @votes', array('@votes' => $votes)); ?> <?php print t('Total votes: @votes', array('@votes' => $votes)); ?>
</div> </div>
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
.poll { .poll {
overflow: hidden; overflow: hidden;
} }
.poll dl,
.poll dd {
margin: 0;
}
.poll .bar { .poll .bar {
height: 1em; height: 1em;
margin: 1px 0; margin: 1px 0;
......
...@@ -823,7 +823,8 @@ function poll_view_results($node, $view_mode, $block = FALSE) { ...@@ -823,7 +823,8 @@ function poll_view_results($node, $view_mode, $block = FALSE) {
$poll_results[] = array( $poll_results[] = array(
'#theme' => 'meter', '#theme' => 'meter',
'#prefix' => '<div class="choice-title">' . check_plain($choice['chtext']) . '</div>', '#prefix' => '<dt class="choice-title">' . check_plain($choice['chtext']) . '</dt>' . PHP_EOL . '<dd class="choice-result">',
'#suffix' => '</dd>' . PHP_EOL,
'#display_value' => t('!percentage%', array('!percentage' => $percentage)) . $display_votes, '#display_value' => t('!percentage%', array('!percentage' => $percentage)) . $display_votes,
'#min' => 0, '#min' => 0,
'#max' => $total_votes, '#max' => $total_votes,
......
...@@ -228,7 +228,7 @@ class PollCreateTestCase extends PollTestCase { ...@@ -228,7 +228,7 @@ class PollCreateTestCase extends PollTestCase {
$this->clickLink($title); $this->clickLink($title);
$this->assertText($new_option, 'New option found.'); $this->assertText($new_option, 'New option found.');
$option = $this->xpath('//div[@id="node-1"]//article[@class="poll"]//div[@class="choice-title"]'); $option = $this->xpath('//div[@id="node-1"]//article[@class="poll"]//dt[@class="choice-title"]');
$this->assertEqual(end($option), $new_option, 'Last item is equal to new option.'); $this->assertEqual(end($option), $new_option, 'Last item is equal to new option.');
$votes = $this->xpath('//div[@id="node-1"]//article[@class="poll"]//div[@class="percent"]'); $votes = $this->xpath('//div[@id="node-1"]//article[@class="poll"]//div[@class="percent"]');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment