* Refact report view of product stories and project tasks.

This commit is contained in:
liugang
2018-04-19 11:58:41 +08:00
parent 6675f01b07
commit 83a01c416f
5 changed files with 123 additions and 124 deletions
+3
View File
@@ -3,3 +3,6 @@
.table-bordered tr > th:last-child, .table-bordered tr > td:last-child {border-right: 1px solid #ddd!important}
.panel-heading > strong > span {float: right; color: #29a8cd;}
.checkboxes {margin-bottom: 10px;}
.checkboxes .checkbox-primary {margin-bottom: 5px;}
+56 -59
View File
@@ -11,77 +11,74 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/chart.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<span class='btn btn-link btn-active-text'><span class='text'><?php echo $lang->story->report->common;?></span></span>
</div>
<div class="btn-toolbar pull-right">
<?php echo html::a($this->createLink('product', 'browse', "productID=$productID&browseType=$browseType&moduleID=$moduleID"), $lang->goback, '', "class='btn'");?>
<?php echo html::a($this->createLink('product', 'browse', "productID=$productID&browseType=$browseType&moduleID=$moduleID"), "<i class='icon icon-back icon-sm'> </i>" . $lang->goback, '', "class='btn btn-link'");?>
<div class='divider'></div>
<div class='page-title'>
<span class='text'><?php echo $lang->story->report->common;?></span>
</div>
</div>
</div>
<div id="mainContent" class='main-row'>
<div class='col-md-3 col-lg-2'>
<div class='panel panel-sm'>
<div class='side-col col-lg'>
<div class='panel'>
<div class='panel-heading'>
<strong><?php echo $lang->story->report->select;?></strong>
<div class='panel-title'><?php echo $lang->story->report->select;?></div>
</div>
<div class='panel-body' style='padding-top:0'>
<form method='post'>
<?php echo html::checkBox('charts', $lang->story->report->charts, $checkedCharts, '', 'block');?>
<?php echo html::selectAll('', "button", false, 'btn')?>
<?php echo html::submitButton($lang->story->report->create, '', 'btn btn-wide btn-primary');?>
<div class='panel-body'>
<form method='post' id='chartTypesForm'>
<div class='checkboxes'>
<?php echo html::checkBox('charts', $lang->story->report->charts, $checkedCharts, '', 'block');?>
</div>
<div class='btn-toolbar'>
<?php echo html::selectAll();?>
<?php echo html::submitButton($lang->story->report->create, '', 'btn btn-primary');?>
</div>
</form>
</div>
</div>
</div>
<div class='col-md-9 col-lg-10'>
<div class='panel panel-sm'>
<div class='panel-heading'>
<strong>
<?php echo $lang->story->report->common;?>
<div class="btn-group">
<?php unset($lang->report->typeList['']);?>
<?php foreach($lang->report->typeList as $type => $typeName):?>
<?php echo html::a("javascript:changeChartType(\"$type\")", $typeName, '', "class='btn btn-sm " . ($type == $chartType ? 'active' : '') . "'")?>
<?php endforeach;?>
</div>
<span><?php echo $lang->report->notice->help;?></span>
</strong>
</div>
<table class='table active-disabled'>
<?php foreach($charts as $chartType => $chartOption):?>
<tr class='text-top'>
<td>
<div class='chart-wrapper text-center'>
<h5><?php echo $lang->story->report->charts[$chartType];?></h5>
<div class='chart-canvas'><canvas id='chart-<?php echo $chartType ?>' width='<?php echo $chartOption->width;?>' height='<?php echo $chartOption->height;?>' data-responsive='true'></canvas></div>
</div>
</td>
<td style='width: 320px'>
<div style="overflow:auto;" class='table-wrapper'>
<table class='table table-condensed table-hover table-striped table-bordered table-chart' data-chart='<?php echo $chartOption->type; ?>' data-target='#chart-<?php echo $chartType ?>' data-animation='false'>
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->story->report->$chartType->item;?></th>
<th><?php echo $lang->story->report->value;?></th>
<th><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<?php foreach($datas[$chartType] as $key => $data):?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class='chart-color-dot icon-circle'></i></td>
<td class='chart-label'><?php echo $data->name;?></td>
<td class='chart-value'><?php echo $data->value;?></td>
<td><?php echo ($data->percent * 100) . '%';?></td>
</tr>
<?php endforeach;?>
</table>
</div>
</td>
</tr>
<div class='main-col'>
<div class='cell'>
<div class='btn-toolbar'>
<?php unset($lang->report->typeList['']);?>
<?php foreach($lang->report->typeList as $type => $typeName):?>
<?php echo html::a("javascript:changeChartType(\"$type\")", "<i class='icon icon-chart-{$type}'> </i>" . $typeName, '', "class='btn btn-link " . ($type == $chartType ? 'btn-active-line' : '') . "'")?>
<?php endforeach;?>
</table>
<div class='pull-right with-padding text-muted'><?php echo $lang->report->notice->help;?></div>
</div>
<?php foreach($charts as $chartType => $chartOption):?>
<div class='table-row chart-row'>
<div class='main-col'>
<div class='chart-wrapper text-center'>
<h4><?php echo $lang->story->report->charts[$chartType];?></h4>
<div class='chart-canvas'><canvas id='chart-<?php echo $chartType ?>' width='<?php echo $chartOption->width;?>' height='<?php echo $chartOption->height;?>' data-responsive='true'></canvas></div>
</div>
</div>
<div class='side-col col-xl'>
<div style="overflow:auto;" class='table-wrapper'>
<table class='table table-condensed table-hover table-striped table-bordered table-chart' data-chart='<?php echo $chartOption->type; ?>' data-target='#chart-<?php echo $chartType ?>' data-animation='false'>
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->story->report->$chartType->item;?></th>
<th><?php echo $lang->story->report->value;?></th>
<th><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<?php foreach($datas[$chartType] as $key => $data):?>
<tr class='text-center'>
<td class='chart-color'><i class='chart-color-dot'></i></td>
<td class='chart-label'><?php echo $data->name;?></td>
<td class='chart-value'><?php echo $data->value;?></td>
<td><?php echo ($data->percent * 100) . '%';?></td>
</tr>
<?php endforeach;?>
</table>
</div>
</div>
</div>
<?php endforeach;?>
</div>
</div>
</div>
+3
View File
@@ -3,3 +3,6 @@
.table-bordered tr > th:last-child, .table-bordered tr > td:last-child {border-right: 1px solid #ddd!important}
.panel-heading > strong > span {float: right; color: #29a8cd;}
.checkboxes {margin-bottom: 10px;}
.checkboxes .checkbox-primary {margin-bottom: 5px;}
+59 -63
View File
@@ -11,79 +11,75 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/chart.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['task']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['report']);?></small> <?php echo $lang->task->report->common;?></strong>
</div>
<div class='actions'>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php echo html::a($this->createLink('project', 'task', "projectID=$projectID&browseType=$browseType"), $lang->goback, '', "class='btn'");?>
<div class='divider'></div>
<div class='page-title'>
<span class='text'><?php echo $lang->task->report->common;?></span>
</div>
</div>
</div>
<div class='row'>
<div class='col-md-3 col-lg-2'>
<div class='panel panel-sm'>
<div id="mainContent" class='main-row'>
<div class='side-col col-lg'>
<div class='panel'>
<div class='panel-heading'>
<strong><?php echo $lang->task->report->select;?></strong>
<div class='panel-title'><?php echo $lang->task->report->select;?></div>
</div>
<div class='panel-body' style='padding-top:0'>
<form method='post'>
<?php echo html::checkBox('charts', $lang->task->report->charts, $checkedCharts, '', 'block')?>
<?php echo html::selectAll('', "button", false, 'btn-sm')?>
<?php echo html::submitButton($lang->task->report->create, "", 'btn btn-sm btn-primary');?>
<div class='panel-body'>
<form method='post' id='chartTypesForm'>
<div class='checkboxes'>
<?php echo html::checkBox('charts', $lang->task->report->charts, $checkedCharts, '', 'block')?>
</div>
<div class='btn-toolbar'>
<?php echo html::selectAll();?>
<?php echo html::submitButton($lang->task->report->create, "", 'btn btn-primary');?>
</div>
</form>
</div>
</div>
</div>
<div class='col-md-9 col-lg-10'>
<div class='panel panel-sm'>
<div class='panel-heading'>
<strong>
<?php echo $lang->task->report->common;?>
<div class="btn-group">
<?php foreach($lang->report->typeList as $type => $typeName):?>
<?php echo html::a("javascript:changeChartType(\"$type\")", $typeName, '', "class='btn btn-sm " . ($type == $chartType ? 'active' : '') . "'")?>
<?php endforeach;?>
</div>
<span><?php echo $lang->report->notice->help?></span>
</strong>
</div>
<table class='table active-disabled'>
<?php foreach($charts as $chartType => $chartOption):?>
<tr class='text-top'>
<td>
<div class='chart-wrapper text-center'>
<h5><?php echo $lang->task->report->charts[$chartType];?></h5>
<div class='chart-canvas'><canvas id='chart-<?php echo $chartType ?>' width='<?php echo $chartOption->width;?>' height='<?php echo $chartOption->height;?>' data-responsive='true'></canvas></div>
</div>
</td>
<td style='width: 320px'>
<div style="overflow:auto;" class='table-wrapper'>
<table class='table table-condensed table-hover table-striped table-bordered table-chart' data-chart='<?php echo $chartOption->type; ?>' data-target='#chart-<?php echo $chartType ?>' data-animation='false'>
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->task->report->$chartType->item;?></th>
<th><?php echo $lang->task->report->value;?></th>
<th><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<tbody>
<?php foreach($datas[$chartType] as $key => $data):?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class='chart-color-dot icon-circle'></i></td>
<td class='chart-label'><?php echo $data->name;?></td>
<td class='chart-value'><?php echo $data->value;?></td>
<td><?php echo ($data->percent * 100) . '%';?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</td>
</tr>
<div class='main-col'>
<div class='cell'>
<div class='btn-toolbar'>
<?php foreach($lang->report->typeList as $type => $typeName):?>
<?php echo html::a("javascript:changeChartType(\"$type\")", "<i class='icon icon-chart-{$type}'> </i>" . $typeName, '', "class='btn btn-link " . ($type == $chartType ? 'btn-active-line' : '') . "'")?>
<?php endforeach;?>
</table>
<div class='pull-right with-padding text-muted'><?php echo $lang->report->notice->help;?></div>
</div>
<?php foreach($charts as $chartType => $chartOption):?>
<div class='table-row chart-row'>
<div class='main-col'>
<div class='chart-wrapper text-center'>
<h4><?php echo $lang->task->report->charts[$chartType];?></h4>
<div class='chart-canvas'><canvas id='chart-<?php echo $chartType ?>' width='<?php echo $chartOption->width;?>' height='<?php echo $chartOption->height;?>' data-responsive='true'></canvas></div>
</div>
</div>
<div class='side-col col-xl'>
<div style="overflow:auto;" class='table-wrapper'>
<table class='table table-condensed table-hover table-striped table-bordered table-chart' data-chart='<?php echo $chartOption->type; ?>' data-target='#chart-<?php echo $chartType ?>' data-animation='false'>
<thead>
<tr>
<th class='chart-label' colspan='2'><?php echo $lang->task->report->$chartType->item;?></th>
<th><?php echo $lang->task->report->value;?></th>
<th><?php echo $lang->report->percent;?></th>
</tr>
</thead>
<tbody>
<?php foreach($datas[$chartType] as $key => $data):?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class='chart-color-dot'></i></td>
<td class='chart-label'><?php echo $data->name;?></td>
<td class='chart-value'><?php echo $data->value;?></td>
<td><?php echo ($data->percent * 100) . '%';?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
</div>
</div>
<?php endforeach;?>
</div>
</div>
</div>
+2 -2
View File
File diff suppressed because one or more lines are too long