Skip to content

Commit

Permalink
Dev: default template enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 28, 2016
1 parent ad574e3 commit fa81749
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 38 deletions.
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1256,7 +1256,7 @@ function run($surveyid,$args)
{
echo " style='display: none;'";
}
echo " class='col-xs-12'>\n";
echo " class='row'>\n";
echo templatereplace(file_get_contents($sTemplateViewPath."startgroup.pstpl"), array(), $redata);
echo "\n";

Expand Down
2 changes: 1 addition & 1 deletion application/helpers/qanda_helper.php
Expand Up @@ -3858,7 +3858,7 @@ function do_yesno($ia)
'name'=>$ia[1],
'yChecked' => $yChecked,
'nChecked' => $nChecked,
'naChecked'=> $naChecke,
'naChecked'=> $naChecked,
'noAnswer' => $noAnswer,
'checkconditionFunction'=>$checkconditionFunction.'(this.value, this.name, this.type)',
'value' => $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]],
Expand Down
Expand Up @@ -5,6 +5,5 @@
* @var $value $anscount;
*/
?>
OKOKOKOK
<input type='hidden' name='<?php echo $name; ?>' value='<?php echo $value;?>' />
<ul class="list-unstyled subquestions-list questions-list checkbox-text-list">
Expand Up @@ -17,19 +17,19 @@
*/
?>
<!--item_inputtext -->
<li class="question-item answer-item text-item <?php echo $extraclass;?>" <?php echo $sDisplayStyle;?> >
<div class="question-item answer-item text-item <?php echo $extraclass;?>" <?php echo $sDisplayStyle;?> >
<?php if($alert):?>
<!-- color code missing mandatory questions red -->
<div class="alert alert-danger errormandatory" role="alert">'.
<div class="alert alert-danger errormandatory" role="alert">
<?php echo $question; ?>
</div>
<?php endif;?>

<div class="form-group-row row">';
<div class="form-group-row row">
<label class='control-label col-xs-12' for="answer<?php echo$myfname;?>">
<?php echo $question; ?>
</label>
<div class="col-xs-12">';
<div class="col-xs-12">
<?php echo $prefix; ?>
<input
class="text <?php echo $kpclass; ?> form-control"
Expand All @@ -43,4 +43,4 @@ class="text <?php echo $kpclass; ?> form-control"
/>
<?php echo $suffix; ?>
</div>
</li>
</div>
8 changes: 4 additions & 4 deletions application/views/survey/system/questionhelp/tips.php
@@ -1,12 +1,12 @@
<?php
/**
* Question tips. For now, called from em_manager_helper::_ValidateQuestion
* @var $qid
* @var $vclass
* @var $vtip
* @var $qid
* @var $vclass
* @var $vtip
*/
?>
<div id='vmsg_<?php echo $qid; ?>_<?php echo $vclass; ?>' class='em_<?php echo $vclass; ?> emtip text-info'>
<div id='vmsg_<?php echo $qid; ?>_<?php echo $vclass; ?>' class='em_<?php echo $vclass; ?> emtip '>
<span class='glyphicon glyphicon-info-sign'></span>
&nbsp;<?php echo $vtip; ?>
</div>
5 changes: 2 additions & 3 deletions templates/default/css/print_template.css
Expand Up @@ -63,7 +63,7 @@ div.boilerplate,div.choice-5-pt-radio,div.date,div.list-radio-flexible,div.list-
}

.other {

}

.question ul,.question ul li {
Expand Down Expand Up @@ -214,7 +214,6 @@ div.array-multi-flexi .q-answer table tbody td div.input-text {
.array-flexible-duel-scale {}
*/
.array-flexible-column col.odd,.array-flexible-column th.odd {
background-color: #0c1c2b;
padding: 0% 0.3em;
}

Expand Down Expand Up @@ -243,4 +242,4 @@ div.input-rank {

div.input-other {
width: 155px !important;
}
}
46 changes: 46 additions & 0 deletions templates/default/css/template.css
@@ -1,7 +1,53 @@
body {
padding-top: 50px;
padding-bottom: 10px;
background-color: #F1F1F1;
}

div[id^="group-"]>div {
background-color: #fff;
border: none;
}

.language-changer {
background-color: #fff;
padding: 1em;
}

#topContainer {
position: absolute;
top: 60px;
width: 100%;
padding: 1em;
background-color: #A5B2BF;
border-bottom: none;
}

.progress {
height: 21px;
margin-bottom: 0px;
}

#surveynametitle {
font-size: 4em;
}

