Skip to content

Commit

Permalink
Fixed issue #11585: VV export/import dialogs are not styled
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 16, 2016
1 parent 3405e9b commit 460f9cb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 9 deletions.
56 changes: 47 additions & 9 deletions application/views/admin/dataentry/vvimport.php
Expand Up @@ -23,7 +23,7 @@
<label for="csv_vv_file" class="col-sm-2 control-label">
<?php eT("File:");?>
</label>
<div class="col-sm-4">
<div class="col-sm-6">
<input type="file" value="" name="csv_vv_file" id="csv_vv_file" class="form-control">
</div>
</div>
Expand All @@ -33,11 +33,17 @@
<?php eT("Exclude record IDs?"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('noid',true,array('value'=>"noid",'onChange' => 'javascript:form.insertmethod.disabled=this.checked')) ?>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'noid',
'value'=> 'noid',
'onLabel'=>gT('Yes'),
'offLabel'=>gT('No')
));
?>
</div>
</div>

<div class="form-group">
<div class="form-group" id="insertmethod-container">
<label for="insertmethod" class="col-sm-2 control-label">
<?php eT("When an imported record matches an existing record ID:"); ?>
</label>
Expand All @@ -47,8 +53,8 @@
'renumber' => gT("Renumber the new record."),
'replace' => gT("Replace the existing record."),
'replaceanswers' => gT("Replace answers in file in the existing record."),
),array('disabled'=>'disabled','class'=>'form-control')); ?>

),array('disabled'=>'disabled','class'=>'form-control'));
?>
</div>
</div>

Expand All @@ -57,7 +63,13 @@
<?php eT("Import as not finalized answers?"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('notfinalized',false,array('value'=>"notfinalized")); ?>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'notfinalized',
'value'=> false,
'onLabel'=>gT('Yes'),
'offLabel'=>gT('No')
));
?>
</div>
</div>

Expand All @@ -75,16 +87,28 @@
<?php eT("First line contains the code of questions:"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('dontdeletefirstline',false,array('value'=>"dontdeletefirstline")); ?>
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'dontdeletefirstline',
'value'=> false,
'onLabel'=>gT('Yes'),
'offLabel'=>gT('No')
));
?>
</div>
</div>

<div class="form-group">
<label for="forceimport" class="col-sm-2 control-label" title='<?php eT("Try to import even if question codes don't match"); ?>' data-toggle="tooltip" data-placement="right">
<?php eT("Force import:"); ?>
</label>
<div class="col-sm-4">
<?php echo CHtml::checkBox('forceimport',false,array('value'=>"forceimport")); ?>
<div class="col-sm-4">
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'forceimport',
'value'=> false,
'onLabel'=>gT('Yes'),
'offLabel'=>gT('No')
));
?>
</div>
</div>

Expand Down Expand Up @@ -119,3 +143,17 @@
<?php } ?>

</div></div></div>

<script>
$(document).ready(function() {
$('#noid').on('switchChange.bootstrapSwitch', function(event, state) {
if (!state){
$('#insertmethod').removeAttr('disabled');
$('#insertmethod-container').show('slow');
}else{
$('#insertmethod').attr('disabled','disabled');
$('#insertmethod-container').hide('slow');
}
});
});
</script>
4 changes: 4 additions & 0 deletions styles/Sea_Green/css/lime-admin-common.css
Expand Up @@ -2231,3 +2231,7 @@ input[type="file"].form-control {
border: none;
padding-left: 0px;
}

#insertmethod-container{
display: none;
}

0 comments on commit 460f9cb

Please sign in to comment.