Skip to content

Commit

Permalink
Fixed issue #11781 : default template save.pstpl load.pstpl completed…
Browse files Browse the repository at this point in the history
….pstpl

Dev: Fixed some row issue (col-sm-X > ls-input-group seems to be the good way)
Dev: preparing basic (base_awesome)
  • Loading branch information
Shnoulle committed Oct 14, 2016
1 parent e66a2d7 commit 4fb88ed
Show file tree
Hide file tree
Showing 20 changed files with 164 additions and 144 deletions.
11 changes: 6 additions & 5 deletions application/core/packages/limesurvey/survey.css
Expand Up @@ -41,6 +41,12 @@
line-height:1;
}
*/
.form-horizontal .control-label.col-sm-12 {
text-align: left;
}
.dir-rtl .form-horizontal .control-label.col-sm-12 {
text-align: right;
}
/** ls-label-xs-visibility : set sr-only by default : template can reinit it with initial */
.ls-label-xs-visibility{
position:absolute;
Expand All @@ -61,11 +67,6 @@
display: table;
position: relative;
}
.ls-input-group[class*="col-"] {
float: none;
padding-left: 0;
padding-right: 0;
}
.ls-input-group .form-control {
float: left;
margin-bottom: 0;
Expand Down
4 changes: 0 additions & 4 deletions application/core/packages/limesurvey/survey.js
Expand Up @@ -65,8 +65,6 @@ function activateLanguageChanger(){
* Action link with submit object (json) : add params to form and submit
*/
function activateActionLink(){
console.log(LSvar);

/* If no limesurvey form : don't need it */
if(!$('form#limesurvey').length){
$('[data-limesurvey-submit]').remove();
Expand Down Expand Up @@ -100,8 +98,6 @@ function activateActionLink(){

/* Ask confirmation on click on .needconfirm*/
function activateConfirmButton(){
console.log(LSvar);

$(document).on('click',"button[data-confirmedby]", function(event){
// @todo : allow multiple here : remove extra
if(!$("[name='"+$(this).data('confirmedby')+"']").is(":checked"))
Expand Down
Expand Up @@ -77,7 +77,7 @@

<td class="answer-item dropdown-item">
<?php if ($ddsuffix != '' || $ddprefix != ''): ?>
<div class="input-group">
<div class="ls-input-group">
<?php endif; ?>
<?php if ($ddprefix != ''): ?>
<div class="ddprefix ls-input-group-extra">
Expand Down Expand Up @@ -134,7 +134,7 @@ class='form-control'
<td class="answer-item dropdown-item">
<!-- We don't need another label : aria-labelledby for accessibility, and we have only 2 line in phone and no-more-table -->
<?php if ($ddprefix != '' || $ddsuffix != ''): ?>
<div class="input-group">
<div class="ls-input-group">
<?php endif; ?>
<?php if ($ddprefix != ''): ?>
<div class="ddprefix ls-input-group-extra">
Expand Down
Expand Up @@ -16,7 +16,7 @@

<!-- answer -->
<div class="<?php echo $coreClass;?> form-group form-inline">
<div class="input-group">
<div class="ls-input-group">
<?php
// rows/*.php
echo $sRows;
Expand Down
Expand Up @@ -28,7 +28,7 @@

<!-- Checkbox + label -->
<div class="col-sm-6 col-xs-12">
<div class="form-group answer-item text-item other-text-item ls-input-group"><!-- input-group from BS seems OK too ->
<div class="form-group answer-item text-item other-text-item ls-input-group"><!-- input-group from BS seems OK too -->
<label for="<?php echo $id;?>" class="label-text control-label ls-input-group-extra" id="label-<?php echo $id;?>" ><?php echo $labeltext;?></label>
<input
class="other-text form-control input-sm multipleco-other-topic <?php echo $classes; echo $kpclass;?>"
Expand Down
Expand Up @@ -32,48 +32,50 @@
<label class='control-label col-xs-12 col-sm-<?php echo $sLabelWidth; ?><?php if($alert):?> errormandatory<?php endif; ?>' for="answer<?php echo$myfname;?>">
<?php echo $labelText; ?>
</label>
<div class="ls-input-group col-xs-12 col-sm-<?php echo $sInputContainerWidth; ?> container-fluid">
<?php if (!empty($sliderleft)): ?>
<div class='col-xs-12 col-sm-2 slider-left text-right'><?php echo $sliderleft;?></div>
<?php endif; ?>
<div class="slider-container col-xs-12 col-sm-<?php echo $sliderWidth ?>">
<input
class="text form-control <?php echo $kpclass;?>"
type="text"
name="<?php echo $myfname;?>"
id="answer<?php echo $myfname; ?>"
value="<?php echo ($dispVal ? $dispVal : null); ?>"
<?php echo $maxlength; ?>
data-slider-value="<?php echo ($dispVal ? $dispVal : null); ?>"
data-slider-min='<?php echo $slider_min;?>'
data-slider-max='<?php echo $slider_max;?>'
data-slider-step='<?php echo $slider_step;?>'
data-slider-orientation='<?php echo $slider_orientation;?>'
data-slider-handle='<?php echo $slider_handle;?>'
data-slider-tooltip='always'
data-slider-reset='<?php echo $slider_reset; ?>'
data-slider-prefix='<?php echo $prefix; ?>'
data-slider-suffix='<?php echo $suffix; ?>'
data-separator='<?php echo $sSeparator;?>'
data-number='true',
data-integer='<?php echo $integeronly;?>',
/>
<?php if($slider_showminmax): ?>
<div class='pull-left help-block'><?php echo $slider_min; ?></div>
<div class='pull-right help-block'><?php echo $slider_max; ?></div>
<?php endif; ?>
<div class="col-xs-12 col-sm-<?php echo $sInputContainerWidth; ?> container-fluid">
<div class="ls-input-group">
<?php if (!empty($sliderleft)): ?>
<div class='col-xs-12 col-sm-2 slider-left text-right'><?php echo $sliderleft;?></div>
<?php endif; ?>
<div class="slider-container col-xs-12 col-sm-<?php echo $sliderWidth ?>">
<input
class="text form-control <?php echo $kpclass;?>"
type="text"
name="<?php echo $myfname;?>"
id="answer<?php echo $myfname; ?>"
value="<?php echo ($dispVal ? $dispVal : null); ?>"
<?php echo $maxlength; ?>
data-slider-value="<?php echo ($dispVal ? $dispVal : null); ?>"
data-slider-min='<?php echo $slider_min;?>'
data-slider-max='<?php echo $slider_max;?>'
data-slider-step='<?php echo $slider_step;?>'
data-slider-orientation='<?php echo $slider_orientation;?>'
data-slider-handle='<?php echo $slider_handle;?>'
data-slider-tooltip='always'
data-slider-reset='<?php echo $slider_reset; ?>'
data-slider-prefix='<?php echo $prefix; ?>'
data-slider-suffix='<?php echo $suffix; ?>'
data-separator='<?php echo $sSeparator;?>'
data-number='true',
data-integer='<?php echo $integeronly;?>',
/>
<?php if($slider_showminmax): ?>
<div class='pull-left help-block'><?php echo $slider_min; ?></div>
<div class='pull-right help-block'><?php echo $slider_max; ?></div>
<?php endif; ?>
</div>
<?php if (!empty($sliderright)): ?>
<div class='col-xs-12 col-sm-2 slider-right text-left'><?php echo $sliderright;?></div>
<?php endif; ?>
<?php if ($slider_reset): ?>
<div class="ls-input-group-extra">
<div id="answer<?php echo $myfname; ?>_resetslider" class='btn btn-default btn-sm btn-slider-reset'>
<span class='fa fa-times slider-reset-icon' aria-hidden='true'></span><span class="slider-reset-text">&nbsp;<?php eT("Reset"); ?></span>
</div>
</div>
<?php endif; ?>
<input type="hidden" name="slider_user_no_action_<?php echo $myfname; ?>" id="slider_user_no_action_<?php echo $myfname; ?>" value="<?php echo ($dispVal ? 0 : 1);?>" />
</div>
<?php if (!empty($sliderright)): ?>
<div class='col-xs-12 col-sm-2 slider-right text-left'><?php echo $sliderright;?></div>
<?php endif; ?>
<?php if ($slider_reset): ?>
<div class="ls-input-group-extra">
<div id="answer<?php echo $myfname; ?>_resetslider" class='btn btn-default btn-sm btn-slider-reset'>
<span class='fa fa-times slider-reset-icon' aria-hidden='true'></span><span class="slider-reset-text">&nbsp;<?php eT("Reset"); ?></span>
</div>
</div>
<?php endif; ?>
<input type="hidden" name="slider_user_no_action_<?php echo $myfname; ?>" id="slider_user_no_action_<?php echo $myfname; ?>" value="<?php echo ($dispVal ? 0 : 1);?>" />
</div>
</li>
<!-- end of answer_row -->
27 changes: 27 additions & 0 deletions application/views/survey/system/actionButton/clearAll.php
@@ -0,0 +1,27 @@
<?php
/**
* Move next button
*
* @var $value
* @var $class
*/
?>
<!-- views/survey/system/actionButton/moveNext -->
<?php
echo CHtml::openTag("div",array("class"=>"form-inline"));
echo CHtml::htmlButton(gT("Exit and clear survey"),array(
'type'=>'submit',
'id'=>false,
'value'=>$value,
'name'=>$name,
'class'=>"$class btn btn-default",
'data-confirmedby'=>$confirmedby,
'title'=>gT("This action need confirmation.")
));
echo CHtml::openTag("label",array("class"=>"form-group ls-js-hidden checkbox-item"));
echo CHtml::checkBox($confirmedby,false,array('value'=>$confirmvalue,'class'=>'checkbox-item'));
echo gT("Are you sure you want to clear all your responses?");
echo CHtml::closeTag("label");
echo CHtml::closeTag("div");
?>
<!-- end of views/survey/system/actionButton/moveNext -->
14 changes: 14 additions & 0 deletions application/views/survey/system/actionLink/clearAll.php
@@ -0,0 +1,14 @@
<?php
/**
* Save all link
*
* @var $submit
* @var $class
*/
?>
<li class="ls-no-js-hidden">
<a href="#" data-limesurvey-submit='<?php echo $submit ?>' data-confirmedby='<?php echo $confirm ?>' data-confirmlabel='<?php echo gT("Are you sure you want to clear all your responses?") ?>' class='<?php echo $class ?>'>
<?php echo gT("Exit and clear survey") ?>
</a>

</li>
2 changes: 1 addition & 1 deletion application/views/survey/system/saveForm/anonymized.php
Expand Up @@ -4,4 +4,4 @@
* @todo : find a good class
*/
?>
<p class=''><?php echo gT("To remain anonymous please use a pseudonym as your username, also an email address is not required.") ?></p>
<p><?php echo gT("To remain anonymous please use a pseudonym as your username, also an email address is not required.") ?></p>
4 changes: 2 additions & 2 deletions templates/base_awesome/css/template-core.css
Expand Up @@ -25,12 +25,12 @@ table.ls-answers{width:100%}
.ls-answers tbody td
{text-align:center}
.ls-answers tbody th
{text-align:right;vertical-align:middle}
{vertical-align:middle}
.ls-answers thead th
{text-align:center;vertical-align:bottom}

.ls-answers tbody .answertext{text-align:right}
.ls-answers .answertextright{text-align:left}
.dir-rtl .ls-answers .answertextright{text-align:right}

/**
* awesome-bootstrap-checkbox inside table with an sr-only label
Expand Down
24 changes: 16 additions & 8 deletions templates/base_awesome/css/template.css
Expand Up @@ -2,7 +2,7 @@
* Style for the template
*
*/
.container-fluid{max-width: 1170px;}
.container-fluid{max-width: 80em;}

/* Sticky footer styles
* see http://getbootstrap.com/examples/sticky-footer/
Expand All @@ -11,18 +11,26 @@ html {
position: relative;
min-height: 100%;
}
/* For testing purpose : better view of HTML answers part */
/* Some no boostrap class */
.ls-language-changer-item{text-align:right}
.dir-rtl .ls-language-changer-item{text-align:left}
.answers-wrapper {
margin: 0;
padding: 0 15px;
border:1px dotted red;
padding: 0.5em 15px;
border:1px dotted #ccc;
background:#fff;
border-radius:4px;
}
/**
* For the question label (number/code and mandatory)
* If user add p or div : one line more
*/
.question-number,.question-code
{float:left;margin-right:0.2em}
.question-number,.question-code{float:left;margin-right:0.2em}

label{font-weight:normal}
.question-text{font-size: 1.7em;}/* Need some color */
/**
* Some specific
*/
.boilerplate .answers-wrapper,
.equation .answers-wrapper{
display:none;
}
6 changes: 3 additions & 3 deletions templates/base_awesome/pstpl/completed.pstpl
@@ -1,4 +1,4 @@
<div id="completed">
<div>{COMPLETED}</div>
{if(!is_empty(URL),"<div class='url url-end'>"+URL+"</div>","")}
<div class="completed-wrapper">
<div class='completed-text'>{COMPLETED}</div>
<div class='end-url'>"+{URL}+"</div>
</div>
14 changes: 4 additions & 10 deletions templates/base_awesome/pstpl/endpage.pstpl
@@ -1,16 +1,10 @@

</div><!--end #main-->
<div id="navigation" class="aside">
<!-- Place for some navigation -->
</div>
<div id="extra" class="aside">
<!-- Place for some extra -->
</div>
</div><!--end #content -->
<!-- Here it a place for a footer -->
<!--
<div id="footer" class="footer">
<div class="container">
<p class="text-muted">A place for user manager text and link (legal notice / website link : must be removed when releasing.</p>
<p class="text-muted">Put your content here</p>
</div>
<!-- -->
</div>
-->
</div><!-- end container-->
2 changes: 1 addition & 1 deletion templates/base_awesome/pstpl/navigator.pstpl
@@ -1,4 +1,4 @@
<p class="navigator row">{NAVIGATOR}</p>
<div class="navigator text-center">{NAVIGATOR}</div>
<!-- Review this par : using div ? -->
{if(!is_empty(SAVE) or !is_empty(CLEARALL),"<ul class='list-unstyled list-inline save-clear'>","")}
{if(!is_empty(SAVE),"<li>"+SAVE+"</li>","")}
Expand Down
6 changes: 3 additions & 3 deletions templates/base_awesome/pstpl/question.pstpl
@@ -1,15 +1,15 @@
<div {QUESTION_ESSENTIALS} class="question-wrapper {QUESTION_CLASS} {QUESTION_MAN_CLASS} {QUESTION_INPUT_ERROR_CLASS}">
<div {QUESTION_ESSENTIALS} class="well question-wrapper {QUESTION_CLASS} {QUESTION_MAN_CLASS} {QUESTION_INPUT_ERROR_CLASS}">
<div class="question-text-wrapper">
{QUESTION_MANDATORY}
{if(!is_empty(QUESTION_NUMBER),"<span class='label label-default question-number'>"+QUESTION_NUMBER+"</span>","")}
{if(!is_empty(QUESTION_CODE),"<span class='label label-info question-code'>"+QUESTION_CODE+"</span>","")}
<div class="question-text">{QUESTION_TEXT}</div>
<div class="question-text h3 text-info">{QUESTION_TEXT}</div>
</div>
<div class="help-wrapper">
{QUESTION_MAN_MESSAGE}
{QUESTION_VALID_MESSAGE}
{QUESTION_FILE_VALID_MESSAGE} <!-- unsure still used -->
{if(!is_empty(trim(strip_tags(QUESTION_HELP))),"<div class='help'>"+QUESTION_HELP+"</div>","")}<!-- in 2.06 : come from qanda_helper -->
{if(!is_empty(trim(strip_tags(QUESTION_HELP))),"<div class='help'>"+QUESTION_HELP+"</div>","")}
</div>
<div class="answers-wrapper clearfix">{ANSWER}</div>
{if(!is_empty(QUESTIONHELP),"<div class='question-help clearfix'>"+QUESTIONHELP+"</div>","")}
Expand Down
3 changes: 1 addition & 2 deletions templates/base_awesome/pstpl/save.pstpl
Expand Up @@ -4,9 +4,8 @@
<div class="well">
{SAVEMESSAGE}
{SAVEERROR}
{if(SAVEALERT,"<strong class='text-warning'>"+SAVEALERT+"</strong>","")}
<div class="text-success">{SAVEALERT}</div>
<div class="form-save">{SAVEFORM}</div>

<div class='url-wrapper url-return-wrapper'>{RETURNTOSURVEY}</div>
</div>
</div>
18 changes: 4 additions & 14 deletions templates/default/views/completed.pstpl
@@ -1,14 +1,4 @@
<br />
<table class="completed-table">
<tr>
<td class="completed-text">
<br />
{COMPLETED}
<br />
<br />
{URL}
<br /><br />
</td>
</tr>
</table>
<br />
<div class="completed-wrapper">
<div class='completed-text'>{COMPLETED}</div>
<div class='end-url'>"+{URL}+"</div>
</div>
31 changes: 12 additions & 19 deletions templates/default/views/load.pstpl
@@ -1,19 +1,12 @@
<table id="loadtable">
<tr>
<td class="load-heading">
<h3>{LOADHEADING}</h3>
</td>
</tr>
<tr>
<td align="center">
<br />
<p class="load-error">{LOADERROR}</p>
<p class="load-message">{LOADMESSAGE}</p>
<br />
<div class="load-form">{LOADFORM}</div>
<br />
<span class="return-to-survey">{RETURNTOSURVEY}</span>
<br /><br />
</td>
</tr>
</table>
<div class="well clearfix load-message">
<div class="h2">{LOADHEADING}</div>
<div class="text-info">
{LOADMESSAGE}
</div>
</div>

<div class="load-form">
{LOADERROR}
{LOADFORM}
<div class='return-to-survey'>{RETURNTOSURVEY}</div>
</div>

0 comments on commit 4fb88ed

Please sign in to comment.