Skip to content

Commit

Permalink
Fixed issue #3286: Public statistics page being an ugly doll - pretty…
Browse files Browse the repository at this point in the history
… patch kindly provided by jsw_nz

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@7060 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jun 10, 2009
1 parent 7620b56 commit ccdb0fd
Show file tree
Hide file tree
Showing 10 changed files with 2,291 additions and 848 deletions.
55 changes: 36 additions & 19 deletions statistics_user.php
@@ -1,3 +1,4 @@

<?php
/*
* LimeSurvey
Expand Down Expand Up @@ -72,6 +73,10 @@
else
{
$surveyinfo=getSurveyInfo($surveyid);
// CHANGE JSW_NZ - let's get the survey title for display
$thisSurveyTitle = $surveyinfo["name"];
// CHANGE JSW_NZ - let's get css from individual template.css - so define path
$thisSurveyCssPath = $surveyinfo["template"];
if ($surveyinfo['publicstatistics']!='Y')
{
safe_die('The public statistics for this survey are deactivated.');
Expand Down Expand Up @@ -154,6 +159,7 @@
}
$header.= ">\n\t<head>\n"
. "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />"
. "<link href=\"templates/".$thisSurveyCssPath."/template.css\" rel=\"stylesheet\" type=\"text/css\" />"
. "</head><body>";

echo $header;
Expand Down Expand Up @@ -643,13 +649,15 @@
}

//show some main data at the beginnung
$statisticsoutput .= "<br />\n<table align='center' width='95%' border='1' "
."cellpadding='2' cellspacing='0' >\n"
."\t<tr><td colspan='2' align='center'><strong>"
.$clang->gT("Total records in survey").": $totalrecords</strong></td></tr>\n";
// CHANGE JSW_NZ - let's allow html formatted questions to show
$statisticsoutput .= "\n<div id='statsContainer'><div id='statsHeader' \n"
."\t<div class='statsSurveyTitle'>"
."$thisSurveyTitle</div>\n"
."\t<div class='statsNumRecords'>"
.$clang->gT("Total records in survey")." : $totalrecords</div>\n";

//close table
$statisticsoutput .= "</table><br />\n";
$statisticsoutput .= "</div>\n";


//push progress bar from 35 to 40
Expand Down Expand Up @@ -705,7 +713,9 @@
{
$qtitle=$nrow[0];
$qtype=$nrow[1];
$qquestion=FlattenText($nrow[2]);
// CHANGE JSW_NZ - allow html formatted questions to show
//$qquestion=FlattenText($nrow[2]);
$qquestion=$nrow[2];
$qlid=$nrow[3];
$qother=$nrow[4];
}
Expand Down Expand Up @@ -816,7 +826,9 @@
{
$qtitle=FlattenText($nrow[0]); //clean up title
$qtype=$nrow[1];
$qquestion=FlattenText($nrow[2]); //clean up question
// CHANGE JSW_NZ - allow html formatted questions to show
//$qquestion=FlattenText($nrow[2]);
$qquestion=$nrow[2];
$qiqid=$nrow[3];
$qlid=$nrow[4];
}
Expand All @@ -838,10 +850,13 @@
}

//outputting headline
$statisticsoutput .= "\n<table align='center' width='95%' border='1' cellpadding='2' cellspacing='0' >\n"
."\t<tr><td colspan='2' align='center'><strong>".$clang->gT("Field summary for")." $qtitle:</strong>"
$statisticsoutput .= "\n<table class='statisticstable'>\n"
."\t<tr><td colspan='2' align='center'><div class='fieldSummary'>"
//headline
.$clang->gT("Field summary for")." $qtitle:</div>"
."</td></tr>\n"
."\t<tr><td colspan='2' align='center'><strong>$qquestion</strong></td></tr>\n"
."\t<tr><td colspan='2' align='center'><div class='questionTitle'>"
."$qquestion</div></td></tr>\n"
."\t<tr>\n\t\t<td width='50%' align='center' ><strong>"
.$clang->gT("Calculation")."</strong></td>\n"
."\t\t<td width='50%' align='center' ><strong>"
Expand Down Expand Up @@ -1101,12 +1116,12 @@

//footer of question type "N"
$statisticsoutput .= "\t<tr>\n"
."\t\t<td colspan='4' align='center' bgcolor='#EEEEEE'>\n"
."\t\t<td colspan='4' align='center' bgcolor='#FFFFFF'>\n"
."\t\t\t<font size='1'>".$clang->gT("Null values are ignored in calculations")."<br />\n"
."\t\t\t".sprintf($clang->gT("Q1 and Q3 calculated using %s"), "<a href='http://mathforum.org/library/drmath/view/60969.html' target='_blank'>".$clang->gT("minitab method")."</a>")
."</font>\n"
."\t\t</td>\n"
."\t</tr>\n</table>\n";
."\t</tr>\n<tr style='height:30px; border-bottom: 0px solid #FFF'><td colspan='4'></td></tr></table>\n";

//clean up
unset($showem);
Expand Down Expand Up @@ -1160,7 +1175,9 @@
{
$qtitle=FlattenText($nrow[0]);
$qtype=$nrow[1];
$qquestion=FlattenText($nrow[2]);
// CHANGE JSW_NZ - let's allow html formatted questions to show
//$qquestion=FlattenText($nrow[2]);
$qquestion=$nrow[2];
$qiqid=$nrow[3];
$qlid=$nrow[4];
$qlid1=$nrow[5];
Expand Down Expand Up @@ -1490,16 +1507,16 @@
if (isset($alist) && $alist) //Make sure there really is an answerlist, and if so:
{
//output
$statisticsoutput .= "<table width='95%' align='center' border='1' cellpadding='2' cellspacing='0' class='statisticstable'>\n"
."\t<tr><td colspan='4' align='center'><strong>"
$statisticsoutput .= "<table class='statisticstable'>\n"
."\t<tr><td colspan='4' align='center'><div class='fieldSummary'>"

//headline
.$clang->gT("Field summary for")." $qtitle:</strong>"
.$clang->gT("Field summary for")." $qtitle:</div>"
."</td></tr>\n"
."\t<tr><td colspan='4' align='center'><strong>"
."\t<tr><td colspan='4' align='center'><div class='questionTitle'>"

//question title
."$qquestion</strong></td></tr>\n"
."$qquestion</div></td></tr>\n"
."\t<tr>\n\t\t<td width='50%' align='center' >";

// this will count the answers considered completed
Expand Down Expand Up @@ -2341,7 +2358,7 @@
}

//close table/output
$statisticsoutput .= "</table><br /> \n";
$statisticsoutput .= "</table><div><br /> \n";

} //end if -> collect and display results

Expand Down
73 changes: 73 additions & 0 deletions templates/basic/template.css
Expand Up @@ -5,6 +5,8 @@ line-height:17px;
background-color:#999;
}



table.question {
border:1px;
border-color:#aaa;
Expand Down Expand Up @@ -599,3 +601,74 @@ div#wrapper{
margin-top:1em;
margin-bottom:1em;
}

#statsContainer {
width:80%;
margin:0 auto;
background-color:#FFFFFF;
padding: 0px;
min-width: 690px
}

#statsHeader{
color:#000000;
text-align:center;
padding: 10px 0px;
height:72px;
background-image: url(Logo-LimeSurvey.png);
background-repeat: no-repeat;
background-position: 35px 18px;

}

.statsSurveyTitle {
text-align:center;
font-size:1.0em;
font-weight:bold;
padding: 25px 0px 0px 0px;
float:right;
width:65%;
text-align:left;
}

.statsNumRecords {
font-size:.9em;
float:right;
width:65%;
text-align:left;
}

table.statisticstable{
width: 90%;
border: 0px solid;
text-align:left;
background-color:#fff;
margin:0px auto;
padding-bottom: 8px;

}

table.statisticstable td{
padding-top: 4px;
padding-bottom: 4px;
border-bottom: 1px solid #CCC;
}



table.statisticstable img{
margin:10px auto;
}

div.fieldSummary{
font-size:.9em;
padding: 10px 10px 4px 0px;
display: block;
text-align:left;
}
div.questionTitle{
font-size:1.0em;
padding: 20px 20px 20px 20px;
font-weight: normal;
background-color:#efefef;
}
72 changes: 71 additions & 1 deletion templates/bluengrey/template.css
Expand Up @@ -117,6 +117,8 @@ div.questiontext {
padding: 0% 0% 0.5em 0%;
}



#welcometext {
width: 50%;
margin:0 auto;
Expand All @@ -138,10 +140,12 @@ div.questiontext {
border-top:5px solid #E9E9E9 ;
}



#welcome p
{
font-size:0.8em;
margin:10px auto;
margin:6px auto;
}


Expand Down Expand Up @@ -935,3 +939,69 @@ div#wrapper{
margin-top:1em;
margin-bottom:1em;
}

#statsContainer {
width:720px;
margin:8px auto;
border: 1px solid #2f5376;
background-color:#E9E9E9;
padding: 0% 0% 0.5em 0%;
}

#statsHeader{
background-color:#2F5376;
color:#fff;
text-align:center;
padding: 10px 0px;
height:96px;
}

.statsSurveyTitle {
text-align:center;
font-size:1.66em;
padding: 15px 0px 10px 0px;
}

.statsNumRecords {
text-align:center;
font-size:1em;
}

table.statisticstable{
width: 690px;
border: 0px solid;
text-align:left;
background-color:#fff;
margin:0px auto;
padding-bottom: 8px;

}

table.statisticstable td{
padding-top: 4px;
padding-bottom: 4px;
border-bottom: 1px solid #CCC;
}

table.statisticstable strong{
font-weight: bold;
}

table.statisticstable img{
margin:3px auto;
}

div.fieldSummary{
font-size:.9em;
padding: 10px 10px 0px 10px;
display: block;
}
div.questionTitle{
font-size:1.2em;
padding: 20px 20px 20px 20px;
font-weight: bold;
}

td.statsImageholder {
background-color:#fff;
}
73 changes: 73 additions & 0 deletions templates/business_grey/template.css
Expand Up @@ -701,3 +701,76 @@ div#wrapper{
margin-top:1em;
margin-bottom:1em;
}

#statsContainer {
width:80%;
margin:0 auto;
background-color:#e1e1e1;
padding: 0px;
min-width: 690px;
}

#statsHeader{
color:#000000;
text-align:center;
padding: 10px 0px;
height:72px;
background-image: url(Logo-LimeSurvey.png);
background-repeat: no-repeat;
background-position: 35px 18px;

}

.statsSurveyTitle {
text-align:center;
font-size:1.5em;
font-weight:bold;
padding: 25px 0px 0px 0px;
width:90%;
text-align:left;
margin: 0px auto;
color: #666666;
}

.statsNumRecords {
font-size:.9em;
width:90%;
text-align:left;
margin: 0px auto;
color: #666666;
}

table.statisticstable{
width: 90%;
border: 0px solid;
text-align:left;
background-color:#eeeeee;
margin:0px auto;
padding-bottom: 8px;

}

table.statisticstable td{
padding-top: 4px;
padding-bottom: 4px;
border-bottom: 1px solid #CCC;
}



table.statisticstable img{
margin:10px auto;
}

div.fieldSummary{
font-size:.9em;
padding: 10px 10px 4px 4px;
display: block;
text-align:left;
}
div.questionTitle{
font-size:1.0em;
padding: 20px 20px 20px 20px;
font-weight: normal;
background-color:#efefef;
}

0 comments on commit ccdb0fd

Please sign in to comment.