* Adjust program kanban css.

This commit is contained in:
孙广明
2021-09-02 16:40:09 +08:00
parent 425f6265b6
commit 9bdd6a9af5
3 changed files with 57 additions and 56 deletions
+7 -16
View File
@@ -6,32 +6,23 @@
.board-item {border: 1px solid #EBEBEB; padding: 5px 10px; cursor: default; border-radius: 2px; background-color: #fff;}
.board-item:hover {border-color: #ccc;}
.board-item:first-child {margin-top: 5px;}
.board-item + .board-item {margin-top: 10px;}
.board-item {margin-top: 10px;}
.board-item:last-child {margin-bottom: 10px;}
.doing-td .board {margin-top: 5px;}
.doing-td .board:last-child {margin-bottom: 5px;}
#kanban {overflow-y: auto;}
#kanban tbody > tr > td {line-height: 20px;}
#kanban tbody > tr > td {border-right: 3px solid #fff; border-bottom: 2px solid #fff;}
#kanban tbody > tr > td {line-height: 24px;}
#kanban tbody > tr > td{border-right: 3px solid #fff; border-bottom: 2px solid #fff;}
#kanban thead > tr:first-child > th:not(:first-child) {border-right: 2px solid #fff; border-bottom: 2px solid #fff;}
#kanban thead > tr:last-child > th {border: 2px solid #fff;}
#kanban a {line-height: 24px;}
.fix-table-copy-wrapper thead > tr > th:first-child {background: none!important;}
.doing-td, .wait-project, .normal-plan, .normal-release {vertical-align: top !important;}
.doing-td {padding: 0 0 10px 0px !important;}
.doing-td .board{padding: 0px 10px; border-bottom: 2px solid #fff}
.doing-td .board:last-child{border-bottom: unset}
.doing-td .board:first-child{padding-top: 0; border-top: unset;}
.project-line {width: 100%; height: 2px; background: #fff}
.doing-td .table-row .table-col:last-child, .c-progress {width: 30px;}
.doing-td .table-row .table-col:first-child {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
.doing-td .emptyBoard {background: none; border: unset}
.table-grouped tbody > tr > td:first-child, .table-grouped thead > tr > th:first-child {padding-left: 3px;}
.scroll {overflow-x: hidden; overflow-y: auto;}
.fix-table-copy-wrapper thead > tr > th:first-child {background: none!important;}
+6
View File
@@ -258,6 +258,8 @@ class programModel extends model
$project->hours = zget($hours, $project->id, array());
$product->projects[$status][] = $project;
}
$product->rowspan = isset($product->projects['doing']) ? count($product->projects['doing']) > 0 ? count($product->projects['doing']) : 1 : 1;
}
}
@@ -266,6 +268,10 @@ class programModel extends model
{
$program->products = zget($productGroup, $programID, array());
$program->rowspan = count($program->products) > 0 ? count($program->products) : 1;
foreach($program->products as $product)
{
if(isset($product->projects['doing']) and count($product->projects['doing']) > 0) $program->rowspan += count($product->projects['doing']) - 1;
}
if(in_array($programID, $involvedPrograms))
{
+44 -40
View File
@@ -36,7 +36,7 @@
<tbody>
<?php foreach($programGroup as $programID => $program):?>
<tr>
<td class='lane-name text-ellipsis' style='background: <?php echo $lang->program->kanban->laneColorList[$colorIndex];?>; color: #fff; border: none' rowspan='<?php echo $program->rowspan;?>' title=<?php echo $program->name;?>><?php echo $program->name;?></td>
<td class='lane-name text-ellipsis' style='background: <?php echo $lang->program->kanban->laneColorList[$colorIndex];?>; color: #fff; border: none;' rowspan='<?php echo $program->rowspan;?>' title=<?php echo $program->name;?>><?php echo $program->name;?></td>
<?php $i = 0;?>
<?php if(!empty($program->products)):?>
<?php foreach($program->products as $productID => $product):?>
@@ -48,8 +48,8 @@
if(($doingCounts < $planCounts || $doingCounts < $releaseCount) and ($planCounts > 5 or $releaseCount > 5)) $scroll = 'scroll';
?>
<?php if($i != 0) echo '<tr>';?>
<td title=<?php echo $product->name;?>><?php echo $product->name;?></td>
<td class='normal-plan'>
<td title=<?php echo $product->name;?> rowspan='<?php echo $product->rowspan;?>'><?php echo $product->name;?></td>
<td class='normal-plan' rowspan='<?php echo $product->rowspan;?>'>
<div class="<?php echo $scroll;?>">
<?php foreach($product->plans as $planID => $plan):?>
<div class='board-item'>
@@ -62,29 +62,33 @@
<?php endforeach;?>
</div>
</td>
<td class='wait-project'>
<?php if(isset($product->projects['wait'])):?>
<?php foreach($product->projects['wait'] as $projectID => $project):?>
<div class='board-item' style='border-left: 3px solid #0991FF'>
<div class='table-row'>
<div class='table-col text-ellipsis text-left'>
<?php echo html::a($this->createLink('project', 'index', "projectID=$project->id"), $project->name);?>
</div>
</div>
</div>
<?php endforeach;?>
<?php endif;?>
</td>
<td class='doing-td project'>
<?php if(isset($product->projects['doing'])):?>
<?php foreach($product->projects['doing'] as $project):?>
<div class='board'>
<div class='board-item' <?php echo "style='border-left: 3px solid " . (isset($project->delay) ? 'red' : "#0BD986") . "'";?>>
<td class='wait-project' rowspan='<?php echo $product->rowspan?>'>
<div class="<?php echo $scroll;?>">
<?php if(isset($product->projects['wait'])):?>
<?php foreach($product->projects['wait'] as $projectID => $project):?>
<div class='board-item' style='border-left: 3px solid #0991FF'>
<div class='table-row'>
<div class='table-col text-ellipsis text-left'>
<?php echo html::a($this->createLink('project', 'index', "projectID=$project->id"), $project->name);?>
</div>
<div class='table-col text-ellipsis text-left'>
</div>
</div>
<?php endforeach;?>
<?php endif;?>
</div>
</td>
<?php if(isset($product->projects['doing'])):?>
<?php $index = 0;?>
<?php foreach($product->projects['doing'] as $projectID => $project):?>
<?php if($index != 0) echo "<tr>";?>
<td class='doing-td project'>
<div class='board'>
<div class='board-item' <?php echo "style='border-left: 3px solid " . (isset($project->delay) ? 'red' : "#0BD986") . "'";?>>
<div class='table-row'>
<div class='table-col'>
<?php echo html::a($this->createLink('project', 'index', "projectID=$project->id"), $project->name);?>
</div>
<div class='table-col'>
<div class="c-progress">
<?php $projectProgress = isset($project->hours->progress) ? $project->hours->progress : 0;?>
<div class='progress-pie' data-doughnut-size='90' data-color='#3CB371' data-value='<?php echo round($projectProgress);?>' data-width='24' data-height='24' data-back-color='#e8edf3'>
@@ -95,20 +99,16 @@
</div>
</div>
</div>
<?php endforeach;?>
<?php endif;?>
</td>
<td class='doing-td execution'>
<?php if(isset($product->projects['doing'])):?>
<?php foreach($product->projects['doing'] as $project):?>
<?php if(!empty($project->execution)):?>
<div class='board'>
<div class='board-item' <?php echo "style='border-left: 3px solid " . (isset($project->execution->delay) ? 'red' : "#0BD986") . "'";?>>
<div class='table-row'>
<div class='table-col text-ellipsis text-left'>
<div class='table-col'>
<?php echo html::a($this->createLink('execution', 'task', "executionID={$project->execution->id}"), $project->execution->name);?>
</div>
<div class='table-col text-ellipsis text-left'>
<div class='table-col'>
<div class="c-progress">
<?php $executionProgress = isset($project->execution->hours->progress) ? $project->execution->hours->progress : 0;?>
<div class='progress-pie' data-doughnut-size='90' data-color='#3CB371' data-value='<?php echo round($executionProgress);?>' data-width='24' data-height='24' data-back-color='#e8edf3'>
@@ -119,20 +119,15 @@
</div>
</div>
</div>
<?php else:?>
<div class='board'>
<div class='emptyBoard board-item'></div>
</div>
<?php endif;?>
<?php endforeach;?>
<?php endif;?>
</td>
<td class='normal-release'>
<?php if($index == 0):?>
<td class='normal-release' rowspan=<?php echo $product->rowspan;?>>
<div class="<?php echo $scroll;?>">
<?php foreach($product->releases as $releaseID => $release):?>
<div class='board-item'>
<div class='table-row'>
<div class='table-col text-ellipsis text-left'>
<div class='table-col'>
<?php $flag = $release->marker ? " <icon class='icon icon-flag red' title='{$lang->release->marker}'></icon> " : '';?>
<?php echo html::a($this->createLink('release', 'view', "releaseID=$release->id"), $release->name . $flag);?>
</div>
@@ -141,6 +136,15 @@
<?php endforeach;?>
</div>
</td>
<?php endif;?>
<?php if($index != 0) echo "</tr>";?>
<?php $index ++;?>
<?php endforeach;?>
<?php else:?>
<td></td>
<td></td>
<td></td>
<?php endif;?>
<?php if($i != 0) echo '</tr>';?>
<?php $i ++;?>
<?php endforeach;?>
@@ -166,12 +170,12 @@
<script>
$(function()
{
$('.board').height($('.project .board').height());
$('.table div.scroll').each(function()
{
var count = $(this).parent().siblings('td.project').children('.board').length >= 5 ? $(this).parent().siblings('td.project').children('.board').length : 5;
var preHeight = $(this).parent().siblings('td.project').children('.board').length >= 5 ? $('.board').outerHeight(true) : $(this).find('.board-item').outerHeight(true);
$(this).css('max-height', preHeight * count);
var count = $(this).closest('tr').find('td:first').attr('rowspan') >= 5 ? $(this).closest('tr').find('td:first').attr('rowspan') : 5;
var projectTdHeight = $(this).closest('tr').find('td.project .board').outerHeight(true) + 20;
var maxHeight = count > 5 ? projectTdHeight * count : projectTdHeight * count - 40;
$(this).css('max-height', maxHeight);
})
})
</script>