This commit is contained in:
Nael 2014-03-03 11:01:18 +01:00
parent 97a3a80150
commit a2c88132fd
6 changed files with 22 additions and 12 deletions

View File

@ -40,7 +40,11 @@ class default_bulletin extends SYSTEM\PAGE\Page {
private function voice_weight(){
$vars = votes::get_count_user_votes_per_poll($this->poll_ID);
$vars['voteweight'] = 1/$vars['count']*100;
if (!$vars['count']){
$vars['voteweight'] = 100;
}
else {$vars['voteweight'] = 1/$vars['count']*100;
}
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);;
}

View File

@ -59,14 +59,16 @@ class default_page extends SYSTEM\PAGE\Page {
$vote['choice_class_linke'] = $this->tablerow_class($linke['choice']);
$uvote = votes::get_users_choice_per_poll($vote['ID']);
$vo = votes::get_count_user_votes_per_poll($vote['ID']);
$vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : '';
$vote['uv_pro'] = $vote['uv_con'] = $vote['uv_ent'] = '<2';
$vote['uv_pro'] = $vote['uv_con'] = $vote['uv_ent'] = '0';
foreach($uvote as $v){
switch($v['choice']){
case 1: $vote['uv_pro'] = $v['count'] > 1 ? $v['count'] : '<2'; break;
case 2: $vote['uv_con'] = $v['count'] > 1 ? $v['count'] : '<2'; break;
case 3: $vote['uv_ent'] = $v['count'] > 1 ? $v['count'] : '<2'; break;
case 1: $vote['uv_pro'] = $v['count'] > 0 ? $v['count']/$vo['count']*100 : '0'; break;
case 2: $vote['uv_con'] = $v['count'] > 0 ? $v['count']/$vo['count']*100 : '0'; break;
case 3: $vote['uv_ent'] = $v['count'] > 0 ? $v['count']/$vo['count']*100 : '0'; break;
default:
}
}

View File

@ -14,11 +14,15 @@
<img src="${frontend_logos}icon_gruene.png" width="30"/><span class="badge ${choice_class_gruene}" style="float:right;">${gruene}</span><br/>
<img src="${frontend_logos}icon_linke.png" width="30"/><span class="badge ${choice_class_linke}" style="float:right;">${linke}</span>
</td>
<td class="${uv_vote_class}" style="width: 35px; height: 100%; border-left: 1px solid lightgray;">
<img src="${frontend_logos}icon_urn.png" width="25"/>
<span class="badge badge-success" style="">${uv_pro}</span>
<span class="badge badge-important" style="">${uv_con}</span>
<span class="badge" style="">${uv_ent}</span>
<td class="${uv_vote_class}" style="width: 50px; height: 100%; border-left: 1px solid lightgray;">
<img src="${frontend_logos}icon_urn.png" width="15"/>
<div style="float: right"><font size=1>uVote</font></div>
<span class="badge badge-success" style="">${uv_pro}%</span>
<span class="badge badge-important" style="">${uv_con}%</span>
<span class="badge" style="">${uv_ent}%</span>
<br>
<br>
<br>
</td>

View File

@ -10,7 +10,6 @@
</div>
<div style="width: 50%; float: right;">
<h5>Entscheidungsverhalten des Bundestags</h5>
<br>
<span style="float: left">
${votes_all_bt}
</span>

View File

@ -1,4 +1,5 @@
<h5>Deine Abstimmungsquote</h5>
<br>
<div style="">
<div style="float: left">Abgestimmt/</div>
<div style="margin-left: 90px;">Offen</div>

View File

@ -13,7 +13,7 @@
</tr>
</table>
</div>
<div style="float: right;">
<div style="margin-left: 40px; float: left;">
${user_temp_votes}
</div>
</div>