Skip to content

Commit

Permalink
Fixed issue #13056: Position of icons - Label sets -> Also fixed quic…
Browse files Browse the repository at this point in the history
…k add and subquestion&answers
  • Loading branch information
lacrioque committed Dec 21, 2017
1 parent 950ce2c commit 8c07d83
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 26 deletions.
4 changes: 2 additions & 2 deletions application/views/admin/labels/_labelviewtabcontent_view.php
Expand Up @@ -64,8 +64,8 @@
<td style='text-align:center;'>
&nbsp;&nbsp;
<?php if ($first && Permission::model()->hasGlobalPermission('labelsets','update')):?>
<button class="btn btn-default btn-xs btnaddanswer"><i class="icon-add text-success"></i> </button> <?php // eT("Insert a new label after this one") ?>
<button class="btn btn-default btn-xs btndelanswer"><i class="fa fa-trash text-warning "></i> </button> <?php //eT("Delete this label") ?>
<button class="btn btn-default btn-sm btnaddanswer"><i class="icon-add text-success"></i> </button> <?php // eT("Insert a new label after this one") ?>
<button class="btn btn-default btn-sm btndelanswer"><i class="fa fa-trash text-warning "></i> </button> <?php //eT("Delete this label") ?>
<?php endif;?>
</td>
</tr>
Expand Down
Expand Up @@ -107,29 +107,31 @@ class='assessment'

<!-- Answer (Subquestion Text) -->
<td class="subquestion-text" style="vertical-align: middle;">
<input
type='text'
size='20'
class='answer form-control input'
id='answer_<?php echo $language; ?>_<?php echo $sortorder; ?>_<?php echo $scale_id; ?>'
name='answer_<?php echo $language; ?>_<?php echo $sortorder; ?>_<?php echo $scale_id; ?>'
placeholder='<?php eT("Some example answer option","js") ?>'
value="<?php echo $answer; ?>"
onkeypress=" if(event.keyCode==13) { if (event && event.preventDefault) event.preventDefault(); document.getElementById('save-button').click(); return false;}"
/>
<div class="input-group">
<input
type='text'
size='20'
class='answer form-control input'
id='answer_<?php echo $language; ?>_<?php echo $sortorder; ?>_<?php echo $scale_id; ?>'
name='answer_<?php echo $language; ?>_<?php echo $sortorder; ?>_<?php echo $scale_id; ?>'
placeholder='<?php eT("Some example answer option","js") ?>'
value="<?php echo $answer; ?>"
onkeypress=" if(event.keyCode==13) { if (event && event.preventDefault) event.preventDefault(); document.getElementById('save-button').click(); return false;}"
/>
<span class="input-group-addon">
<?php echo getEditor("editanswer","answer_".$language."_".$qid."_{$scale_id}", "[".gT("Subquestion:", "js")."](".$language.")",$surveyid,$gid,$qid,'editanswer'); ?>
</span>
</div>
</td>

<!-- No relevance equation for answer options -->


<!-- Icons edit/delete -->
<td style="vertical-align: middle;" class="subquestion-actions">

<?php echo getEditor("editanswer","answer_".$language."_".$qid."_{$scale_id}", "[".gT("Subquestion:", "js")."](".$language.")",$surveyid,$gid,$qid,'editanswer'); ?>

<?php if ( $first):?>
<span class="icon-add text-success btnaddanswer" data-assessmentvisible='<?php echo $assessmentvisible;?>' data-position="<?php echo $position; ?>" data-code="<?php echo $title; ?>" data-scale-id="<?php echo $scale_id; ?>" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Insert a new answer option after this one") ?>"></span>
<span class="fa fa-trash text-danger btndelanswer" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Delete this answer option") ?>"></span>
<button class="btn btn-default btn-sm btnaddanswer"><i class="icon-add text-success " data-assessmentvisible='<?php echo $assessmentvisible;?>' data-position="<?php echo $position; ?>" data-code="<?php echo $title; ?>" data-scale-id="<?php echo $scale_id; ?>" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Insert a new answer option after this one") ?>"></i></button>
<button class="btn btn-default btn-sm btndelanswer"><i class="fa fa-trash text-danger " data-toggle="tooltip" data-placement="bottom" title="<?php eT("Delete this answer option") ?>"></i></button>
<?php endif; ?>
</td>
</tr>
Expand Up @@ -96,7 +96,8 @@ class='code code-title'

