fix buttons

This commit is contained in:
Felix Förtsch
2017-08-11 17:33:33 +02:00
parent 5e65b644fd
commit 1890a11391
2 changed files with 198 additions and 194 deletions
+5 -1
View File
@@ -11,7 +11,7 @@ body {
}
#thesesbox{
min-height: 250px;
min-height: 150px;
}
.button-wrapper .btn {
margin-bottom: 10px;
@@ -38,3 +38,7 @@ body {
background-color: #ff4136;
border-color: #00CC66;
}
.m-t-5 {
margin-top: 5px;
}
+70 -70
View File
@@ -4,45 +4,45 @@ include 'includes/elements.php';
//include 'includes/theses.php';
$data_content = file_get_contents("config/data.json");
if(!$data_content){
echo "ERROR READING CONFIG";
echo "ERROR READING CONFIG";
} else {
$data = json_decode($data_content, true);
if($data == NULL){
echo "ERROR PARSING CONFIG";
}
$data = json_decode($data_content, true);
if($data == NULL){
echo "ERROR PARSING CONFIG";
}
//$theses = get_theses_array();
$theses = $data['theses'];
$theses_count = sizeof($theses);
$ans = Array();
$emph = Array();
$answerstring = '';
$warning = false;
$count = 'undefined';
if(isset($_POST['count'])){
$count = $_POST['count'];
}
if(isset($_POST['ans'])){
$answerstring = $_POST['ans'];
$retval = result_from_string($answerstring, $theses_count);
$ans = $retval[0];
$emph = $retval[1];
} elseif(isset($_GET['ans'])){
$answerstring = $_GET['ans'];
$retval = result_from_string($answerstring, $theses_count);
$ans = $retval[0];
$emph = $retval[1];
} else {
$warning = true;
for($i = 0; $i < $theses_count; $i++){
$ans[$i] = 'skip';
$emph[$i] = 1;
}
}
$theses = $data['theses'];
$theses_count = sizeof($theses);
$ans = Array();
$emph = Array();
$answerstring = '';
$warning = false;
$count = 'undefined';
if(isset($_POST['count'])){
$count = $_POST['count'];
}
if(isset($_POST['ans'])){
$answerstring = $_POST['ans'];
$retval = result_from_string($answerstring, $theses_count);
$ans = $retval[0];
$emph = $retval[1];
} elseif(isset($_GET['ans'])){
$answerstring = $_GET['ans'];
$retval = result_from_string($answerstring, $theses_count);
$ans = $retval[0];
$emph = $retval[1];
} else {
$warning = true;
for($i = 0; $i < $theses_count; $i++){
$ans[$i] = 'skip';
$emph[$i] = 1;
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<head>
<title>EUromat - Der Bundestagswahl-Helfer zum Thema Europa</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@@ -50,8 +50,8 @@ $emph[$i] = 1;
<link href="css/jef.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
</head>
<body>
<script src="js/jquery-2.0.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/mahlowat.js"></script>
@@ -83,37 +83,37 @@ $emph[$i] = 1;
</div>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1">
<p class='text-center'>
<button id="weight" type="button" class="btn btn-default" data-toggle="button">These doppelt gewichten</button>
</p>
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 m-t-5">
<button id="weight" type="button" class="btn btn-default btn-block" data-toggle="button">These doppelt gewichten</button>
</div>
</div>
<div class="row">
<div class="col-md-10 col-md-offset-1 button-wrapper">
<div class="col-xs-6 col-sm-3">
<button id='no' type='submit' class='btn btn-danger btn-block' name='no' onclick="nextThesis('c')">
<i class="fa fa-thumbs-down fa-lg"></i> Ablehnung
</button>
</div>
<div class="col-xs-6 col-sm-3">
<button id='neutral' type='submit' class='btn btn-warning btn-block' name='neutral' onclick="nextThesis('b')">
<i class="fa fa-asterisk fa-lg"></i> Neutral
</button>
</div>
<div class="col-xs-6 col-sm-3">
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 m-t-5">
<button id='yes' type='submit' class='btn btn-success btn-block' name='yes' onclick="nextThesis('a')">
<i class="fa fa-thumbs-up fa-lg"></i> Zustimmung
</button>
</div>
<div class="col-xs-6 col-sm-3">
<button id='skip' type='submit' class='btn btn-default btn-block' name='skip' onclick="nextThesis('d')">
Überspringen <i class="fa fa-step-forward fa-lg"></i></button>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 m-t-5">
<button id='neutral' type='submit' class='btn btn-warning btn-block' name='neutral' onclick="nextThesis('b')">
<i class="fa fa-asterisk fa-lg"></i> Neutral
</button>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 m-t-5">
<button id='no' type='submit' class='btn btn-danger btn-block' name='no' onclick="nextThesis('c')">
<i class="fa fa-thumbs-down fa-lg"></i> Ablehnung
</button>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1 m-t-5">
<button id='skip' type='submit' class='btn btn-default btn-block' name='skip' onclick="nextThesis('d')">
Überspringen <i class="fa fa-step-forward fa-lg"></i>
</button>
</div>
</div>
@@ -158,7 +158,7 @@ $emph[$i] = 1;
} else {
loadThesis(activeThesis+1);
}
});
});
function gotoResultPage(result){
count = '<?php echo $count; ?>';
if(count != 'true' && count != 'false'){
@@ -199,8 +199,8 @@ $emph[$i] = 1;
// call result page
gotoResultPage(resultArray);
}
}
function loadThesis(number){
}
function loadThesis(number){
if(number > thesesboxes.length){
number = 1;
}
@@ -211,8 +211,8 @@ $emph[$i] = 1;
thesesboxes.eq(number-1).show();
pagination.eq(number-1).addClass('active');
location.hash = number;
}
function letter2paginationclass(letter){
}
function letter2paginationclass(letter){
switch(letter){
case 'a':
case 'e':
@@ -231,8 +231,8 @@ $emph[$i] = 1;
return '';
break;
}
}
function setClasses(code){
}
function setClasses(code){
$('.explic').hide();
if(code < 'e'){
$('#weight').removeClass('btn-info');
@@ -271,12 +271,12 @@ $emph[$i] = 1;
$('#no').addClass('btn-danger');
break;
}
}
function setPaginationColors(array){
}
function setPaginationColors(array){
for(i = 0; i < array.length; i++){
pagination.eq(i).addClass(letter2paginationclass(array[i]));
}
}
</script>
</body>
}
</script>
</body>
</html>