* change blocks UI.

This commit is contained in:
Catouse
2016-04-14 11:50:13 +08:00
parent 3462afd856
commit c81ef5564d
6 changed files with 85 additions and 45 deletions
+4 -7
View File
@@ -5,19 +5,21 @@ body {background: #fafafa;}
.dashboard {position: relative;}
.dashboard .row {margin: 0 auto;}
.dashboard .panel-actions {margin-top: 0; margin-right: 0;}
.dashboard .table tr[data-url] td {cursor: pointer;}
.dashboard .panel-heading {line-height: 17px; height: 30px; position: relative;}
.dashboard .panel-actions {position: absolute; top: 0; right: 0; height: 30px;}
.dashboard .panel-action {display: block; float: left; height: 30px; width: 26px; text-align: center; line-height: 30px;}
.dashboard .panel-action:hover, .dashboard .panel-actions > .dropdown > a:hover {color: #333; background-color: #ddd; background-color: rgba(0,0,0,0.1)}
.dashboard .panel-title {font-size: 13px; color: #333}
.dashboard a.panel-title > .icon-double-angle-right {position: relative; opacity: 0; transition: opacity .2s, left .2s; left: -5px}
.dashboard .panel:hover a.panel-title > .icon-double-angle-right {opacity: 1; left: 0}
.dashboard a.panel-title:hover {color: #1a53ff}
.dashboard .panel {box-shadow: none; position: relative}
.dashboard .panel {box-shadow: 0 1px 3px rgba(0,0,0,.05); position: relative;}
.dashboard .panel-heading + .panel-body {position: absolute; left: 0; top: 30px; right: 0; bottom: 0}
.dashboard .panel-dragging-shadow {position: absolute;}
.dashboard-empty-message {text-align: center; margin-top: 100px;}
.dashboard-empty-message > h5 {margin-bottom: 20px;}
.outer {background-color: #fafafa}
.outer > .dashboard {margin-left: -10px; margin-right: -10px;}
/* panel style */
@@ -28,11 +30,6 @@ body {background: #fafafa;}
.panel-primary > .panel-heading,
.panel-info > .panel-heading,
.panel-danger > .panel-heading {color: #333; border: none; border-bottom: 1px solid rgba(0,0,0,.04);}
.panel-success > .panel-body,
.panel-warning > .panel-body,
.panel-primary > .panel-body,
.panel-info > .panel-body,
.panel-danger > .panel-body {box-shadow: inset 0 1px 100px rgba(255,255,255,.6);}
.panel-success {background: #d1fecb!important; border-color: #b0e4ac!important}
.panel-success > .panel-heading {background: #c5f7c1!important; }
.panel-warning {background: #fdfdc7!important; border-color: #e1e09a!important}
+1
View File
@@ -66,6 +66,7 @@ $(function()
});
$dashboard.find('ul.dashboard-actions').addClass('hide').children('li').addClass('right').appendTo($('#modulemenu > .nav'));
$dashboard.find('[data-toggle=tooltip]').tooltip({container: 'body'});
checkEmpty();
});
+1
View File
@@ -31,6 +31,7 @@ $lang->block->editBlock = 'Edit block';
$lang->block->ordersSaved = 'Sort have been saved';
$lang->block->confirmRemoveBlock = 'Are you sure remove block [{0}] ?';
$lang->block->emptyMessage = 'Nothing here, custom it now!';
$lang->block->dynamicInfo = "%s, %s <em>%s</em> %s <a href='%s'>%s</a>.";
$lang->block->default['product']['1']['title'] = $lang->productCommon . ' list';
$lang->block->default['product']['1']['block'] = 'list';
+2
View File
@@ -31,6 +31,8 @@ $lang->block->editBlock = '编辑区块';
$lang->block->ordersSaved = '排序已保存';
$lang->block->confirmRemoveBlock = '确定移除区块【{0}】吗?';
$lang->block->emptyMessage = '这里什么也没有。快来定制你的页面!';
$lang->block->refresh = '刷新';
$lang->block->dynamicInfo = "%s, %s <em>%s</em> %s <a href='%s'>%s</a>。";
$lang->block->default['product']['1']['title'] = $lang->productCommon . '列表';
$lang->block->default['product']['1']['block'] = 'list';
+2 -2
View File
@@ -27,7 +27,7 @@ if(isset($pageCSS)) css::internal($pageCSS);
<div class='panel panel-block <?php if(isset($block->params->color)) echo 'panel-' . $block->params->color;?>' id='block<?php echo $block->id?>' data-id='<?php echo $block->id?>' data-name='<?php echo $block->title?>' data-url='<?php echo $block->blockLink?>'>
<div class='panel-heading'>
<div class='panel-actions'>
<a href='javascript:;' class='refresh-panel panel-action'><i class='icon-repeat'></i></a>
<a href='javascript:;' class='refresh-panel panel-action' data-toggle='tooltip' title='<?php echo $lang->block->refresh ?>'><i class='icon-repeat'></i></a>
<div class='dropdown'>
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
<ul class='dropdown-menu pull-right'>
@@ -37,7 +37,7 @@ if(isset($pageCSS)) css::internal($pageCSS);
</div>
</div>
<?php if(isset($block->moreLink)):?>
<?php echo html::a($block->moreLink, $block->title . " <i class='icon-double-angle-right'></i>", null, "class='panel-title drag-disabled' title='$lang->more'"); ?>
<?php echo html::a($block->moreLink, $block->title . " <i class='icon-double-angle-right'></i>", null, "class='panel-title drag-disabled' title='$lang->more' data-toggle='tooltip' data-placement='right'"); ?>
<?php else: ?>
<span class='panel-title'><?php echo $block->title;?></span>
<?php endif; ?>
+75 -36
View File
@@ -10,41 +10,80 @@
* @link http://www.zentao.net
*/
?>
<table class='table table-data table-hover table-striped table-fixed block-project'>
<thead>
<tr class='text-center'>
<th><div class='text-left'><i class="icon-folder-close-alt icon"></i> <?php echo $lang->project->name;?></div></th>
<th width='80'><?php echo $lang->project->end;?></th>
<th width='50'><?php echo $lang->statusAB;?></th>
<th width='45'><?php echo $lang->project->totalEstimate;?></th>
<th width='45'><?php echo $lang->project->totalConsumed;?></th>
<th width='45'><?php echo $lang->project->totalLeft;?></th>
<th width='45'><?php echo $lang->project->progess;?></th>
</tr>
</thead>
<tbody>
<?php $id = 0; ?>
<?php foreach($projectStats as $project):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'";
$viewLink = $this->createLink('project', 'task', 'project=' . $project->id);
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-left' title='<?php echo $project->name;?>'><?php echo $project->name;?></td>
<td><?php echo $project->end;?></td>
<?php if(isset($project->delay)):?>
<td><?php echo $lang->project->delayed;?></td>
<?php else:?>
<td><?php echo $lang->project->statusList[$project->status];?></td>
<?php endif;?>
<td><?php echo $project->hours->totalEstimate;?></td>
<td><?php echo $project->hours->totalConsumed;?></td>
<td><?php echo $project->hours->totalLeft;?></td>
<td class='text-left'><?php echo $project->hours->progress;?>%</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php $projectboxId = 'projectbox-' . rand(); ?>
<div id='<?php echo $projectboxId ?>'>
<table class='table table-data table-hover table-striped table-fixed block-project'>
<thead>
<tr class='text-center'>
<th><div class='text-left'><?php echo $lang->project->name;?></div></th>
<th width='80'><?php echo $lang->project->end;?></th>
<th width='50'><?php echo $lang->statusAB;?></th>
<th width='45'><?php echo $lang->project->totalEstimate;?></th>
<th width='45'><?php echo $lang->project->totalConsumed;?></th>
<th width='45'><?php echo $lang->project->totalLeft;?></th>
<th width='100'><?php echo $lang->project->progess;?></th>
<th width='100'><?php echo $lang->project->burn;?></th>
</tr>
</thead>
<tbody>
<?php $id = 0; ?>
<?php foreach($projectStats as $project):?>
<?php
$appid = isset($_GET['entry']) ? "class='app-btn text-center' data-id='{$this->get->entry}'" : "class='text-center'";
$viewLink = $this->createLink('project', 'task', 'project=' . $project->id);
?>
<tr data-url='<?php echo empty($sso) ? $viewLink : $sso . $sign . 'referer=' . base64_encode($viewLink); ?>' <?php echo $appid?>>
<td class='text-left' title='<?php echo $project->name;?>'><?php echo html::a($this->createLink('project', 'task', 'project=' . $project->id), $project->name, '', "title='$project->name'");?></td>
<td><?php echo $project->end;?></td>
<?php if(isset($project->delay)):?>
<td><?php echo $lang->project->delayed;?></td>
<?php else:?>
<td class='status-<?php echo $project->status?>'><?php echo $lang->project->statusList[$project->status];?></td>
<?php endif;?>
<td><?php echo $project->hours->totalEstimate;?></td>
<td><?php echo $project->hours->totalConsumed;?></td>
<td><?php echo $project->hours->totalLeft;?></td>
<td class='text-left'>
<img class='progressbar' src='<?php echo $this->app->getWebRoot();?>theme/default/images/main/green.png' alt='' height='16' width='<?php echo $project->hours->progress == 0 ? 1 : round($project->hours->progress);?>'>
<small><?php echo $project->hours->progress;?>%</small>
</td>
<td id='spark-<?php echo $id++?>' class='spark text-left pd-0' values='<?php echo join(',', $project->burns);?>'></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<script>
if(typeof(dataTable) == 'function')$('.block-project').dataTable();
$(function()
{
var $projectbox = $('#<?php echo $projectboxId ?>');
var $sparks = $projectbox.find('.spark');
$sparks.filter(':lt(6)').addClass('sparked').projectLine();
$sparks = $sparks.not('.sparked');
var rowHeight = $sparks.first().closest('tr').outerHeight() - ($.zui.browser.ie === 8 ? 0.3 : 0);
var scrollFn = false, scrollStart, i, id, $spark;
$projectbox.parent().on('scroll.spark', function(e)
{
if(!$sparks.length)
{
$projectbox.off('scroll.spark');
return;
}
if(scrollFn) clearTimeout(scrollFn);
scrollFn = setTimeout(function()
{
scrollStart = Math.floor(($projectbox.scrollTop() - 30) / (rowHeight)) + 1;
for(i = scrollStart; i <= scrollStart + 7; i++)
{
id = '#spark-' + i;
$spark = $(id);
if($spark.hasClass('sparked')) continue;
$spark.addClass('sparked').projectLine();
$sparks = $sparks.not(id);
}
},100);
});
});
</script>