diff --git a/templates/repo.html b/templates/repo.html index 6b88b6095b..691dcc62c5 100644 --- a/templates/repo.html +++ b/templates/repo.html @@ -259,10 +259,10 @@

{% trans "Library Settings" %}


- {% trans "Keep full history" %}
- {% trans "Don't keep history" %}
- 0 %}checked="checked"{% endif %} /> {% trans "Only keep a period of history:" %} - {% trans "days" %}
+ {% trans "Keep full history" %}
+ {% trans "Don't keep history" %}
+ 0 %}checked="checked"{% endif %} /> {% trans "Only keep a period of history:" %} + {% trans "days" %}

diff --git a/templates/snippets/file_upload_progress_js.html b/templates/snippets/file_upload_progress_js.html index d964fc73bf..502724aa85 100644 --- a/templates/snippets/file_upload_progress_js.html +++ b/templates/snippets/file_upload_progress_js.html @@ -64,7 +64,6 @@ $('#upload-file-form .submit').click(function () { } $('#upload-file-form .error').addClass('hide'); - $.fn.MultiFile.disableEmpty(); // disable dummy element before submiting the form submitAndShowProgress($('#upload-file-form'), $('#upload-progress-con')) return false; @@ -76,12 +75,23 @@ $('#update-file-form .submit').click(function () { $('#update-file-form .error').html('{% trans "Please choose a file at first." %}').removeClass('hide'); return false; } + var file = $('#file-update-input')[0]; + var size = 0; + if (file.files && file.files.length > 0) { + size = file.files[0].size; + } + + if (size > {{ max_upload_file_size }}) { + $('#update-file-form .error').html('{% trans "File size surpasses the limit." %}').removeClass('hide'); + return false; + } + $('#update-file-form .error').addClass('hide'); submitAndShowProgress($('#update-file-form'), $('#update-progress-con')) return false; }); -$('#upload-progress-con .upload-cancel, #update-progress-con .unload-cancel').click(function() { +$('.upload-cancel').click(function() { location.reload(); });