diff --git a/uvote/api/api_uvote.php b/uvote/api/api_uvote.php index 0ba84f0..cd4e32a 100644 --- a/uvote/api/api_uvote.php +++ b/uvote/api/api_uvote.php @@ -47,4 +47,11 @@ class api_uvote extends \SYSTEM\API\api_system { public static function call_vote_action_commentrate($c_ID, $val) { return comments::write_commentrate($c_ID, $val);} + + public static function call_load_tab($set, $cat){ + return stats_basic::basic($cat); + } +} + + \ No newline at end of file diff --git a/uvote/api/votes/stats_basic.php b/uvote/api/votes/stats_basic.php new file mode 100644 index 0000000..199a03d --- /dev/null +++ b/uvote/api/votes/stats_basic.php @@ -0,0 +1,41 @@ +id); + $vars['user_temp_votes'] = votes::get_user_temp_votes(); + $vars['user_overall_votes'] = votes::get_user_overall_votes(); + $vars['analysis_help_basic_stats'] = \SYSTEM\PAGE\text::get('analysis_help_basic_stats'); + $vars['analysis_math_basic_stats'] = \SYSTEM\PAGE\text::get('analysis_math_basic_stats'); + $vars['analysis_help_basic_votes'] = \SYSTEM\PAGE\text::get('analysis_help_basic_votes'); + $vars['analysis_math_basic_votes'] = \SYSTEM\PAGE\text::get('analysis_math_basic_votes'); + $vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id='; + return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/tab_basic_user.tpl'),$vars); + } + public static function community_basic(){ + $vars['basic_stats_community'] = bars::get_uvote_choice_overall(); + $vars['analysis_help_community'] = \SYSTEM\PAGE\text::get('analysis_help_community'); + $vars['analysis_math_community'] = \SYSTEM\PAGE\text::get('analysis_math_community'); + $vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id='; + return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/tab_basic_community.tpl'),$vars); + } + + public static function bt_basic(){ + $vars['basic_stats_bt'] = bars::get_bt_choice_overall(); + $vars['analysis_help_bt_basic'] = \SYSTEM\PAGE\text::get('analysis_help_bt_basic'); + $vars['analysis_math_bt_basic'] = \SYSTEM\PAGE\text::get('analysis_math_bt_basic'); + $vars['frontend_logos'] = './api.php?call=files&cat=frontend_logos&id='; + return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_analysis/tpl/tab_basic/tab_basic_bt.tpl'),$vars); + } +} diff --git a/uvote/api/votes/switchers.php b/uvote/api/votes/switchers.php index 7036753..f3b5e41 100644 --- a/uvote/api/votes/switchers.php +++ b/uvote/api/votes/switchers.php @@ -3,13 +3,13 @@ class switchers{ public static function get_party_per_poll($choice){ switch($choice){ case 1: - return 'PRO'; + return 'pro'; case 2: - return 'CON'; + return 'con'; case 3: - return 'ENT'; + return 'ent'; default: - return 'NONE'; + return 'none'; } } @@ -25,6 +25,18 @@ class switchers{ return 'open'; } } + public static function tablerow_class_full($choice){ + switch($choice){ + case 1: + return 'pro'; + case 2: + return 'contra'; + case 3: + return 'enthaltung'; + default: + return ''; + } + } public static function badge_class($choice){ switch($choice){ diff --git a/uvote/page/default_page/tpl/menu_loggedout.tpl b/uvote/page/default_page/tpl/menu_loggedout.tpl index 931c533..cf0a204 100644 --- a/uvote/page/default_page/tpl/menu_loggedout.tpl +++ b/uvote/page/default_page/tpl/menu_loggedout.tpl @@ -2,7 +2,7 @@
\ No newline at end of file diff --git a/uvote/page/default_register/js/default_register.js b/uvote/page/default_register/js/default_register.js index 5632870..ca2aa8c 100644 --- a/uvote/page/default_register/js/default_register.js +++ b/uvote/page/default_register/js/default_register.js @@ -1,10 +1,13 @@ function init_default_register(){ register_registerform(); } - -function register_registerform(){ + function register_registerform(){ //console.log("wegwegwegwegwegweg"); - + $("#register_user_form input").not("[type=submit]").jqBootstrapValidation( + { + preventSubmit: true, + submitError: function($form, event, errors) {}, + submitSuccess: function($form, event){ $.get('./api.php?call=account&action=create&username=' + $('#register_username').val() + '&password_sha=' + $.sha1($('#user_register_password1').val()) + '&email=' + $('#register_email').val() + '&locale=deDE', function (data) { if(data == 1){ window.location.reload(); @@ -12,4 +15,8 @@ function register_registerform(){ $('#help-block-user-password-combi-wrong').attr('style', 'display: block;'); } }); + event.preventDefault(); } + }); +} + diff --git a/uvote/page/default_register/tpl/register.tpl b/uvote/page/default_register/tpl/register.tpl index c4df117..177b15a 100644 --- a/uvote/page/default_register/tpl/register.tpl +++ b/uvote/page/default_register/tpl/register.tpl @@ -2,7 +2,7 @@