switched several functionality between tabs

This commit is contained in:
Naeltard 2015-10-02 01:40:20 +02:00
parent 203a1d1caa
commit 373fff9853
9 changed files with 116 additions and 96 deletions

View File

@ -34,25 +34,9 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
${loginform}
</div>
<!--<div class="navbar-inner">-->
<!-- <ul class="nav navbar-nav">
<li><a class="brand" href="" id="menu_uvote">uVote</a></li>
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><font size="2">impressum</font></a></li>
</ul> -->
<!--</div> -->
</div>
</nav>
<div class="row" id="site-content">
<div class="row" id="user_main"></div>
<div class="row" id="user_main"></div>
</div>
</div>

View File

@ -1,10 +1,26 @@
<nav class="navbar navbar-default navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav" id="tabs_user_main">
<li class="active"><a href="#!start(user_main(u))">Abstimmen</a></li>
<li><a href="#!start(user_main(ur))">Auswerten</a></li>
<li><a href="#!start(user_main(my))">Mithelfen</a></li>
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><font size="2">Impressum</font></a></li>
</ul>
${loginform}
</div>
<!--<div class="navbar-inner">-->
<!-- <ul class="nav navbar-nav">
<li><a class="brand" href="" id="menu_uvote">uVote</a></li>
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><font size="2">impressum</font></a></li>
</ul> -->
<!--</div> -->
</div>
</nav>
<div class="tabbable" id="tabbable_main_menu">
<ul class="nav nav-tabs" id="tabs_user_main">
<li class="active"><a href="#!start(user_main(u))">Abstimmen</a></li>
<li><a href="#!start(user_main(ur))">Auswerten</a></li>
<li><a href="#!start(user_main(my))">Mithelfen</a></li>
<li><a data-toggle="modal" class="brand" href="#impressum" id="impressum"><font size="2">Impressum</font></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab_main"></div>
</div>

View File

