Merge branch '20.x' of github.com:easysoft/zentaopms into 20.x

This commit is contained in:
tianshujie98
2020-08-26 08:35:48 +08:00
3 changed files with 47 additions and 3 deletions

View File

@@ -24,6 +24,15 @@
#cards .program-detail .progress {height: 4px;}
#cards .program-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
#cards .pager {margin: 0; float: right;}
#cards .pager .btn{border: none}
#cards .pager .btn {border: none}
#cards .program-stages-container {margin: 0 -16px -16px -16px; padding: 0 4px; height: 46px; overflow-x: auto; position: relative;}
#cards .program-stages:after {content: ' '; width: 30px; display: block; right: -16px; top: 16px; bottom: -6px; z-index: 1; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); position: absolute;}
#cards .program-stages-row {position: relative; height: 30px; z-index: 0;}
#cards .program-stage-item {white-space: nowrap; position: absolute; top: 0; min-width: 48px; padding-top: 13px; color: #838A9D;}
#cards .program-stage-item > div {white-space: nowrap; overflow: visible; text-align: center; text-overflow: ellipsis;}
#cards .program-stage-item:before {content: ' '; display: block; width: 8px; height: 8px; border-radius: 50%; background: #D1D1D1; position: absolute; left: 50%; margin-left: -4px; top: 0; z-index: 1;}
#cards .program-stage-item + .program-stage-item:after {content: ' '; display: block; left: -50%; right: 50%; height: 2px; background-color: #D1D1D1; top: 3px; position: absolute; z-index: 0;}
#cards .program-stage-item.is-going {color: #333;}
#cards .program-stage-item.is-going::before {background-color: #0C64EB;}
.w-240px{width:240px;}

View File

@@ -7,7 +7,7 @@ $(function()
window.location.reload();
});
// Auto resize cards size
/* Auto resize cards size */
var minCardWidth = 280;
var $cards = $('#cards');
var resizeCards = function()
@@ -23,7 +23,22 @@ $(function()
resizeCards();
$(window).on('resize', resizeCards);
// Make cards clickable
/* Auto resize stages */
$cards.find('.program-stages-container').each(function()
{
var $container = $(this);
var $row = $container.children();
var totalWidth = 0;
$row.children().each(function()
{
var $item = $(this);
$item.css('left', totalWidth);
totalWidth += $item.width();
});
$row.css('minWidth', totalWidth);
});
/* Make cards clickable */
$cards.on('click', '.panel', function(e)
{
if(!$(e.target).closest('.panel-actions').length)

View File

@@ -35,7 +35,26 @@
<?php if($program->template === 'cmmi'): ?>
<div class='program-detail program-stages'>
<p class='text-muted'><?php echo $lang->program->ongoingStage; ?></p>
<?php
$programProjects = array();
foreach($program->projects as $project)
{
if(!$project->parent) $programProjects[] = $project;
}
?>
<?php if(empty($programProjects)): ?>
<div class='label label-outline'><?php echo zget($lang->project->statusList, $program->status);?></div>
<?php else: ?>
<div class='program-stages-container scrollbar-hover'>
<div class='program-stages-row'>
<?php foreach ($programProjects as $project): ?>
<div class='program-stage-item is-<?php echo $project->status;?><?php if($project->status !== 'wait') echo ' is-going'; ?>'>
<div><?php echo $project->name; ?></div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php else: ?>
<?php $project = $program->projects ? current($program->projects) : '';?>
@@ -58,6 +77,7 @@
</div>
</div>
</div>
<?php endforeach;?>
<div class='col-xs-12' id='cardsFooter'>
<?php $pager->show('right', 'pagerjs');?>