* improve UI of assigntome block.

This commit is contained in:
Catouse
2018-06-25 10:52:29 +08:00
parent d55ad46c6a
commit e14b3753e3
2 changed files with 4 additions and 5 deletions

View File

@@ -1241,7 +1241,6 @@ class block extends control
$todo->begin = date::formatTime($todo->begin);
$todo->end = date::formatTime($todo->end);
}
if(empty($todos)) unset($hasViewPriv['todo']);
$this->view->todos = $todos;
}
if(isset($hasViewPriv['task']))
@@ -1255,7 +1254,6 @@ class block extends control
if(isset($params->taskNum)) $stmt->limit($params->taskNum);
$tasks = $stmt->fetchAll();
if(empty($tasks)) unset($hasViewPriv['task']);
$this->view->tasks = $tasks;
}
if(isset($hasViewPriv['bug']))
@@ -1269,7 +1267,6 @@ class block extends control
if(isset($params->bugNum)) $stmt->limit($params->bugNum);
$bugs = $stmt->fetchAll();
if(empty($bugs)) unset($hasViewPriv['bug']);
$this->view->bugs = $bugs;
}

View File

@@ -12,17 +12,19 @@
?>
<div id='assigntomeBlock'>
<ul class="nav nav-secondary">
<?php $isFirstTab = true; ?>
<?php foreach($hasViewPriv as $type => $bool):?>
<?php if($config->global->flow != 'full' && $config->global->flow != 'onlyTask' && $type == 'task') continue;?>
<?php if($config->global->flow != 'full' && $config->global->flow != 'onlyTest' && $type == 'bug') continue;?>
<li<?php if($type === 'todo') echo ' class="active"';?>><a data-tab href='#assigntomeTab-<?php echo $type;?>'><?php echo $lang->block->availableBlocks->$type;?></a></li>
<li<?php if($isFirstTab) {echo ' class="active"'; $isFirstTab = false;}?>><a data-tab href='#assigntomeTab-<?php echo $type;?>'><?php echo $lang->block->availableBlocks->$type;?></a></li>
<?php endforeach;?>
</ul>
<div class="tab-content">
<?php $isFirstTab = true; ?>
<?php foreach($hasViewPriv as $type => $bool):?>
<?php if($config->global->flow != 'full' && $config->global->flow != 'onlyTask' && $type == 'task') continue;?>
<?php if($config->global->flow != 'full' && $config->global->flow != 'onlyTest' && $type == 'bug') continue;?>
<div class="tab-pane<?php if($type === 'todo') echo ' active';?>" id="assigntomeTab-<?php echo $type?>">
<div class="tab-pane<?php if($isFirstTab) {echo ' active'; $isFirstTab = false;}?>" id="assigntomeTab-<?php echo $type?>">
<?php include "{$type}block.html.php";?>
</div>
<?php endforeach;?>