diff --git a/subjects/templates/subjects/restore.html b/subjects/templates/subjects/restore.html
index eb88d5c..ee1e47b 100644
--- a/subjects/templates/subjects/restore.html
+++ b/subjects/templates/subjects/restore.html
@@ -72,10 +72,10 @@
{% csrf_token %}
+
+
+
+ - {% trans 'File not supported.' %}
+
+
+
+
-
+
@@ -127,10 +137,23 @@
// file selection
function FileSelectHandler(e) {
var files = e.target.files || e.dataTransfer.files,
- parent = $(e.target.offsetParent);
+ parent = $(e.target.offsetParent),
+ mimeTypes = $(e.target).data('mimetypes'),
+ submit_btn = $(e.target).closest("form").find("input[type='submit']");
+
+ $(".client-file-errors").hide();
+ $(submit_btn).prop('disable', false);
+ $(submit_btn).prop('disabled', false);
// process all File objects
for (var i = 0, f; f = files[i]; i++) {
+ if (!mimeTypes.includes(f.type)) {
+ $(submit_btn).prop('disable', true);
+ $(submit_btn).prop('disabled', true);
+
+ $(".client-file-errors").show();
+ }
+
parent.find('.filedrag').html(f.name);
}
}
--
libgit2 0.21.2