Skip to content

Commit

Permalink
Dev: review core class : add type-array (radio-array for example)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Oct 18, 2016
1 parent 63c8896 commit 6ccbf0f
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 81 deletions.
111 changes: 53 additions & 58 deletions application/helpers/qanda_helper.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion application/views/survey/questions/arrays/texts/answer.php
Expand Up @@ -25,7 +25,7 @@
<!-- Multi Text -->

<!-- answer -->
<table <?php echo $q_table_id_HTML;?> class="<?php echo $coreClass;?> table table-bordered table-hover <?php echo $num_class;?> <?php echo $totals_class;?>">
<table <?php echo $q_table_id_HTML;?> class="<?php echo $coreClass;?> table table-bordered table-hover <?php echo $totals_class;?>">
<colgroup class="col-responses">

<!-- Column for answer label -->
Expand Down
@@ -1,20 +1,18 @@
<?php
/**
* Optional column for total, grand total, etc
* Optional td item for total, grand total, etc
* Define the width
*
* @var $empty
*/
?>
<!-- col_total -->
<?php if($empty):?>
<td>&nbsp;</td>
<?php else:?>
<td class="total information-item">
<?php if($label):?>
<label class="hidden-md hidden-lg"><?php gT("Total");?></label>
<?php endif;?>
<input type="text" size="[[INPUT_WIDTH]]" value="" disabled="disabled" class="disabled form-control" />
</td>
<?php endif;?>
<!-- end of col_total -->
<td class="total information-item">
<?php if($empty):?>
&nbsp;
<?php else:?>
<label class="sr-only"><?php eT("Total");?></label>
<input title="[[ROW_NAME]] total" size="<?php echo $inputsize; ?>" value="" type="text" disabled="disabled" class="disabled form-control" data-number='1' />
<?php endif;?>
</td>

Expand Up @@ -23,8 +23,10 @@
id="answer<?php echo $myfname2; ?>"
class="form-control <?php echo $kpclass; ?>"
<?php echo $maxlength; ?>
size="<?php echo $inputwidth; ?>"
size="<?php echo $inputsize; ?>"
value="<?php echo $value;?>"
data-number='<?php echo $isNumber; ?>'
data-integer='<?php echo $isInteger; ?>'
/>
<input
type="hidden"
Expand Down
Expand Up @@ -11,7 +11,7 @@
<td>&nbsp;</td>
<?php else:?>
<td class="total grand information-item">
<input type="text" size="[[INPUT_WIDTH]]" value="" disabled="disabled" class="disabled form-control" />
<input type="text" size="<?php echo $inputsize; ?>" value="" disabled="disabled" class="disabled form-control" data-number='1' />
</td>
<?php endif;?>
<!-- end of td_grand_total -->
Expand Up @@ -10,7 +10,7 @@
&nbsp;
<?php else:?>
<label class="sr-only"><?php eT("Total");?></label>
<input name="[[ROW_NAME]]_total" title="[[ROW_NAME]] total" size="[[INPUT_WIDTH]]" value="" type="text" disabled="disabled" class="disabled form-control" />
<input title="[[ROW_NAME]] total" size="<?php echo $inputsize; ?>" value="" type="text" disabled="disabled" class="disabled form-control" data-number='1' />
<?php endif;?>
</td>
<!-- end of td_total -->
Expand Up @@ -19,10 +19,9 @@
<!-- List with comment, list style, -->

<!-- answer -->
<div class="ls-answers row">
<div class="<?php echo $coreClass; ?> row">
<div class="answers-list radio-list col-sm-6 col-xs-12">
<ul class="list-unstyled">

<?php
// rows/row.php
echo $sRows;
Expand Down
Expand Up @@ -12,7 +12,7 @@
*/
?>
<!-- answer_row -->
<li id='javatbd<?php echo $name; ?>' class="form-group answer-item radio-item <?php if(isset($li_classes)){echo $li_classes;}?>">
<li id='javatbd<?php echo $name; ?>' class="form-group <?php echo $li_classes; ?>">
<input
type="radio"
name="<?php echo $name; ?>"
Expand Down
Expand Up @@ -41,8 +41,9 @@
<?php
/* FF show issue + prefix/suffix must be encoded */
echo CHtml::textField($myfname,$dispVal,array(
'class'=>'form-control',
'id'=>"answer{$myfname}",
'data-slider-value'=>($dispVal ? $dispVal : null),
'data-slider-value'=>($dispVal ? $dispVal : ''),
'data-slider-min'=>$slider_min,
'data-slider-max'=>$slider_max,
'data-slider-step'=>$slider_step,
Expand All @@ -66,7 +67,7 @@
<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 class="ls-input-group-extra ls-no-js-hidden">
<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>
Expand Down
5 changes: 3 additions & 2 deletions scripts/array-totalsum.js
Expand Up @@ -82,8 +82,9 @@ function normalizeValue(aValue)
if(outNumber == false)
{
var numReplaced = aValue.toString().replace(/,/g, ".");
outNumber = new Decimal(numReplaced);

try {
outNumber = new Decimal(numReplaced);
} catch(e){}
return outNumber;
} else {
return outNumber;
Expand Down
5 changes: 5 additions & 0 deletions templates/basic/css/template-core.css
Expand Up @@ -13,6 +13,11 @@ li.radio-item,li.checkbox-item{display:block}
.radio-item input[type="radio"],.checkbox-item input[type="checkbox"] {
position:absolute;
}
/**
* Shown :text numeric at right
*/
[type='text'][data-number='1']{text-align:right}

/**
* Table .question feature
*/
Expand Down

0 comments on commit 6ccbf0f

Please sign in to comment.