show the number of selected files instead of the number of all files
This commit is contained in:
parent
ba4d540d03
commit
e8d052e4f0
|
@ -77,14 +77,20 @@
|
||||||
task.hasTaskName = taskNameResult.success;
|
task.hasTaskName = taskNameResult.success;
|
||||||
|
|
||||||
if (task.files) {
|
if (task.files) {
|
||||||
|
var selectedFileCount = 0;
|
||||||
|
|
||||||
for (var i = 0; i < task.files.length; i++) {
|
for (var i = 0; i < task.files.length; i++) {
|
||||||
var file = task.files[i];
|
var file = task.files[i];
|
||||||
file.fileName = getFileName(file);
|
file.fileName = getFileName(file);
|
||||||
file.length = parseInt(file.length);
|
file.length = parseInt(file.length);
|
||||||
file.selected = (file.selected == 'true');
|
file.selected = (file.selected === true || file.selected === 'true');
|
||||||
file.completedLength = parseInt(file.completedLength);
|
file.completedLength = parseInt(file.completedLength);
|
||||||
file.completePercent = (file.length > 0 ? file.completedLength / file.length * 100 : 0);
|
file.completePercent = (file.length > 0 ? file.completedLength / file.length * 100 : 0);
|
||||||
|
|
||||||
|
selectedFileCount += file.selected ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task.selectedFileCount = selectedFileCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return task;
|
return task;
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<div class="task-files">
|
<div class="task-files">
|
||||||
<span ng-bind="task.totalLength | readableVolumn"></span>
|
<span ng-bind="task.totalLength | readableVolumn"></span>
|
||||||
<a ng-href="#/task/detail/{{task.gid}}">
|
<a ng-href="#/task/detail/{{task.gid}}">
|
||||||
<span ng-if="task.files" ng-bind="('format.settings.file-count' | translate: {count: task.files.length})"></span>
|
<span ng-if="task.files" ng-bind="('format.settings.file-count' | translate: {count: task.selectedFileCount})"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value col-sm-8">
|
<div class="setting-value col-sm-8">
|
||||||
<span ng-bind="task.totalLength | readableVolumn"></span>
|
<span ng-bind="task.totalLength | readableVolumn"></span>
|
||||||
<span ng-if="task.files" ng-bind="('format.settings.file-count' | translate: {count: task.files.length})"></span>
|
<span ng-if="task.files" ng-bind="('format.settings.file-count' | translate: {count: task.selectedFileCount})"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" ng-if="task">
|
<div class="row" ng-if="task">
|
||||||
|
|
Reference in a new issue