@ -6,8 +6,15 @@ class user_main extends SYSTEM\PAGE\Page {
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_main/css/main_menu.css'));}
public static function js(){
return array(\SYSTEM\WEBPATH(new PPAGE(),'user_main/js/user_main.js'));}
public function exchange_loginformmain(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loggedinformtop.tpl'),array());}
public function getloginformmain(){
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/loginform.tpl'),array());}
public function html(){
$vars = array();
$vars['loginform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->exchange_loginformmain() : $this->getloginformmain() ;
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main/main_menu.tpl'),$vars);
}

View File

@ -1,28 +1,10 @@
<div class="row">
<div class="col-md-6">
<div class="col-md-12">
${welcome_text}
<span class="badge badge-info">${user_count}</span> Nutzer auf uVote
</div>
<div class="col-md-6">
<h5>Entscheidungsverhalten der uVote Community</h5>
<span style="">
${votes_all}
</span>
<span style=""> Wie oft die uVote Community
<br> insgesamt Dafür, Dagegen oder
<br> Enthaltung gestimmt hat.</span>
<h5>Entscheidungsverhalten des Bundestags</h5>
<span style="">
${votes_all_bt}
</span>
<span style=""> Wie oft der Bundestag
<br> Dafür, Dagegen oder
<br> Enthaltung gestimmt hat.</span>
</div>
</div>
<div class="row" id="list_active_container">

View File

@ -14,56 +14,7 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
}
private function votes_all(){
$votes = votes::get_all_votes();
$result = '';
foreach($votes as $vote){
switch($vote['choice']){
case 1:
$vote['choice'] = 'PRO';
$vote['badge_color'] = 'badge-success';
break;
case 2:
$vote['choice'] = 'CON';
$vote['badge_color'] = 'badge-important';
break;
case 3:
$vote['choice'] = 'ENT';
$vote['badge_color'] = 'badge-info';
break;
}
//$vote['count'];
//$vote['choice'];
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/votecountchoice.tpl'),$vote);
}
return $result;
}
private function votes_all_bt(){
$votes = votes::get_all_votes_bt();
$result = '';
foreach($votes as $vote){
switch($vote['bt_choice']){
case 1:
$vote['bt_choice'] = 'PRO';
$vote['badge_color'] = 'badge-success';
break;
case 2:
$vote['bt_choice'] = 'CON';
$vote['badge_color'] = 'badge-important';
break;
case 3:
$vote['bt_choice'] = 'ENT';
$vote['badge_color'] = 'badge-info';
break;
case 0:
$vote['bt_choice'] = 'OFFEN';
}
//$vote['count'];
//$vote['choice'];
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/votecountchoicebt.tpl'),$vote);
}
return $result;
}
private function user_count(){
$vars = votes::get_user_count();
@ -81,8 +32,7 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
$vars['list_active'] = $this->get_list_active();
$vars['uvote_to_bt'] = $this->uvote_to_parties();
$vars['votes_all'] = $this->votes_all();
$vars['votes_all_bt'] = $this->votes_all_bt();
$vars['user_count'] = $this->user_count();
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));

View File

@ -38,7 +38,27 @@
</div>
</div>
<div id="graph_bt_user_overall" class="row"></div>
<div class="row">
<div class="col-md-6">
<h5>Entscheidungsverhalten der uVote Community</h5>
<span style="">
${votes_all}
</span>
<span style=""> Wie oft die uVote Community
<br> insgesamt Dafür, Dagegen oder
<br> Enthaltung gestimmt hat.</span>
</div>
<div class="col-md-6">
<h5>Entscheidungsverhalten des Bundestags</h5>
<span style="">
${votes_all_bt}
</span>
<span style=""> Wie oft der Bundestag
<br> Dafür, Dagegen oder
<br> Enthaltung gestimmt hat.</span>
</div>
</div>
<div id="graph_bt_user_overall" class="row"></div>
<script type="text/javascript" language="JavaScript">load_visualisation_urvote('graph_bt_user_overall',84600);</script>
</div>

View File

@ -0,0 +1,5 @@
<div>
<span class="badge" style="">${choice}</span>
<span class="badge ${badge_color}" style="">${count}</span>
</div>

View File

@ -0,0 +1,4 @@
<div>
<span class="badge" style="">${bt_choice}</span>
<span class="badge ${badge_color}" style="">${count}</span>
</div>

View File

@ -76,9 +76,61 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
new INFO($result);
return $result;
}
private function votes_all(){
$votes = votes::get_all_votes();
$result = '';
foreach($votes as $vote){
switch($vote['choice']){
case 1:
$vote['choice'] = 'PRO';
$vote['badge_color'] = 'badge-success';
break;
case 2:
$vote['choice'] = 'CON';
$vote['badge_color'] = 'badge-important';
break;
case 3:
$vote['choice'] = 'ENT';
$vote['badge_color'] = 'badge-info';
break;
}
//$vote['count'];
//$vote['choice'];
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/votecountchoice.tpl'),$vote);
}
return $result;
}
private function votes_all_bt(){
$votes = votes::get_all_votes_bt();
$result = '';
foreach($votes as $vote){
switch($vote['bt_choice']){
case 1:
$vote['bt_choice'] = 'PRO';
$vote['badge_color'] = 'badge-success';
break;
case 2:
$vote['bt_choice'] = 'CON';
$vote['badge_color'] = 'badge-important';
break;
case 3:
$vote['bt_choice'] = 'ENT';
$vote['badge_color'] = 'badge-info';
break;
case 0:
$vote['bt_choice'] = 'OFFEN';
}
//$vote['count'];
//$vote['choice'];
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/votecountchoicebt.tpl'),$vote);
}
return $result;
}
public function html(){
$vars = array();
// $vars['poll_compare'] = $this->count_all_polls();
// $vars['poll_compare'] = $this->count_all_polls();
$vars['votes_all'] = $this->votes_all();
$vars['votes_all_bt'] = $this->votes_all_bt();
$vars['choices_user_ID'] = $this->user_per_party_overall();
$vars['choices_bt_to_user'] = $this->user_to_bt();
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';