From af0c80c0f1588e01243ac0f849fb0455d2d78a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fatay=20Onur=20=C5=9Eeng=C3=B6r?= Date: Sat, 19 Feb 2022 00:04:02 +0300 Subject: [PATCH 1/4] :recycle: Change parentNode references to parentElement --- kaplancloudapp/static/editor.js | 28 ++++++++++++++-------------- kaplancloudapp/static/main.js | 2 +- kaplancloudapp/static/project.js | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kaplancloudapp/static/editor.js b/kaplancloudapp/static/editor.js index fdf2c6b..1c85d6f 100644 --- a/kaplancloudapp/static/editor.js +++ b/kaplancloudapp/static/editor.js @@ -18,7 +18,7 @@ window.onload = function() { targetCell = targetCells[i]; targetCell.onfocus = function(e) { - currentSegment = this.parentNode; + currentSegment = this.parentElement; commentForm.style.display = 'block'; while (comments.children.length > 1) { @@ -28,8 +28,8 @@ window.onload = function() { var url = new URL(window.location.href); var params = {task:'lookup', - tu_id:this.parentNode.parentNode.parentNode.id, - s_id:this.parentNode.id}; + tu_id:this.parentElement.parentElement.parentElement.id, + s_id:this.parentElement.id}; url.search = new URLSearchParams(params).toString(); fetch(url) @@ -336,16 +336,16 @@ window.onload = function() { } function submitSegment(targetCell) { - let status = targetCell.parentNode.getAttribute('status'); + let status = targetCell.parentElement.getAttribute('status'); - targetCell.parentNode.classList.remove(('blank', 'draft', 'translated', 'error')); - targetCell.parentNode.classList.add(status); + targetCell.parentElement.classList.remove(('blank', 'draft', 'translated', 'error')); + targetCell.parentElement.classList.add(status); segmentFormData = new FormData(); segmentFormData.append('task', 'update_segment'); segmentFormData.append('status', status); - segmentFormData.append('tu_id', targetCell.parentNode.parentNode.parentNode.id); - segmentFormData.append('s_id', targetCell.parentNode.id); + segmentFormData.append('tu_id', targetCell.parentElement.parentElement.parentElement.id); + segmentFormData.append('s_id', targetCell.parentElement.id); segmentFormData.append('target', targetCell.innerHTML); fetch('', @@ -360,14 +360,14 @@ window.onload = function() { .then(response => { if (!response.ok) { - throw 'Could not update segment #' + targetCell.parentNode.id + '.'; + throw 'Could not update segment #' + targetCell.parentElement.id + '.'; } - targetCell.parentNode.classList.remove('error'); + targetCell.parentElement.classList.remove('error'); }) .catch(error => { console.error(error); - targetCell.parentNode.classList.add('error'); - targetCell.parentNode.classList.remove('blank', 'draft', 'translated'); + targetCell.parentElement.classList.add('error'); + targetCell.parentElement.classList.remove('blank', 'draft', 'translated'); }) @@ -379,10 +379,10 @@ function toggleExpand(span) if (span.textContent === 'expand_more') { span.textContent = 'expand_less'; - span.parentNode.nextSibling.nextElementSibling.hidden = false; + span.parentElement.nextSibling.nextElementSibling.hidden = false; } else { span.textContent = 'expand_more'; - span.parentNode.nextSibling.nextElementSibling.hidden = true; + span.parentElement.nextSibling.nextElementSibling.hidden = true; } } diff --git a/kaplancloudapp/static/main.js b/kaplancloudapp/static/main.js index 988b344..069e75f 100644 --- a/kaplancloudapp/static/main.js +++ b/kaplancloudapp/static/main.js @@ -1,5 +1,5 @@ window.onload = function() { document.getElementById('search-form-toggle').onclick = function() { - this.parentNode.className = "show"; + this.parentElement.className = "show"; } } diff --git a/kaplancloudapp/static/project.js b/kaplancloudapp/static/project.js index e989071..da3f33c 100644 --- a/kaplancloudapp/static/project.js +++ b/kaplancloudapp/static/project.js @@ -234,10 +234,10 @@ function toggleExpand(span) if (span.textContent === 'expand_more') { span.textContent = 'expand_less'; - span.parentNode.parentNode.nextSibling.nextElementSibling.hidden = false; + span.parentElement.parentElement.nextSibling.nextElementSibling.hidden = false; } else { span.textContent = 'expand_more'; - span.parentNode.parentNode.nextSibling.nextElementSibling.hidden = true; + span.parentElement.parentElement.nextSibling.nextElementSibling.hidden = true; } } From be6dce6915acc24d9263b5e0e16372e442bd1700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fatay=20Onur=20=C5=9Eeng=C3=B6r?= Date: Sat, 19 Feb 2022 00:07:15 +0300 Subject: [PATCH 2/4] :wrench: Combine pip lines --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a719c45..a331a86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,9 @@ ENV PYTHONUNBUFFERED=1 WORKDIR /code COPY . /code/ -RUN pip install -U pip -RUN pip install -r requirements.txt -RUN pip install gunicorn +RUN pip install -U pip && \ + pip install -r requirements.txt && \ + pip install gunicorn COPY docker-entrypoint.sh /usr/local/bin/ ENTRYPOINT ["docker-entrypoint.sh"] From 7991474085084428b3f7e509cb5f084b235a61db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fatay=20Onur=20=C5=9Eeng=C3=B6r?= Date: Sat, 19 Feb 2022 00:19:36 +0300 Subject: [PATCH 3/4] :bug: Exclude any directories that might be created from the download --- kaplancloudapp/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kaplancloudapp/views.py b/kaplancloudapp/views.py index 9e3d2a6..3ae6c09 100644 --- a/kaplancloudapp/views.py +++ b/kaplancloudapp/views.py @@ -159,7 +159,7 @@ def project(request, id): with Path(project_file.target_bilingualfile.path).open() as target_bf: tmpfile.write_bytes(target_bf.read_bytes) - tempdir_files = list(Path(tempdir).iterdir()) + tempdir_files = [tempdir_file for tempdir_file in list(Path(tempdir).iterdir()) if not tempdir_file.is_dir()] if len(tempdir_files) > 1: tmpzip_path = Path(tempdir) / 'target.zip' with zipfile.ZipFile(tmpzip_path, 'w') as tmpzip: From 72ec7543542e8c259b440b3674bdb717ccf78141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fatay=20Onur=20=C5=9Eeng=C3=B6r?= Date: Sat, 19 Feb 2022 00:21:10 +0300 Subject: [PATCH 4/4] :bookmark: version 0.2.1 --- kaplancloud/__init__.py | 2 +- kaplancloudaccounts/templates/accounts/change-password.html | 2 +- kaplancloudaccounts/templates/accounts/login.html | 2 +- kaplancloudaccounts/templates/accounts/register.html | 2 +- kaplancloudapp/templates/index.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kaplancloud/__init__.py b/kaplancloud/__init__.py index 7fd229a..fc79d63 100644 --- a/kaplancloud/__init__.py +++ b/kaplancloud/__init__.py @@ -1 +1 @@ -__version__ = '0.2.0' +__version__ = '0.2.1' diff --git a/kaplancloudaccounts/templates/accounts/change-password.html b/kaplancloudaccounts/templates/accounts/change-password.html index 65cad1f..cf6f60a 100644 --- a/kaplancloudaccounts/templates/accounts/change-password.html +++ b/kaplancloudaccounts/templates/accounts/change-password.html @@ -23,7 +23,7 @@
-

v0.2.0

+

v0.2.1

{% endblock %} diff --git a/kaplancloudaccounts/templates/accounts/login.html b/kaplancloudaccounts/templates/accounts/login.html index cec8994..834248e 100644 --- a/kaplancloudaccounts/templates/accounts/login.html +++ b/kaplancloudaccounts/templates/accounts/login.html @@ -40,7 +40,7 @@
-

v0.2.0

+

v0.2.1

{% endblock %} diff --git a/kaplancloudaccounts/templates/accounts/register.html b/kaplancloudaccounts/templates/accounts/register.html index 98b0c56..f1bedcf 100644 --- a/kaplancloudaccounts/templates/accounts/register.html +++ b/kaplancloudaccounts/templates/accounts/register.html @@ -23,7 +23,7 @@
-

v0.2.0

+

v0.2.1

{% endblock %} diff --git a/kaplancloudapp/templates/index.html b/kaplancloudapp/templates/index.html index 92127da..6bd0981 100644 --- a/kaplancloudapp/templates/index.html +++ b/kaplancloudapp/templates/index.html @@ -13,7 +13,7 @@ Clients--->
-

v0.2.0

+

v0.2.1

{% block div %}