* 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
+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>