<?php
$this->breadcrumbs = array(
    'Polls' => array('index'),
    $model->title,
);
?>

<div class="view-large">
    <h1 class="page-title"><?php echo CHtml::encode($model->title); ?></h1>

    <?php if ($model->description): ?>
        <p class="description"><?php echo CHtml::encode($model->description); ?></p>
    <?php endif; ?>

    <?php $this->renderPartial('_results', array('model' => $model)); ?>

    <?php if ($userVote->id): ?>
        <div id="pollvote-<?php echo $userVote->id ?>">
            <?php echo Yii::t('admin', 'You voted:'); ?> <strong><?php echo $userChoice->label ?></strong>.<br />
            <?php
            if ($userCanCancel) {
                echo CHtml::ajaxLink(
                        Yii::t('admin', 'Cancel Vote'), array('/pollvote/delete', 'id' => $userVote->id, 'ajax' => TRUE), array(
                    'type' => 'POST',
                    'success' => 'js:function(){window.location.reload();}',
                        ), array(
                    'class' => 'cancel-vote left',
                    'confirm' => Yii::t('admin', 'Are you sure you want to cancel your vote?'),
                        )
                );
            }
            ?>
        </div>

    <?php else: ?>
        <p><?php echo CHtml::link('Vote', array('/poll/vote', 'id' => $model->id)); ?></p>
    <?php endif; ?>
    <?php $this->widget('shortcodes.CommentWidget', array('options' => array('owner_route' => $this->route, 'owner_params' => array('id' => $model->id)))); ?>
</div>