* improve UI of task list views.

This commit is contained in:
Catouse
2018-05-08 19:25:05 +08:00
parent 36e68819e9
commit d67a6ca6b1
8 changed files with 43 additions and 73 deletions
+2 -2
View File
@@ -67,8 +67,8 @@
<td class="c-pri"><span class='label-pri <?php echo 'label-pri-' . $task->pri;?>'><?php echo zget($lang->task->priList, $task->pri);?></span></td>
<td class='c-project' title="<?php echo $task->projectName;?>"><?php echo html::a($this->createLink('project', 'browse', "projectid=$task->projectID"), $task->projectName);?></td>
<td class='c-name'>
<?php if(!empty($task->team)) echo '<span class="label">' . $this->lang->task->multipleAB . '</span> ';?>
<?php if(!empty($task->parent)) echo '<span class="label">' . $this->lang->task->childrenAB . '</span> ';?>
<?php if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';?>
<?php if(!empty($task->parent)) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id"), $task->name, null, "style='color: $task->color'");?>
</td>
<td class='c-user'><?php echo zget($users, $task->openedBy);?></td>
+8 -8
View File
@@ -5,13 +5,13 @@
#productsBox .has-branch select {width: 100%; display: table-cell; border-radius: 0 2px 2px 0; border-left: none;}
#productsBox .has-branch select:focus {box-shadow: inset 1px 0 #4d90fe}
.table-children > td:first-child{border-left:2px solid #ccc;}
.table-children > td:last-child{border-right:2px solid #ccc;}
.fixed-left .table-children > td{border-right:none;}
.flexarea .table-children > td{border-left:none;border-right:none;}
.fixed-right .table-children > td{border-left:none;}
.table-children.table-child-top{border-top:2px solid #ccc;}
.table-children.table-child-bottom{border-bottom:2px solid #ccc;}
.table-striped>tbody>tr.table-children:nth-child(odd)>td, .table-striped>tbody>tr.table-children:nth-child(odd)>th{background-color:#fff;}
.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
.table-children.table-child-top {border-top: 2px solid #cbd0db;}
.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
.table td.has-child > .task-toggle {color: #838a9d; position: relative; top: -1px;}
.table td.has-child > .task-toggle:hover {color: #006af1; cursor: pointer;}
.table td.has-child > .task-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s;}
.table td.has-child > .task-toggle > .icon:before {text-align: left;}
.table td.has-child > .task-toggle.collapsed > .icon {transform: rotate(-90deg);}
.chosen-container-single .chosen-single > span{max-width:200px;}
-29
View File
@@ -1,29 +0,0 @@
.red{color:red;}
.bug, .task {color:gray; font-size:9px}
.cont-lt1 .side{width:220px}
#hideButton{cursor:pointer;}
#hideButton span{padding:2px 10px; background:url(theme/default/images/main/zt-icons.png) -100px -161px;}
#featurebar .f-right .icon-green-task-import {padding:2px 8px; background:url(theme/default/images/main/zt-icons.png) 0px -82px;}
.sub-featurebar #querybox {margin:0px;}
.sub-featurebar #bysearchTab.active {padding:0px;}
.sub-featurebar #bysearchTab.active:hover {background:#fff;}
#createActionMenu .dropdown-menu {width:100%;}
.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
.dropdown-menu > .menu-search .input-group {width:100%;}
.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666}
.dropdown-menu > .menu-search .form-control {border: none!important; box-shadow: none!important; border-top: 1px solid #ddd!important;}
.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
.dropdown-list > li > a:hover,
.dropdown-list > li > a:focus {color: #1a4f85;text-decoration: none;background-color: #ddd;}
.pl-5px{padding-left:5px;}
tbody > tr > td > .btn-icon {margin-right: 2px}
#projectTaskForm{padding:0px 1px;}
.table td.has-child > a {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.table td.has-child > .task-toggle {position: relative; top: 1px}
+13 -22
View File
@@ -220,15 +220,15 @@ function loadBranch(){}
/* Auto compute the work days. */
$(function()
{
if(typeof(replaceID) != 'undefined')
{
setModal4List('iframe', replaceID, function($list)
{
$list.find('.progress-pie:visible').progressPie();
var datatable = $list.data('zui.datatable');
if(datatable) datatable.$datatable.find('.progress-pie:visible').progressPie();
});
}
// if(typeof(replaceID) != 'undefined')
// {
// setModal4List('iframe', replaceID, function($list)
// {
// $list.find('.progress-pie:visible').progressPie();
// var datatable = $list.data('zui.datatable');
// if(datatable) datatable.$datatable.find('.progress-pie:visible').progressPie();
// });
// }
$(".date").bind('dateSelected', function()
{
computeWorkDays(this.id);
@@ -239,19 +239,10 @@ $(function()
{
$(document).on('click', '.task-toggle', function(e)
{
var $toggleIcon = $(this).find('i');
var id = $(this).data('id');
if($toggleIcon.hasClass('icon-double-angle-down'))
{
$('tr.parent-'+id).show();
$toggleIcon.removeClass('icon-double-angle-down').addClass('icon-double-angle-up');
}
else if($toggleIcon.hasClass('icon-double-angle-up'))
{
$('tr.parent-'+id).hide();
$toggleIcon.removeClass('icon-double-angle-up').addClass('icon-double-angle-down');
}
var $toggle = $(this);
var id = $(this).data('id');
var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
$toggle.closest('tbody').find('tr.parent-' + id).toggle(!isCollapsed);
e.stopPropagation();
e.preventDefault();
+1 -1
View File
@@ -185,7 +185,7 @@ js::set('browseType', $browseType);
<?php foreach($task->children as $key => $child):?>
<?php $class = $key == 0 ? ' table-child-top' : '';?>
<?php $class .= ($key + 1 == count($task->children)) ? ' table-child-bottom' : '';?>
<tr class='text-center table-children<?php echo $class;?> parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>' data-status='<?php echo $child->status?>' data-estimate='<?php echo $child->estimate?>' data-consumed='<?php echo $child->consumed?>' data-left='<?php echo $child->left?>'>
<tr class='table-children<?php echo $class;?> parent-<?php echo $task->id;?>' data-id='<?php echo $child->id?>' data-status='<?php echo $child->status?>' data-estimate='<?php echo $child->estimate?>' data-consumed='<?php echo $child->consumed?>' data-left='<?php echo $child->left?>'>
<?php foreach($customFields as $field) $this->task->printCell($field, $child, $users, $browseType, $branchGroups, $modulePairs, $useDatatable ? 'datatable' : 'table', true);?>
</tr>
<?php endforeach;?>
+16 -8
View File
@@ -2243,8 +2243,7 @@ class taskModel extends model
if($id == 'deadline' and isset($task->delay)) $class .= ' delayed';
if($id == 'assignedTo')
{
$class .= ' c-actions text-left';
if($task->assignedTo == $account) $class .= ' red';
$class .= ' has-btn text-left';
}
$title = '';
@@ -2274,20 +2273,20 @@ class taskModel extends model
echo "</span>";
break;
case 'name':
if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-caret-down"></i></a>';
if(!empty($task->product) && isset($branchGroups[$task->product][$task->branch])) echo "<span class='label label-info label-badge'>" . $branchGroups[$task->product][$task->branch] . '</span> ';
if(empty($task->children) and $task->module and isset($modulePairs[$task->module])) echo "<span class='label label-info label-badge'>" . $modulePairs[$task->module] . '</span> ';
if($child or !empty($task->parent)) echo '<span class="label">' . $this->lang->task->childrenAB . '</span> ';
if(!empty($task->team)) echo '<span class="label">' . $this->lang->task->multipleAB . '</span> ';
if($child or !empty($task->parent)) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';
if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';
echo $canView ? html::a($taskLink, $task->name, null, "style='color: $task->color'") : "<span style='color: $task->color'>$task->name</span>";
if($task->fromBug) echo html::a(helper::createLink('bug', 'view', "id=$task->fromBug"), "[BUG#$task->fromBug]", '_blank', "class='bug'");
if(!empty($task->children)) echo '<span class="task-toggle" data-id="' . $task->id . '">&nbsp;&nbsp;<i class="icon icon-double-angle-up"></i>&nbsp;&nbsp;</span>';
break;
case 'type':
echo $this->lang->task->typeList[$task->type];
break;
case 'status':
$storyChanged = (!empty($task->storyStatus) and $task->storyStatus == 'active' and $task->latestStoryVersion > $task->storyVersion);
$storyChanged ? print("<span class='warning'>{$this->lang->story->changed}</span> ") : print($this->lang->task->statusList[$task->status]);
$storyChanged ? print("<span class='status-changed'><span class='label label-dot'></span> {$this->lang->story->changed}</span>") : print("<span class='status-{$task->status}'><span class='label label-dot'></span> {$this->lang->task->statusList[$task->status]}</span>");
break;
case 'estimate':
echo round($task->estimate, 1);
@@ -2317,8 +2316,17 @@ class taskModel extends model
echo $task->realStarted;
break;
case 'assignedTo':
common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'list', '', '', 'iframe', true);
echo zget($users, $task->assignedTo);
$btnTextClass = '';
$assignedToText = $task->assignedTo;
if (empty($assignedToText))
{
$btnTextClass = 'text-primary';
$assignedToText = $this->lang->task->noAssigned;
}
else if ($assignedToText == $account) $btnTextClass = 'text-red';
$btnClass = $assignedToText == 'closed' ? ' disabled' : '';
echo html::a(helper::createLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id"), "<i class='icon icon-hand-right'></i> <span class='{$btnTextClass}'>{$assignedToText}</span>", '', "class='iframe btn btn-icon-left{$btnClass}'");
break;
case 'assignedDate':
echo substr($task->assignedDate, 5, 11);
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long