From fc480dd559be0d525983ceae645e05ec36f03f6a Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 30 Jan 2025 01:54:12 +0400 Subject: [PATCH] Partially add file upload --- .../public/js/bootstrap.file-input.js | 24 ++++++ .../templates/aspirant/editReport.html | 77 +++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 src/main/resources/public/js/bootstrap.file-input.js diff --git a/src/main/resources/public/js/bootstrap.file-input.js b/src/main/resources/public/js/bootstrap.file-input.js new file mode 100644 index 0000000..2371503 --- /dev/null +++ b/src/main/resources/public/js/bootstrap.file-input.js @@ -0,0 +1,24 @@ +(function($) { +$.fn.bootstrapFileInput = function(loadDirectory = false) { + var fileInput = $(''); + fileInput.change(function() { + $('#file-input-list').html(''); + const files = $(this).prop('files'); + if (files.length == 0) { + return; + } + var filesList = ''; + $.each(files, function(index, file){ + filesList += '
' + file.name + '
'; + }); + $('#file-input-list').html(filesList); + }); + $(this).find('button.btn-choose').click(function() { + fileInput.click(); + }); + $(this).find('input').mousedown(function() { + return false; + }); + $(this).append(fileInput); +}; +})(jQuery); diff --git a/src/main/resources/templates/aspirant/editReport.html b/src/main/resources/templates/aspirant/editReport.html index 5894652..4efa54a 100644 --- a/src/main/resources/templates/aspirant/editReport.html +++ b/src/main/resources/templates/aspirant/editReport.html @@ -11,7 +11,84 @@
+
+ +
+
+ + +
+
+ +
+ + + +