2 Yii::app()->getClientScript()->registerScriptFile(Yii::app()->getModule(
'vote')->getAssetsUrl() .
'/js/jquery.scrollTo-1.4.3-min.js', CClientScript::POS_READY);
7 <div
class=
"ask_block" id=
"<?php echo 'ask-block-'.$this->id ?>" >
10 <?php $this->widget(
'vote.widgets.ResultsWidget', array(
12 'inPercents' => $this->inPercents,
13 'precision' => $this->precision,
14 'unvotedShow' => ($this->firstResult)?
true:$this->resultsUnvotedShow,
15 'firstResult' =>$this->firstResult
19 <?php
if($this->firstResult && !$this->getIsVoted()): ?>
21 <button
class=
"to_cast_a_vote firstResultControl">
31 <div
class=
"cast_a_vote" style=
"display: <?php echo ($this->firstResult?'none':'block') ?>">
32 <?php $this->widget(
'vote.widgets.PoolWidget', array(
34 'author_id' => $this->author_id,
35 'question' => $this->question,
36 'answers' => $this->answers,
37 'multiply' => $this->multiply,
38 'dynamic' => $this->dynamic,
39 'allowAnonymous' => $this->allowAnonymous,
40 'additionalFields' => $this->additionalFields,
41 'ajax' => $this->ajax,
42 'votedShow' => $this->poolVotedShow,
43 'resultOptions' => array(
45 'inPercents' => $this->inPercents,
46 'precision' => $this->precision,
47 'unvotedShow' => ($this->firstResult)?
true:$this->resultsUnvotedShow,
53 <?php
if($this->firstResult && !$this->getIsVoted()): ?>
55 <button
class=
"back_to_result firstResultControl">
61 </div> <!-- cust_a_vote -->
63 </div> <!-- ask_block -->
65 <script type=
"text/javascript" charset=
"utf-8">
67 $(
"button.to_cast_a_vote").click(
function(){
69 ask_block = $(
this).closest(
'.ask_block');
70 cast_a_vote = $(ask_block).children(
'.cast_a_vote');
71 results = $(ask_block).children(
'.results');
73 $(cast_a_vote).show();
76 $(
"button.back_to_result").click(
function(){
78 ask_block = $(
this).closest(
'.ask_block');
79 cast_a_vote = $(ask_block).children(
'.cast_a_vote');
80 results = $(ask_block).children(
'.results');
82 $(cast_a_vote).hide();