Commit d31f65a9 authored by Dries's avatar Dries

- Patch #162871 by merlinofchaos: poll module cleanup + tplified the module.

parent 79d8390f
<?php
// $Id$
/**
* @file poll-bar-block.tpl.php
* Display the 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.
*
* @see template_preprocess_poll_bar()
*/
?>
<div class="text"><?php print $title; ?></div>
<div class="bar">
<div style="width: <?php print $percentage; ?>%;" class="foreground"></div>
</div>
<div class="percent">
<?php print $percentage; ?>%
</div>
<?php
// $Id$
/**
* @file poll-bar.tpl.php
* Display the 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.
*
* @see template_preprocess_poll_bar()
*/
?>
<div class="text"><?php print $title; ?></div>
<div class="bar">
<div style="width: <?php print $percentage; ?>%;" class="foreground"></div>
</div>
<div class="percent">
<?php print $percentage; ?>% (<?php print format_plural($votes, '1 vote', '@count votes'); ?>)
</div>
<?php
// $Id$
/**
* @file poll-results-block.tpl.php
* Display the poll results in a block.
*
* Variables available:
* - $title: The title of the poll.
* - $results: The results of the poll.
* - $votes: The total results in the poll.
* - $links: Links in the poll.
* - $nid: The nid of the poll
* - $cancel_form: A form to cancel the user's vote, if allowed.
* - $raw_links: The raw array of links. Should be run through theme('links')
* if used.
* - $vote: The choice number of the current user's vote.
*
* @see template_preprocess_poll_results()
*/
?>
<div class="poll">
<div class="title"><?php print $title ?></div>
<?php print $results ?>
<div class="total">
<?php print t('Total votes: @votes', array('@votes' => $votes)); ?>
</div>
</div>
<div class="links"><?php print $links; ?></div>
<?php
// $Id$
/**
* @file poll-results-block.tpl.php
* Display the poll results in a block.
*
* Variables available:
* - $title: The title of the poll.
* - $results: The results of the poll.
* - $votes: The total results in the poll.
* - $links: Links in the poll.
* - $nid: The nid of the poll
* - $cancel_form: A form to cancel the user's vote, if allowed.
* - $raw_links: The raw array of links.
* - $vote: The choice number of the current user's vote.
*
* @see template_preprocess_poll_results()
*/
?>
<div class="poll">
<?php print $results; ?>
<div class="total">
<?php print t('Total votes: @votes', array('@votes' => $votes)); ?>
</div>
<?php if (!empty($cancel_form)): ?>
<?php print $cancel_form; ?>
<?php endif; ?>
</div>
<?php
// $Id$
/**
* @file poll-vote.tpl.php
* Voting form for a poll.
*
* - $choice: The radio buttons for the choices in the poll.
* - $title: The title of the poll.
* - $block: True if this is being displayed as a block.
* - $vote: The vote button
* - $rest: Anything else in the form that may have been added via
* form_alter hooks.
*
* @see template_preprocess_poll_vote()
*/
?>
<div class="poll">
<div class="vote-form">
<div class="choices">
<?php if ($block): ?>
<div class="title"><?php print $title; ?>:</div>
<?php endif; ?>
<?php print $choice; ?>
</div>
<?php print $vote; ?>
</div>
<?php // This is the 'rest' of the form, in case items have been added. ?>
<?php print $rest ?>
</div>
......@@ -27,6 +27,10 @@
margin: 0 auto;
display: table;
}
.poll .vote-form .choices .title {
font-weight: bold;
}
.node-form .poll-form fieldset {
display: block;
}
This diff is collapsed.
Markdown is supported
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