From de9df38595b7b3ca0a00a8046a1e16b40b9209a3 Mon Sep 17 00:00:00 2001 From: Oliver Roick Date: Wed, 5 Oct 2016 10:46:13 +0200 Subject: [PATCH 1/2] Read file name from URL field --- buckets/static/buckets/js/script.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/buckets/static/buckets/js/script.js b/buckets/static/buckets/js/script.js index cea2d1a60a..a56c283a69 100644 --- a/buckets/static/buckets/js/script.js +++ b/buckets/static/buckets/js/script.js @@ -156,11 +156,15 @@ e.preventDefault(); var el = e.target.parentElement.parentElement; - var url = el.getAttribute('data-upload-to') + '/' + el.querySelector('.file-link').innerHTML, - headers = { // 'content-type': 'application/json', - 'X-CSRFToken': getCookie('csrftoken')}, + var urlArray = el.querySelector('.file-url').value.split('/'), + headers = { 'X-CSRFToken': getCookie('csrftoken')}, form = new FormData(); - form.append('key', url); + + var url = urlArray[urlArray.length - 1]; + if (el.getAttribute('data-upload-to').length) { + url = el.getAttribute('data-upload-to') + '/' + url; + } + form.append('key', url); request('POST', '/s3/delete-resource/', form, headers, null, function() { el.querySelector('.file-url').value = ''; From 8dfe86a0282e7a029e8aa6d25938ac8e80f49432 Mon Sep 17 00:00:00 2001 From: Oliver Roick Date: Wed, 5 Oct 2016 10:46:42 +0200 Subject: [PATCH 2/2] 0.1.18 --- buckets/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buckets/__init__.py b/buckets/__init__.py index b04cffbb4b..60eb1afdd0 100644 --- a/buckets/__init__.py +++ b/buckets/__init__.py @@ -1 +1 @@ -__version__ = '0.1.17' +__version__ = '0.1.18'