* adjust the UI.

This commit is contained in:
wangchunsheng
2010-02-02 03:27:51 +00:00
parent 5c13cd95ae
commit 2f5a8c54a1
7 changed files with 229 additions and 98 deletions

View File

@@ -1,5 +1,6 @@
<link rel='stylesheet' href='<?php echo $clientTheme;?>tablesorter.css' />
<script src='<?php echo $jsRoot;?>jquery/tablesorter/min.js' type='text/javascript'></script>
<script src='<?php echo $jsRoot;?>jquery/tablesorter/metadata.js' type='text/javascript'></script>
<script language='javascript'>
$(function() {
@@ -9,11 +10,11 @@ $(function() {
widgetZebra: {css: ['odd', 'even'] }
}
);
$('.tablesorter tr').hover(
$('.tablesorter tbody tr').hover(
function(){$(this).addClass('hoover')},
function(){$(this).removeClass('hoover')}
);
$('.tablesorter tr').click(
$('.tablesorter tbody tr').click(
function()
{
if($(this).attr('class').indexOf('clicked') > 0)

View File

@@ -96,14 +96,16 @@ function changeDate(date)
</td>
</tr>
<?php endforeach;?>
</tbody>
<?php if($importFeature):?>
<tfoot>
<tr>
<td colspan='9'>
<input type='submit' value='<?php echo $lang->todo->import2Today;?>' />
</td>
</tr>
<?php endif;?>
</tbody>
</tfoot>
</table>
</form>
</div>

View File

@@ -24,12 +24,12 @@
$lang->testtask->id = '任务编号';
$lang->testtask->product = '所属产品';
$lang->testtask->project = '所属项目';
$lang->testtask->build = '相关Build';
$lang->testtask->name = '测试任务名称';
$lang->testtask->build = 'Build';
$lang->testtask->name = '任务名称';
$lang->testtask->begin = '开始日期';
$lang->testtask->end = '结束日期';
$lang->testtask->desc = '任务描述';
$lang->testtask->status = '状态';
$lang->testtask->status = '当前状态';
$lang->testtask->assignedTo = '指派给';
$lang->testtask->linkVersion = '关联(版本)';
$lang->testtask->lastRun = '最后执行';

View File

@@ -23,10 +23,9 @@
*/
?>
<?php include '../../common/header.html.php';?>
<?php include '../../common/colorize.html.php';?>
<?php include '../../common/tablesorter.html.php';?>
<div class='yui-d0'>
<table class='table-1 colored tablesorter'>
<table class='table-1 colored tablesorter fixed'>
<caption>
<div class='f-left'><?php echo $lang->testtask->browse;?></div>
<div class='f-right'><?php common::printLink('testtask', 'create', "product=$productID", $lang->testtask->create);?></div>
@@ -37,7 +36,7 @@
<th><?php echo $lang->testtask->product;?></th>
<th><?php echo $lang->testtask->project;?></th>
<th><?php echo $lang->testtask->build;?></th>
<th><?php echo $lang->testtask->name;?></th>
<th class='w-p30'><?php echo $lang->testtask->name;?></th>
<th><?php echo $lang->testtask->begin;?></th>
<th><?php echo $lang->testtask->end;?></th>
<th><?php echo $lang->testtask->status;?></th>
@@ -51,7 +50,7 @@
<td><?php echo $task->productName?></td>
<td><?php echo $task->projectName?></td>
<td><?php echo $task->buildName?></td>
<td width='50%' class='a-left'><?php echo $task->name;?></td>
<td class='a-left nobr'><?php echo $task->name;?></td>
<td><?php echo $task->begin?></td>
<td><?php echo $task->end?></td>
<td><?php echo $lang->testtask->statusList[$task->status];?></td>

View File

@@ -23,7 +23,6 @@
*/
?>
<?php include '../../common/header.html.php';?>
<?php include '../../common/colorize.html.php';?>
<?php include '../../common/tablesorter.html.php';?>
<?php include '../../common/colorbox.html.php';?>
<script language='javascript'>
@@ -40,90 +39,98 @@ function checkall(checker)
});
}
</script>
<div class='yui-d0'>
<table class='table-1'>
<caption><?php echo $lang->testtask->view;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->testtask->project;?></th>
<td><?php echo $task->projectName;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php $task->buildName ? print($task->buildName) : print($task->build);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo $task->begin;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo $task->end;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo $lang->testtask->statusList[$task->status];?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td><?php echo $task->name;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td><?php echo nl2br($task->desc);?>
</tr>
</table>
<form method='post' action='<?php echo inlink('batchAssign', "task=$task->id");?>' target='hiddenwin'>
<table class='table-1 colored tablesorter'>
<caption>
<div class='f-left'><?php echo $lang->testtask->linkedCases;?></div>
<div class='f-right'><?php common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase);?></div>
</caption>
<thead>
<tr>
<th class='w-20px'><nobr><?php echo $lang->testcase->id;?></nobr></th>
<th><?php echo $lang->testcase->pri;?></th>
<th class='w-p40'><?php echo $lang->testcase->title;?></th>
<th><?php echo $lang->testcase->type;?></th>
<th><?php echo $lang->testtask->assignedTo;?></th>
<th><?php echo $lang->testtask->lastRun;?></th>
<th><?php echo $lang->testtask->lastResult;?></th>
<th><?php echo $lang->testtask->status;?></th>
<th><?php echo $lang->action;?></th>
</tr>
</thead>
<tbody>
<?php foreach($runs as $run):?>
<tr class='a-center'>
<td class='a-left'><?php echo "<input type='checkbox' name='cases[]' value='$run->case' /> "; printf('%03d', $run->case);?></td>
<td><?php echo $run->pri?></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version"), $run->title, '_blank');?>
</td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php echo $users[$run->assignedTo];?></td>
<td><?php if(substr($run->lastRun, 0, 4) != '0000') echo date('y-m-d H:i', strtotime($run->lastRun));?></td>
<td class='<?php echo $run->lastResult;?>'><?php if($run->lastResult) echo $lang->testcase->resultList[$run->lastResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo $lang->testtask->statusList[$run->status];?></td>
<td>
<?php
common::printLink('testtask', 'runcase', "id=$run->id", $lang->testtask->runCase, '', 'class="iframe"');
common::printLink('testtask', 'results', "id=$run->id", $lang->testtask->results, '', 'class="iframe"');
//common::printLink('bug', 'create', "id=$run->id", $lang->testtask->createBug);
common::printLink('testtask', 'unlinkcase', "id=$run->id", $lang->testtask->unlinkCase, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
<tr>
<td><nobr><?php echo "<input type='checkbox' onclick='checkall(this);'> " . $lang->selectAll;?></nobr></td>
<td colspan='9'>
<?php
echo html::select('assignedTo', $users);
echo html::submitButton($lang->testtask->assign);
?>
</td>
</tr>
</tbody>
</table>
</form>
<div class='yui-d0 yui-t6'>
<div class='yui-b'>
<table class='table-1'>
<caption><?php echo $lang->testtask->view;?></caption>
<tr>
<th class='rowhead w-p25'><?php echo $lang->testtask->project;?></th>
<td><?php echo $task->projectName;?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php $task->buildName ? print($task->buildName) : print($task->build);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
<td><?php echo $task->begin;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->end;?></th>
<td><?php echo $task->end;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->status;?></th>
<td><?php echo $lang->testtask->statusList[$task->status];?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->name;?></th>
<td><?php echo $task->name;?>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->desc;?></th>
<td><?php echo nl2br($task->desc);?>
</tr>
</table>
</div>
<div class='yui-main'>
<div class='yui-b'>
<form method='post' action='<?php echo inlink('batchAssign', "task=$task->id");?>' target='hiddenwin'>
<table class='table-1 tablesorter'>
<caption>
<div class='f-left'><?php echo $lang->testtask->linkedCases;?></div>
<div class='f-right'><?php common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase);?></div>
</caption>
<thead>
<tr>
<th class='w-20px'><nobr><?php echo $lang->testcase->id;?></nobr></th>
<th><?php echo $lang->testcase->pri;?></th>
<th class='w-p40'><?php echo $lang->testcase->title;?></th>
<th><?php echo $lang->testcase->type;?></th>
<th><?php echo $lang->testtask->assignedTo;?></th>
<th><?php echo $lang->testtask->lastRun;?></th>
<th><?php echo $lang->testtask->lastResult;?></th>
<th><?php echo $lang->testtask->status;?></th>
<th class='{sorter: false}'><?php echo $lang->action;?></th>
</tr>
</thead>
<tbody>
<?php foreach($runs as $run):?>
<tr class='a-center'>
<td class='a-left'><?php echo "<input type='checkbox' name='cases[]' value='$run->case' /> "; printf('%03d', $run->case);?></td>
<td><?php echo $run->pri?></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version"), $run->title, '_blank');?>
</td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php echo $users[$run->assignedTo];?></td>
<td><?php if(substr($run->lastRun, 0, 4) != '0000') echo date('y-m-d H:i', strtotime($run->lastRun));?></td>
<td class='<?php echo $run->lastResult;?>'><?php if($run->lastResult) echo $lang->testcase->resultList[$run->lastResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo $lang->testtask->statusList[$run->status];?></td>
<td>
<?php
common::printLink('testtask', 'runcase', "id=$run->id", $lang->testtask->runCase, '', 'class="iframe"');
common::printLink('testtask', 'results', "id=$run->id", $lang->testtask->results, '', 'class="iframe"');
//common::printLink('bug', 'create', "id=$run->id", $lang->testtask->createBug);
common::printLink('testtask', 'unlinkcase', "id=$run->id", $lang->testtask->unlinkCase, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td><nobr><?php echo "<input type='checkbox' onclick='checkall(this);'> " . $lang->selectAll;?></nobr></td>
<td colspan='9'>
<?php
echo html::select('assignedTo', $users);
echo html::submitButton($lang->testtask->assign);
?>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
</div>
</div>
<?php include '../../common/footer.html.php';?>

View File

@@ -0,0 +1,122 @@
/*
* Metadata - jQuery plugin for parsing metadata from elements
*
* Copyright (c) 2006 John Resig, Yehuda Katz, J<>örn Zaefferer, Paul McLanahan
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
*
*/
/**
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
* in the JSON will become a property of the element itself.
*
* There are three supported types of metadata storage:
*
* attr: Inside an attribute. The name parameter indicates *which* attribute.
*
* class: Inside the class attribute, wrapped in curly braces: { }
*
* elem: Inside a child element (e.g. a script tag). The
* name parameter indicates *which* element.
*
* The metadata for an element is loaded the first time the element is accessed via jQuery.
*
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
*
* @name $.metadata.setType
*
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
* @before $.metadata.setType("class")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from the class attribute
*
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
* @before $.metadata.setType("attr", "data")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from a "data" attribute
*
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
* @before $.metadata.setType("elem", "script")
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
* @desc Reads metadata from a nested script element
*
* @param String type The encoding type
* @param String name The name of the attribute to be used to get metadata (optional)
* @cat Plugins/Metadata
* @descr Sets the type of encoding to be used when loading metadata for the first time
* @type undefined
* @see metadata()
*/
(function($) {
$.extend({
metadata : {
defaults : {
type: 'class',
name: 'metadata',
cre: /({.*})/,
single: 'metadata'
},
setType: function( type, name ){
this.defaults.type = type;
this.defaults.name = name;
},
get: function( elem, opts ){
var settings = $.extend({},this.defaults,opts);
// check for empty string in single property
if ( !settings.single.length ) settings.single = 'metadata';
var data = $.data(elem, settings.single);
// returned cached data if it already exists
if ( data ) return data;
data = "{}";
if ( settings.type == "class" ) {
var m = settings.cre.exec( elem.className );
if ( m )
data = m[1];
} else if ( settings.type == "elem" ) {
if( !elem.getElementsByTagName )
return undefined;
var e = elem.getElementsByTagName(settings.name);
if ( e.length )
data = $.trim(e[0].innerHTML);
} else if ( elem.getAttribute != undefined ) {
var attr = elem.getAttribute( settings.name );
if ( attr )
data = attr;
}
if ( data.indexOf( '{' ) <0 )
data = "{" + data + "}";
data = eval("(" + data + ")");
$.data( elem, settings.single, data );
return data;
}
}
});
/**
* Returns the metadata object for the first member of the jQuery object.
*
* @name metadata
* @descr Returns element's metadata object
* @param Object opts An object contianing settings to override the defaults
* @type jQuery
* @cat Plugins/Metadata
*/
$.fn.metadata = function( opts ){
return $.metadata.get( this[0], opts );
};
})(jQuery);

View File

@@ -72,8 +72,8 @@ caption {border:1px solid #e4e4e4; background:#efefef; margin:0; padding:5
.nobr {overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.fixed th, .fixed td {overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.odd {background:white}
.even {background:#ECF6FC}
.odd {background:#ECF6FC}
.even {background:white}
.hoover {background:#BCD4EC}
.clicked {background:yellow}