* adjust code for task #2577.

This commit is contained in:
chenfeiCF
2016-04-28 09:13:28 +08:00
parent a95d623dec
commit dcead9593f
4 changed files with 29 additions and 10 deletions
+2
View File
@@ -101,9 +101,11 @@ function addFile(clickedButton)
fileRow = <?php echo json_encode($fileRow);?>;
fileRow = fileRow.replace('$i', $('.fileID').size() + 1);
/* Get files and labels name.*/
filesName = $(clickedButton).closest('tr').find('input[type="file"]').attr('name');
labelsName = $(clickedButton).closest('tr').find('input[type="text"]').attr('name');
/* Add file input control and set files and labels name in it.*/
$fileBox = $(clickedButton).closest('.fileBox').after(fileRow).next('.fileBox');
$fileBox.find('input[type="file"]').attr('name', filesName);
$fileBox.find('input[type="text"]').attr('name', labelsName);
+20 -2
View File
@@ -1,12 +1,30 @@
$(document).on('keyup', 'form textarea', function()
{
var preSelect = $(this).parent().prev().find('select');
var preSelect = $(this).closest('table').parent().prev().find('select');
if($(this).val() == '' && $(preSelect).val() == 'fail')
{
$(preSelect).val('pass');
}
else if($(this).val() != '' && $(preSelect).val() == 'pass')
{
$(preSelect).val('fail');
$(preSelect).val('fail').parent().addClass('has-error');
setTimeout(function(){$(preSelect).parent().removeClass('has-error');},'1000');
}
})
/* Delete a file. */
function deleteFile(fileID)
{
if(!fileID) return;
hiddenwin.location.href =createLink('file', 'delete', 'fileID=' + fileID);
}
/* Download a file, append the mouse to the link. Thus we call decide to open the file in browser no download it. */
function downloadFile(fileID)
{
if(!fileID) return;
var sessionString = '<?php echo $sessionString;?>';
var url = createLink('file', 'download', 'fileID=' + fileID + '&mouse=left') + sessionString;
window.open(url, '_blank');
return false;
}
+6 -7
View File
@@ -43,7 +43,7 @@
<td><?php echo $users[$result->lastRunner] . ' ' . $lang->testtask->runCase;?></td>
<td class='w-150px'><?php echo zget($builds, $result->build, '');?></td>
<td class='w-50px text-right'><strong class='text-<?php echo $class;?>'><?php echo $lang->testcase->resultList[$result->caseResult]?></strong></td>
<td class='w-20px'><?php if(!empty($result->files)) echo html::a("#caseResult{$result->id}", '<i class="btn-icon icon-file"></i>', '', "data-toggle='modal' title='{$lang->files}' data-type='iframe'")?></td>
<td class='w-40px'><?php if(!empty($result->files)) echo html::a("#caseResult{$result->id}", $lang->files, '', "data-toggle='modal' data-type='iframe'")?></td>
<td class='w-50px text-center'><i class='collapse-handle icon-chevron-down text-muted'></i></td>
</tr>
<tr class='result-detail hide'>
@@ -53,9 +53,10 @@
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p30'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p30'><?php echo $lang->testcase->stepExpect;?></th>
<th><?php echo $lang->testcase->result;?></th>
<th class='w-p25'><?php echo $lang->testcase->stepExpect;?></th>
<th class='text-center'><?php echo $lang->testcase->result;?></th>
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
<th class='w-50px'></th>
</tr>
</thead>
<?php
@@ -69,10 +70,8 @@
<td><?php if(isset($stepResult['expect'])) echo nl2br($stepResult['expect']);?></td>
<?php if(!empty($stepResult['result'])):?>
<td class='<?php echo $stepResult['result'];?> text-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td>
<?php echo $stepResult['real'];?>
<?php if(!empty($stepResult['files'])) echo html::a("#stepResult{$modalID}", '<i class="btn-icon icon-file"></i>', '', "data-toggle='modal' title='{$lang->files}' data-type='iframe' style='float:right'")?>
</td>
<td><?php echo $stepResult['real'];?></td>
<td class='text-center'><?php if(!empty($stepResult['files'])) echo html::a("#stepResult{$modalID}", $lang->files, '', "data-toggle='modal' data-type='iframe'")?></td>
</tr>
<?php else:?>
<td></td>
+1 -1
View File
@@ -33,7 +33,7 @@
<th>
<?php echo $lang->testcase->real;?>
<?php if(empty($run->case->steps)):?>
<button type='button' class='btn btn-file' data-toggle='modal' data-target='#fileModal'><?php echo $lang->testtask->files;?></button>
<button type='button' class='btn btn-danger btn-file' data-toggle='modal' data-target='#fileModal'><?php echo $lang->testtask->files;?></button>
<?php endif;?>
</th>
</tr>