Skip to content

Commit

Permalink
Fixed issue #10806: A lot of white space lost in survey language and …
Browse files Browse the repository at this point in the history
…question language

Dev: Use always 12 columns, force html editor to max width of 100%
Dev: add a css file for all admin theme
  • Loading branch information
Shnoulle committed Mar 21, 2016
1 parent 857d2b9 commit 6ab02c0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
1 change: 1 addition & 0 deletions application/helpers/admin/htmleditor_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ function getPopupEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=nu

function getInlineEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=null,$qID=null,$action=null)
{
App()->getClientScript()->registerCssFile(Yii::app()->getConfig('styleurl')."htmleditor.css");
$htmlcode = '';
$imgopts = '';
$toolbarname = 'inline';
Expand Down
54 changes: 26 additions & 28 deletions application/views/admin/survey/Question/question_subviews/_tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,33 @@

<!-- Question Code -->
<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='title'><?php eT("Code:"); ?></label>
<div class="col-sm-5">
<label class="col-sm-3 control-label" for='title'><?php eT("Code:"); ?></label>
<div class="col-sm-9">
<?php echo CHtml::textField("title",$eqrow['title'],array('class'=>'form-control','size'=>"20",'maxlength'=>'20','pattern'=>$sPattern,"autofocus"=>"autofocus",'id'=>"title")); ?>
<span class='text-warning'><?php eT("Required"); ?> </span>
</div>
</div>
</div>

<!-- Question Text -->
<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='question_<?php echo $eqrow['language']; ?>' class=""><?php eT("Question:"); ?></label>
<div class="htmleditor col-sm-6 input-group">
<label class="col-sm-3 control-label" for='question_<?php echo $eqrow['language']; ?>' class=""><?php eT("Question:"); ?></label>
<div class="col-sm-9">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("question_{$eqrow['language']}",$eqrow['question'],array('class'=>'form-control','cols'=>'60','rows'=>'8','id'=>"question_{$eqrow['language']}")); ?>
<?php echo getEditor("question-text","question_".$eqrow['language'], "[".gT("Question:", "js")."](".$eqrow['language'].")",$surveyid,$gid,$qid,$action); ?>
</div>
</div>
</div>
</div>

<!-- Question Help -->
<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='help_<?php echo $eqrow['language']; ?>'><?php eT("Help:"); ?></label>
<div class="htmleditor col-sm-6 input-group">
<label class="col-sm-3 control-label" for='help_<?php echo $eqrow['language']; ?>'><?php eT("Help:"); ?></label>
<div class="col-sm-9">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("help_{$eqrow['language']}",$eqrow['help'],array('class'=>'form-control','cols'=>'60','rows'=>'4','id'=>"help_{$eqrow['language']}")); ?>
<?php echo getEditor("question-help","help_".$eqrow['language'], "[".gT("Help:", "js")."](".$eqrow['language'].")",$surveyid,$gid,$qid,$action); ?>
</div>
</div>
</div>
</div>
</div>

Expand All @@ -69,24 +67,24 @@
<?php $aqrow = $aqrow->attributes;?>
<div id="<?php echo $aqrow['language']; ?>" class="tab-pane fade">
<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='question_<?php echo $aqrow['language']; ?>'><?php eT("Question:"); ?></label>
<div class="htmleditor col-sm-6 input-group">
<label class="col-sm-3 control-label" for='question_<?php echo $aqrow['language']; ?>'><?php eT("Question:"); ?></label>
<div class="col-sm-9">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("question_{$aqrow['language']}",$aqrow['question'],array('class'=>'form-control','cols'=>'60','rows'=>'8','id'=>"question_{$aqrow['language']}")); ?>
<?php echo getEditor("question-text","question_".$aqrow['language'], "[".gT("Question:", "js")."](".$aqrow['language'].")",$surveyid,$gid,$qid,$action); ?>
</div>
</div>
</div>
</div>

<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='help_<?php echo $aqrow['language']; ?>'><?php eT("Help:"); ?></label>
<div class="htmleditor col-sm-6 input-group">
<label class="col-sm-3 control-label" for='help_<?php echo $aqrow['language']; ?>'><?php eT("Help:"); ?></label>
<div class="col-sm-9">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("help_{$aqrow['language']}",$aqrow['help'],array('class'=>'form-control','cols'=>'60','rows'=>'4','id'=>"help_{$aqrow['language']}")); ?>
<?php echo getEditor("question-help","help_".$aqrow['language'], "[".gT("Help:", "js")."](".$aqrow['language'].")",$surveyid,$gid,$qid,$action); ?>
</div>
</div>
</div>
</div>
</div>
<?php endforeach;?>
<?php else:?>
Expand All @@ -95,23 +93,23 @@
<div id="<?php echo $addlanguage; ?>" class="tab-pane fade">

<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='question_<?php echo $addlanguage; ?>'><?php eT("Question:");?></label>
<div class="htmleditor col-sm-6 input-group">
<label class="col-sm-3 control-label" for='question_<?php echo $addlanguage; ?>'><?php eT("Question:");?></label>
<div class="col-sm-9">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("question_{$addlanguage}","",array('class'=>'form-control','cols'=>'60','rows'=>'8','id'=>"question_{$addlanguage}")); ?>
<?php echo getEditor("question-text","question_".$addlanguage, "[".gT("Question:", "js")."](".$addlanguage.")",$surveyid,$gid,$qid,$action); ?>
</div>
</div>
</div>
</div>

<div class="form-group">
<div class="col-lg-offset-1">
<label class="col-sm-2 control-label" for='help_<?php echo $addlanguage; ?>'><?php eT("Help:"); ?></label>
<div class="htmleditor col-sm-6 input-group">
<label class="col-sm-3 control-label" for='help_<?php echo $addlanguage; ?>'><?php eT("Help:"); ?></label>
<div class="col-sm-9">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("help_{$addlanguage}","",array('class'=>'form-control','cols'=>'60','rows'=>'4','id'=>"help_{$addlanguage}")); ?>
<?php echo getEditor("question-help","help_".$addlanguage, "[".gT("Help:", "js")."](".$addlanguage.")",$surveyid,$gid,$qid,$action); ?>
</div>
</div>
</div>
</div>

</div>
Expand Down
16 changes: 11 additions & 5 deletions application/views/admin/survey/editLocalSettings_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/
?>

<div id="edittxtele-<?php echo $i;?>" class="tab-pane fade in <?php if($i==0){echo "active";}?> col-lg-6 center-box">
<div id="edittxtele-<?php echo $i;?>" class="tab-pane fade in <?php if($i==0){echo "active";}?> center-box">

<!-- Survey title -->
<div class="form-group">
<label class="col-sm-4 question-group-title" for="short_title<?php echo $esrow['surveyls_language']; ?>">
<label class="col-sm-4 question-group-title control-label" for="short_title<?php echo $esrow['surveyls_language']; ?>">
<?php eT("Survey title"); ?>:
</label>
<div class="col-sm-8">
Expand All @@ -20,28 +20,34 @@
<!-- Description -->
<div class="form-group">
<label class="col-sm-4 control-label" for="description_<?php echo $esrow['surveyls_language']; ?>"><?php eT("Description:"); ?></label>
<div class="htmleditor col-sm-8">
<div class="col-sm-8">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("description_{$esrow['surveyls_language']}",$esrow['surveyls_description'],array('class'=>'form-control','cols'=>'80','rows'=>'15','id'=>"description_{$esrow['surveyls_language']}")); ?>
<?php echo getEditor("survey-desc","description_".$esrow['surveyls_language'], "[".gT("Description:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action); ?>
</div>
</div>
</div>

<!-- Welcome message -->
<div class="form-group">
<label class="col-sm-4 control-label" for='welcome_<?php echo $esrow['surveyls_language']; ?>'><?php eT("Welcome message:"); ?></label>
<div class="htmleditor col-sm-8">
<div class="col-sm-8">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("welcome_{$esrow['surveyls_language']}",$esrow['surveyls_welcometext'],array('class'=>'form-control','cols'=>'80','rows'=>'15','id'=>"welcome_{$esrow['surveyls_language']}")); ?>
<?php echo getEditor("survey-welc","welcome_".$esrow['surveyls_language'], "[".gT("Welcome:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action); ?>
</div>
</div>
</div>

<!-- End message -->
<div class="form-group">
<label class="col-sm-4 control-label" for='endtext_<?php echo $esrow['surveyls_language']; ?>'><?php eT("End message:"); ?></label>
<div class="htmleditor col-sm-8">
<div class="col-sm-8">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("endtext_{$esrow['surveyls_language']}",$esrow['surveyls_endtext'],array('class'=>'form-control','cols'=>'80','rows'=>'15','id'=>"endtext_{$esrow['surveyls_language']}")); ?>
<?php echo getEditor("survey-endtext","endtext_".$esrow['surveyls_language'], "[".gT("End message:", "js")."](".$esrow['surveyls_language'].")",$surveyid,'','',$action); ?>
</div>
</div>
</div>

<!-- End URL -->
Expand Down
2 changes: 2 additions & 0 deletions styles/htmleditor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.htmleditor{width:100%;table-layout:fixed}
.cke_skin_BootstrapCK-Skin{max-width:100%}

0 comments on commit 6ab02c0

Please sign in to comment.