<!-- Answer (Subquestion Text) -->
<td class="subquestion-text" style="vertical-align: middle;">
<input
<div class="input-group">
<input
type='text'
size='20'
class='answer form-control input'
Expand All @@ -106,6 +107,10 @@ class='answer form-control input'
value="<?php echo $question; ?>"
onkeypress=" if(event.keyCode==13) { if (event && event.preventDefault) event.preventDefault(); document.getElementById('save-button').click(); return false;}"
/>
<span class="input-group-addon">
<?php echo getEditor("editanswer","answer_".$language."_".$qid."_{$scale_id}", "[".gT("Subquestion:", "js")."](".$language.")",$surveyid,$gid,$qid,'editanswer'); ?>
</span>
</div>
</td>

<!-- Relevance equation -->
Expand All @@ -123,15 +128,14 @@ class='answer form-control input'
<!-- Icons add/edit/delete -->
<td style="vertical-align: middle;" class="subquestion-actions">

<?php echo getEditor("editanswer","answer_".$language."_".$qid."_{$scale_id}", "[".gT("Subquestion:", "js")."](".$language.")",$surveyid,$gid,$qid,'editanswer'); ?>

<?php if ( $activated != 'Y' && $first ):?>
<?php
// TODO : to merge subquestion and answer options, implies : define in controller titles
?>

<span class="icon-add text-success btnaddanswer" data-code="<?php echo $title; ?>" data-toggle="tooltip" data-scale-id="<?php echo $scale_id; ?>" data-placement="bottom" title="<?php eT("Insert a new subquestion after this one") ?>"></span>
<span class="fa fa-trash text-danger btndelanswer" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Delete this subquestion") ?>"></span>
<button class="btn btn-default btn-sm btnaddanswer"><i class="icon-add text-success" data-code="<?php echo $title; ?>" data-toggle="tooltip" data-scale-id="<?php echo $scale_id; ?>" data-placement="bottom" title="<?php eT("Insert a new subquestion after this one") ?>"></i></button>
<button class="btn btn-default btn-sm btndelanswer"><i class="fa fa-trash text-danger" data-toggle="tooltip" data-placement="bottom" title="<?php eT("Delete this subquestion") ?>"></i></button>
<?php endif; ?>

</td>
Expand Down
10 changes: 5 additions & 5 deletions assets/scripts/admin/labels.js
Expand Up @@ -326,14 +326,14 @@ function createNewLabelTR(alternate,first){
+ "</td><td>"
+ "<input type=\"number\" class='assessmentval form-control ' value=\"###assessmentval###\" name=\"assessmentvalue_###next###\" id=\"assessmentvalue_###next###\" style=\"text-align: right;\" size=\"6\" maxlength=\"5\" >";

x = x + "<td><input class=' form-control ' name=\"title_###lang###_###next###\" type=\"text\" value=\"\" size=\"80\" maxlength=\"3000\" >"+
"<a title=\"\" id=\"title_###lang###_###next###_ctrl\" href=\"javascript:start_popup_editor('title_###lang###_###next###','[Label:](###lang###)','','','','editlabel','labels')\">"+
"<span class=\"fa fa-pencil text-success\" name=\"title_###lang###_###next###_popupctrlena\" id=\"title_###lang###_###next###_popupctrlena\" alt=\"\"></span>"+
x = x + "<td><div class='input-group'><input class=' form-control ' name=\"title_###lang###_###next###\" type=\"text\" value=\"\" size=\"80\" maxlength=\"3000\" >"+
"<span class='input-group-addon'><a title=\"\" id=\"title_###lang###_###next###_ctrl\" href=\"javascript:start_popup_editor('title_###lang###_###next###','[Label:](###lang###)','','','','editlabel','labels')\">"+
"<span class=\"btn btn-default btn-xs fa fa-pencil text-success\" name=\"title_###lang###_###next###_popupctrlena\" id=\"title_###lang###_###next###_popupctrlena\" alt=\"\"></span>"+
"<span style=\"display: none;\" class=\"fa fa-pencil text-success\" name=\"title_###lang###_###next###_popupctrldis\" id=\"title_###lang###_###next###_popupctrldis\" alt=\"\"></span>"+
"</a></td>";
"</a></span></div></td>";

if (first)
x = x + "<td style=\"text-align: center;\">&nbsp<span class=\"btnaddanswer icon-add text-success\"></span> <span class=\"btndelanswer\ fa fa-trash text-warning\"></span></td>";
x = x + "<td style=\"text-align: center;\">&nbsp;&nbsp;<button class='btn btn-default btn-sm btnaddanswer'><i class=\"icon-add text-success\"></i></button> <button class='btn btn-default btn-sm btndelanswer'><i class=\" fa fa-trash text-warning\"></i></button></td>";

x = x + "</tr>";

Expand Down

0 comments on commit 8c07d83

Please sign in to comment.