#surveydescription, #surveynametitle {
color: #2c3e50;
text-align: center;
}

.group-name {

}

#surveydescription, .group-name {
color: #2c3e50;
}

#main-row, #welcome-container {
background-color: transparent;
}
/**
* Navigator
*/
Expand Down
35 changes: 33 additions & 2 deletions templates/default/scripts/template.js
Expand Up @@ -25,7 +25,7 @@
function focusFirst(Event)
{

$('#limesurvey :input:visible:enabled:first').focus();
$('#limesurvey :input:visible:enabled:first').focus();

}
/*
Expand All @@ -37,7 +37,7 @@ function focusFirst(Event)
/* Uncomment below if you want to use the focusFirst function */
/*
$(document).ready(function(){
focusFirst();
focusFirst();
});
*/

Expand Down Expand Up @@ -75,6 +75,37 @@ function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.

$(document).ready(function(){

var outerframeDistanceFromTop = 50;
// Manage top container
if(!$.trim($('#topContainer .container').html()))
{
$('#topContainer').hide();
}
else
{
$topContainerHeight = $('#topContainer').height();
outerframeDistanceFromTop += $topContainerHeight;
}

if(!$.trim($('#surveynametitle').html()))
{
if(!$.trim($('#surveydescription').html()))
{
$('#survey-header').hide();
}
}

$('#outerframeContainer').css({marginTop:outerframeDistanceFromTop+'px'});

$('.questionhelp').each(function(){
$that = $(this);
if(!$.trim($that.html()))
{
$that.hide();
}
});


// Load survey button
if ($('#loadallbtnlink').length > 0){
$('#loadallbtnlink').on('click', function()
Expand Down
6 changes: 2 additions & 4 deletions templates/default/views/startgroup.pstpl
@@ -1,6 +1,4 @@
<!-- Start group -->
<div class="row" id="welcome-container">
<div class="col-sm-12 ">
<h3 class="group-name">{GROUPNAME}</h3>
</div>
<div class="col-xs-12" id="welcome-container">
<h3 class="group-name">{GROUPNAME}</h3>
</div>
11 changes: 10 additions & 1 deletion templates/default/views/startpage.pstpl
Expand Up @@ -37,7 +37,16 @@
</div>
</nav>

<div class="outerframe container">

<!-- Top container -->
<div id="topContainer">
<div class="container">
{PERCENTCOMPLETE}
{LANGUAGECHANGER}
</div>
</div>

<div class="outerframe container" id="outerframeContainer">
<div class="row" id="main-row">
<div class="col-sm-12 col-centered" id="main-col">
<!-- end of startpage.pstl -->
18 changes: 2 additions & 16 deletions templates/default/views/survey.pstpl
Expand Up @@ -2,21 +2,7 @@
<div class="row" id="survey-header">
<div class="col-sm-12 ">
{CHECKJAVASCRIPT}
<h2>{SURVEYNAME}</h2><br />
<p>{SURVEYDESCRIPTION}</p>
</div>
</div>

<!-- Graph -->
<div class="row" id="survey-graph">
<div class="col-sm-12 ">
{PERCENTCOMPLETE}
</div>
</div>

<!-- Language Changer -->
<div class="row language-changer">
<div class="col-sm-12 ">
{LANGUAGECHANGER}
<h2 id="surveynametitle">{SURVEYNAME}</h2><br />
<p id="surveydescription">{SURVEYDESCRIPTION}</p>
</div>
</div>

0 comments on commit fa81749

Please sign in to comment.