Skip to content

Commit

Permalink
FIO-9377 added progressbar for for file upload with Display as image (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
HannaKurban authored Dec 11, 2024
1 parent f8557ec commit 8cf5ef5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/templates/bootstrap4/file/form.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@
</span>
</div>
{% }) %}
{% ctx.filesToUpload.forEach(function(file) { %}
{% if (file.status === 'progress') { %}
<div class="text-right">{{ctx.fileSize(file.size)}}</div>
<div class="status progress">
<div id={{file.id}} class="progress-bar" role="progressbar" aria-valuenow="{{file.progress}}" aria-valuemin="0" aria-valuemax="100" style="width: {{file.progress}}%" ref="progress">
<span class="sr-only">{{file.progress}}% {{ctx.t('Complete')}}</span>
</div>
</div>
{% } else { %}
<div class="status text-{{file.status === 'error' ? 'danger': file.status}}">{{ctx.t(file.message)}}</div>
{% } %}
{% }) %}
</div>
{% } %}
{% if (!ctx.disabled && (ctx.component.multiple || !ctx.files.length)) { %}
Expand Down
12 changes: 12 additions & 0 deletions src/templates/bootstrap5/file/form.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@
</span>
</div>
{% }) %}
{% ctx.filesToUpload.forEach(function(file) { %}
{% if (file.status === 'progress') { %}
<div class="text-end">{{ctx.fileSize(file.size)}}</div>
<div class="status progress">
<div id="{{file.id}}" class="progress-bar" role="progressbar" aria-valuenow="{{file.progress}}" aria-valuemin="0" aria-valuemax="100" style="width: {{file.progress}}%" ref="progress">
<span class="visually-hidden">{{file.progress}}% {{ctx.t('Complete')}}</span>
</div>
</div>
{% } else { %}
<div class="status text-{{file.status === 'error' ? 'danger': file.status}}">{{ctx.t(file.message)}}</div>
{% } %}
{% }) %}
</div>
{% } %}
{% if (!ctx.disabled && (ctx.component.multiple || !ctx.files.length)) { %}
Expand Down

0 comments on commit 8cf5ef5

Please sign in to comment.