diff --git a/services/web/app/views/project/editor/file-tree.jade b/services/web/app/views/project/editor/file-tree.jade index d29343b16b..20654953a6 100644 --- a/services/web/app/views/project/editor/file-tree.jade +++ b/services/web/app/views/project/editor/file-tree.jade @@ -354,6 +354,9 @@ script(type='text/ng-template', id='newFolderModalTemplate') script(type="text/ng-template", id="uploadFileModalTemplate") .modal-header h3 #{translate("upload_files")} + span + .alert.alert-warning.small(ng-if="tooManyFiles") #{translate("maximum_files_uploaded_together", {max:"{{max_files}}"})} + .modal-body( fine-upload endpoint="/project/{{ project_id }}/upload" @@ -365,6 +368,7 @@ script(type="text/ng-template", id="uploadFileModalTemplate") multiple="true" on-complete-callback="onComplete" on-upload-callback="onUpload" + on-validate-batch="onValidateBatch" params="{'folder_id': parent_folder_id}" ) span #{translate("upload_files")} diff --git a/services/web/public/coffee/directives/fineUpload.coffee b/services/web/public/coffee/directives/fineUpload.coffee index e752d4e036..d5a994dd1d 100644 --- a/services/web/public/coffee/directives/fineUpload.coffee +++ b/services/web/public/coffee/directives/fineUpload.coffee @@ -14,6 +14,7 @@ define [ allowedExtensions: "=" onCompleteCallback: "=" onUploadCallback: "=" + onValidateBatch: "=" params: "=" } link: (scope, element, attrs) -> @@ -33,10 +34,11 @@ define [ onComplete = scope.onCompleteCallback or () -> onUpload = scope.onUploadCallback or () -> + onValidateBatch = scope.onValidateBatch or () -> params = scope.params or {} params._csrf = window.csrfToken - new qq.FineUploader + q = new qq.FineUploader element: element[0] multiple: multiple disabledCancelForFormUploads: true @@ -49,6 +51,7 @@ define [ callbacks: onComplete: onComplete onUpload: onUpload + onValidateBatch: onValidateBatch text: text template: """