Skip to content

Commit 4eea304

Browse files
authored
Add feedback for uploading image when creating invoice (#227)
1 parent 9c0d369 commit 4eea304

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

templates/invoices/new.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@
6161
</span>
6262
<div class="input">
6363
<div style="padding: 8px 0;">
64-
<input type="file" name="files" id="file" data-multiple-caption="{count} filer valda" multiple="multiple" required="required">
64+
<input type="file" name="files" id="file" data-multiple-caption="{count} filer valda" multiple="multiple" required="required" onchange="updateUploaded()">
6565
<label for="file" class="file">
6666
<span class="icon theme-color"><i class="fa fa-upload"></i></span>
6767
<span class="val">Välj filer</span>
6868
</label>
69+
<span id="filenames" style="margin-left:1em"></span>
6970
</div>
7071
</div>
7172
</div>
@@ -375,6 +376,11 @@ <h2>Fakturadelar</h2>
375376
this.expense_parts.splice(i, 1)
376377
}
377378
}
378-
})
379+
});
380+
381+
function updateUploaded() {
382+
const files = [...document.getElementById('file').files];
383+
document.getElementById('filenames').innerText = files.map(f => f.name).join(', ');
384+
}
379385
</script>
380386
{% endblock %}

0 commit comments

Comments
 (0)