* Fix program kanban style.

This commit is contained in:
孙广明
2021-09-02 10:13:57 +08:00
parent 7f8da2c5ae
commit 1d1f77875a
2 changed files with 47 additions and 27 deletions
+5 -5
View File
@@ -16,17 +16,17 @@
#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: 10px 0px !important;}
.doing-td {padding: 0 0 10px 0px !important;}
.doing-td .board:first-child{padding-top: 0; border-top: unset;}
.doing-td .board{padding: 0px 10px; border-bottom: 2px solid #fff}
.doing-td .board:last-child{border-bottom: unset}
.doing-td .board {margin-top: 10px}
.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;}
.table-grouped tbody > tr > td:first-child, .table-grouped thead > tr > th:first-child {padding-left: 3px;}
.scroll {overflow-x: hidden; overflow-y: auto;}
+42 -22
View File
@@ -21,7 +21,7 @@
<table class="table no-margin table-grouped text-center" style='background: #efefef;'>
<thead>
<tr>
<th rowspan='2' class='w-20px' style='background: #32C5FF; border-bottom: none'></th>
<th rowspan='2' class='w-20px' style='background: #32C5FF; border: none'></th>
<th rowspan='2'><?php echo $lang->program->kanban->openProducts;?></th>
<th rowspan='2'><?php echo $lang->program->kanban->unexpiredPlans;?></th>
<th rowspan='2'><?php echo $lang->program->kanban->waitingProjects;?></th>
@@ -36,29 +36,38 @@
<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-right: 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):?>
<?php
$scroll = '';
$doingCounts = isset($product->projects['doing']) ? count($product->projects['doing']) : 0;
$planCounts = isset($product->plans) ? count($product->plans) : 0;
$releaseCount = isset($product->releases) ? count($product->releases) : 0;
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'>
<?php foreach($product->plans as $planID => $plan):?>
<div class='board-item'>
<div class='table-row'>
<div class='table-col'>
<?php echo html::a($this->createLink('productplan', 'view', "planID=$plan->id"), $plan->title);?>
<div class="<?php echo $scroll;?>">
<?php foreach($product->plans as $planID => $plan):?>
<div class='board-item'>
<div class='table-row'>
<div class='table-col text-ellipsis text-left'>
<?php echo html::a($this->createLink('productplan', 'view', "planID=$plan->id"), $plan->title);?>
</div>
</div>
</div>
<?php endforeach;?>
</div>
<?php endforeach;?>
</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 #ccc'>
<div class='board-item' style='border-left: 3px solid #0991FF'>
<div class='table-row'>
<div class='table-col'>
<div class='table-col text-ellipsis text-left'>
<?php echo html::a($this->createLink('project', 'index', "projectID=$project->id"), $project->name);?>
</div>
</div>
@@ -72,10 +81,10 @@
<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'>
<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'>
<div class='table-col text-ellipsis text-left'>
<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'>
@@ -96,10 +105,10 @@
<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'>
<div class='table-col text-ellipsis text-left'>
<?php echo html::a($this->createLink('execution', 'task', "executionID={$project->execution->id}"), $project->execution->name);?>
</div>
<div class='table-col'>
<div class='table-col text-ellipsis text-left'>
<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'>
@@ -117,16 +126,18 @@
<?php endif;?>
</td>
<td class='normal-release'>
<?php foreach($product->releases as $releaseID => $release):?>
<div class='board-item'>
<div class='table-row'>
<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 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'>
<?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>
</div>
</div>
<?php endforeach;?>
</div>
<?php endforeach;?>
</td>
<?php if($i != 0) echo '</tr>';?>
<?php $i ++;?>
@@ -151,6 +162,15 @@
<?php endforeach;?>
</div>
<script>
$(function(){ $('.board').height($('.project .board').height()); })
$(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);
})
})
</script>
<?php include '../../common/view/footer.html.php';?>