* change product/browse UI.

This commit is contained in:
Catouse
2018-05-21 17:54:43 +08:00
parent e7c3b4c99c
commit 44ee45537b
9 changed files with 40 additions and 57 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ $(function()
$("a[data-toggle='showModuleModal']").click(function(){$('#showModuleModal').modal('show')});
<?php endif;?>
var $btnToolbar = $('#main #mainContent form.main-table .table-header .btn-toolbar:first');
var $btnToolbar = $('#main .table-header .btn-toolbar:first');
if($btnToolbar.length > 0)
{
<?php $mode = isset($this->config->datatable->$datatableId->mode) ? $this->config->datatable->$datatableId->mode : 'table';?>
+1 -34
View File
@@ -4,40 +4,7 @@ $(function()
$('.popoverStage').mouseout(function(){$(this).popover('hide')});
if($('#storyList thead th.w-title').width() < 150) $('#storyList thead th.w-title').width(150);
$(document).on('click', "#storyList tbody tr, .table-footer .check-all, #storyList thead .check-all", function(){showCheckedSummary();});
$(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();});
$(document).on('click', "#datatable-storyList table tr", function(){showCheckedSummary();});
})
function showCheckedSummary()
{
var $summary = $('#main #mainContent form.main-table .table-header .table-statistic');
var checkedTotal = 0;
var checkedEstimate = 0;
var checkedCase = 0;
$('[name^="storyIDList"]').each(function()
{
if($(this).prop('checked'))
{
checkedTotal += 1;
var taskID = $(this).val();
$tr = $("#storyList tbody tr[data-id='" + taskID + "']");
checkedEstimate += Number($tr.data('estimate'));
if(Number($tr.data('cases')) > 0) checkedCase += 1;
}
});
if(checkedTotal > 0)
{
rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%';
summary = checkedSummary.replace('%total%', checkedTotal)
.replace('%estimate%', checkedEstimate)
.replace('%rate%', rate)
$summary.html(summary);
}
}
});
function setQueryBar(queryID, title)
{
+32 -4
View File
@@ -99,9 +99,8 @@
</div>
<div class="main-col">
<div class="cell" id="queryBox"></div>
<form class="main-table table-story" data-ride="table" method="post" id='productStoryForm'>
<div class="table-header">
<div class="table-statistic"><?php echo $summary;?></div>
<form class="main-table table-story" method="post" id='productStoryForm'>
<div class="table-header fixed-right">
<nav class="btn-toolbar pull-right"></nav>
</div>
<?php
@@ -317,6 +316,7 @@
</div>
<?php endif;?>
</div>
<div class="table-statistic"><?php echo $summary;?></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php elseif(common::hasPriv('story', 'create')):?>
@@ -327,7 +327,6 @@
</form>
</div>
</div>
<?php js::set('checkedSummary', $lang->product->checkedSummary);?>
<script>
var moduleID = <?php echo $moduleID?>;
$('#module<?php echo $moduleID;?>').addClass('active');
@@ -343,5 +342,34 @@ else
ajaxGetSearchForm();
}
<?php endif;?>
$(function()
{
// Update table summary text
var checkedSummary = '<?php echo $lang->product->checkedSummary?>';
$('#productStoryForm').table(
{
statisticCreator: function(table)
{
var $checkedRows = table.$.find('tbody>tr.checked');
var checkedTotal = $checkedRows.length;
if(!checkedTotal) return;
var checkedEstimate = 0;
var checkedCase = 0;
$checkedRows.each(function()
{
var $row = $(this);
var data = $row.data();
checkedEstimate += data.estimate;
checkedCase += data.cases;
});
var rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%';
return checkedSummary.replace('%total%', checkedTotal)
.replace('%estimate%', checkedEstimate)
.replace('%rate%', rate);
}
})
});
</script>
<?php include '../../common/view/footer.html.php';?>
+3 -3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.
Binary file not shown.