Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
1127c4c6
Commit
1127c4c6
authored
Mar 03, 2012
by
Dries
Browse files
- Patch
#1315616
by amateescu: use a definition list for the poll results.
parent
73c878b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/modules/poll/poll-results.tpl.php
View file @
1127c4c6
...
@@ -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
;
?>
<?php
print
$results
;
?>
<dl>
<?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>
...
...
core/modules/poll/poll.css
View file @
1127c4c6
...
@@ -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
;
...
...
core/modules/poll/poll.module
View file @
1127c4c6
...
@@ -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
,
...
...
core/modules/poll/poll.test
View file @
1127c4c6
...
@@ -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"]//d
iv
[@class="choice-title"]'
);
$option
=
$this
->
xpath
(
'//div[@id="node-1"]//article[@class="poll"]//d
t
[@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"]'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment