From 8ca33aa9e78529cb097f83d83145d5144fd9c5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 12:00:29 +0100 Subject: [PATCH 01/14] UI: Hide template extensions manage update btn delete temporarily --- .../templates/extensions/manage/update.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/extensions/templates/extensions/manage/update.html b/extensions/templates/extensions/manage/update.html index d4515265..6bc9a4b3 100644 --- a/extensions/templates/extensions/manage/update.html +++ b/extensions/templates/extensions/manage/update.html @@ -126,13 +126,15 @@ -
- {# TODO: Make deletion work #} - - {% trans 'Delete Extension' %} - -
- + {# TODO: remove comment to show btn delete if deletion works #} + {% comment %} +
+ {# TODO: Make deletion work #} + + {% trans 'Delete Extension' %} + +
+ {% endcomment %} -- 2.30.2 From b1c541e7e657c8e9bec5e091af91777fc48066bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 12:56:16 +0100 Subject: [PATCH 02/14] Fix: Fix after reviewing (while review is in moderation), the Be First to Review still shows Part of #40 --- extensions/templates/extensions/detail.html | 6 ++++-- ratings/templates/ratings/components/summary.html | 3 ++- ratings/templates/ratings/rating_list.html | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/extensions/templates/extensions/detail.html b/extensions/templates/extensions/detail.html index 4b134893..93b76cba 100644 --- a/extensions/templates/extensions/detail.html +++ b/extensions/templates/extensions/detail.html @@ -279,9 +279,11 @@ {% endif %} {% for rating in extension.ratings.listed_texts|slice:":3" %} {% include "ratings/components/review.html" %} - {% empty %} - {% trans "Be the first to review." %} {% endfor %} + + {% if not extension.ratings.listed.count and not my_rating %} + {% trans "Be the first to review." %} + {% endif %}
{# Rating #} diff --git a/ratings/templates/ratings/components/summary.html b/ratings/templates/ratings/components/summary.html index db2544b2..8dd815af 100644 --- a/ratings/templates/ratings/components/summary.html +++ b/ratings/templates/ratings/components/summary.html @@ -32,8 +32,9 @@ {% endfor %}
+ {% elif not my_rating %} + Be the first to review. {% else %} - Be the first to review. {% endif %}
diff --git a/ratings/templates/ratings/rating_list.html b/ratings/templates/ratings/rating_list.html index 8e2a4d34..593e49e4 100644 --- a/ratings/templates/ratings/rating_list.html +++ b/ratings/templates/ratings/rating_list.html @@ -27,9 +27,11 @@ {% endif %} {% for rating in object_list %} {% include "ratings/components/review.html" %} - {% empty %} - {% trans "Be the first to review." %} {% endfor %} + + {% if not extension.ratings.listed.count and not my_rating %} + {% trans "Be the first to review." %} + {% endif %}
-- 2.30.2 From 4fbb7aa9cc9df2d7f364fa816532d77c344b6045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 13:04:34 +0100 Subject: [PATCH 03/14] UI: Change style ext-detail info links Part of #40 --- common/static/common/styles/_extension.sass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/static/common/styles/_extension.sass b/common/static/common/styles/_extension.sass index 773a37b0..834edaaf 100644 --- a/common/static/common/styles/_extension.sass +++ b/common/static/common/styles/_extension.sass @@ -118,6 +118,8 @@ a overflow: hidden + // TODO: consider changing text-decoration underlines to border-bottoms for improved, more spatious vertical spacings + text-decoration: underline text-overflow: ellipsis white-space: nowrap -- 2.30.2 From cb01fcdc2fe356ba2e0e1e418655b4f625a4318d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 14:00:36 +0100 Subject: [PATCH 04/14] UI: Show template extensions latest item expanded Part of #40 --- extensions/templates/extensions/version_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/templates/extensions/version_list.html b/extensions/templates/extensions/version_list.html index 6a8dbe70..01cf8907 100644 --- a/extensions/templates/extensions/version_list.html +++ b/extensions/templates/extensions/version_list.html @@ -23,7 +23,7 @@
{% for version in extension.versions.exclude_deleted %} {% if version.is_listed or is_maintainer %} -
+
{{ version.version }} -- 2.30.2 From 616950a3e3751a105fdcc1c8c2ca498a37ec2839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 15:37:15 +0100 Subject: [PATCH 05/14] UI: Add js manage function resetImgUploadForm to clear input img Part of #40 --- .../static/extensions/scripts/manage.js | 29 +++++++++++++++++++ .../manage/components/add_previews.html | 1 + 2 files changed, 30 insertions(+) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 323e5fa6..9f6f4350 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -13,6 +13,7 @@ function appendImageUploadForm() { +
@@ -31,9 +32,35 @@ function appendImageUploadForm() { btnAddImage.addEventListener('click', function(ev) { ev.preventDefault(); appendImageUploadForm(); + + // Call function resetImgUploadForm + resetImgUploadForm(); + return false; }); +// Create function resetImgUploadForm +function resetImgUploadForm() { + const btnResetImgUploadForm = document.querySelectorAll('.js-btn-reset-img-upload-form'); + + btnResetImgUploadForm.forEach(function(item) { + item.addEventListener('click', function(e) { + e.preventDefault(); + + // Find the associated image input (assuming it's a sibling) + const inputImg = item.previousElementSibling; + + // Reset the selected image (if any) + inputImg.value = ''; // Clear the input value + }); + }); +} + +// Create function init +function init() { + resetImgUploadForm(); +} + // Configure tag selection, if present on the page if (tagInput) { const taggerOptions = { @@ -51,3 +78,5 @@ if (tagInput) { tagger(tagInput, taggerOptions); // FIXME: changes to the tags input don't trigger form change }; + +init(); diff --git a/extensions/templates/extensions/manage/components/add_previews.html b/extensions/templates/extensions/manage/components/add_previews.html index 441d7fd4..c3e21603 100644 --- a/extensions/templates/extensions/manage/components/add_previews.html +++ b/extensions/templates/extensions/manage/components/add_previews.html @@ -9,6 +9,7 @@
{% include "common/components/field.html" with field=inlineform.source label='File' %} +
{% include "common/components/field.html" with field=inlineform.caption label='Caption' %} -- 2.30.2 From efcb4678c2b06d6fbf350ab4a2254577c4efbb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 15:51:01 +0100 Subject: [PATCH 06/14] UI: Add js manage function removeImgUploadForm to remove row item Part of #40 --- .../static/extensions/scripts/manage.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 9f6f4350..0a15da0d 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -14,6 +14,7 @@ function appendImageUploadForm() { accept="image/*" class="form-control" id="id_${formsetPrefix}-${i}-source"> +
@@ -23,7 +24,7 @@ function appendImageUploadForm() {
`; - formRow.classList.add('row', 'ext-edit-field-row'); + formRow.classList.add('row', 'ext-edit-field-row', 'js-ext-edit-field-row'); formRow.innerHTML = newFormHTML; formsetContainer.appendChild(formRow); inputTotalForms.value = parseInt(inputTotalForms.value) + 1; @@ -33,12 +34,32 @@ btnAddImage.addEventListener('click', function(ev) { ev.preventDefault(); appendImageUploadForm(); - // Call function resetImgUploadForm + // Init function removeImgUploadForm + removeImgUploadForm(); + + // Init function resetImgUploadForm resetImgUploadForm(); return false; }); +// Create function removeImgUploadForm +function removeImgUploadForm() { + const btnRemoveImgUploadForm = document.querySelectorAll('.js-btn-remove-img-upload-form'); + + btnRemoveImgUploadForm.forEach(function(item) { + item.addEventListener('click', function(e) { + e.preventDefault(); + + // Find the row parent + const rowParent = this.closest('.js-ext-edit-field-row'); + + // Remove the row + rowParent.remove(); + }); + }); +} + // Create function resetImgUploadForm function resetImgUploadForm() { const btnResetImgUploadForm = document.querySelectorAll('.js-btn-reset-img-upload-form'); -- 2.30.2 From 4d8df7966af8b649bc5afacfa9bc658685c8f086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 15:58:07 +0100 Subject: [PATCH 07/14] UI: Improve template component add_previews btns spacings Part of #40 --- extensions/static/extensions/scripts/manage.js | 4 ++-- .../templates/extensions/manage/components/add_previews.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 0a15da0d..b2780a8d 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -13,8 +13,8 @@ function appendImageUploadForm() { - - + +
diff --git a/extensions/templates/extensions/manage/components/add_previews.html b/extensions/templates/extensions/manage/components/add_previews.html index c3e21603..5529061e 100644 --- a/extensions/templates/extensions/manage/components/add_previews.html +++ b/extensions/templates/extensions/manage/components/add_previews.html @@ -9,7 +9,7 @@
{% include "common/components/field.html" with field=inlineform.source label='File' %} - +
{% include "common/components/field.html" with field=inlineform.caption label='Caption' %} -- 2.30.2 From 0d67bf5d357bdc845b422d1d4d6ebbce61f0f262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 18:34:59 +0100 Subject: [PATCH 08/14] UI: Improve js manage function appendImageUploadForm layout base Part of #40 --- common/static/common/styles/_extension.sass | 6 +++ .../static/extensions/scripts/manage.js | 43 ++++++++++++------- .../manage/components/add_previews.html | 34 ++++++++------- 3 files changed, 51 insertions(+), 32 deletions(-) diff --git a/common/static/common/styles/_extension.sass b/common/static/common/styles/_extension.sass index 834edaaf..9e25e5e3 100644 --- a/common/static/common/styles/_extension.sass +++ b/common/static/common/styles/_extension.sass @@ -321,6 +321,7 @@ width: var(--preview-thumbnail-max-size) .previews-list-item-thumbnail-img + background-color: var(--background-color) background-position: center background-size: cover border-radius: var(--border-radius) @@ -350,6 +351,11 @@ pointer-events: none user-select: none + .form-control + &[type="file"] + font-size: var(--font-size-extra-small) + max-width: 50% + .ext-version-history summary display: flex diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index b2780a8d..686d4bca 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -9,22 +9,30 @@ function appendImageUploadForm() { const i = inputTotalForms.value; const formRow = document.createElement('div'); const newFormHTML = ` -
- - - -
-
-
- -
+
+
+
+
+
+
+ + +
+
+ +
    +
  • + +
  • +
  • + +
  • +
+
+
`; - formRow.classList.add('row', 'ext-edit-field-row', 'js-ext-edit-field-row'); + formRow.classList.add('ext-edit-field-row', 'js-ext-edit-field-row'); formRow.innerHTML = newFormHTML; formsetContainer.appendChild(formRow); inputTotalForms.value = parseInt(inputTotalForms.value) + 1; @@ -68,8 +76,11 @@ function resetImgUploadForm() { item.addEventListener('click', function(e) { e.preventDefault(); - // Find the associated image input (assuming it's a sibling) - const inputImg = item.previousElementSibling; + // Find the row parent + const rowParent = this.closest('.js-ext-edit-field-row'); + + // Find the input image + const inputImg = rowParent.querySelector('.js-input-img'); // Reset the selected image (if any) inputImg.value = ''; // Clear the input value diff --git a/extensions/templates/extensions/manage/components/add_previews.html b/extensions/templates/extensions/manage/components/add_previews.html index 5529061e..0bc5607e 100644 --- a/extensions/templates/extensions/manage/components/add_previews.html +++ b/extensions/templates/extensions/manage/components/add_previews.html @@ -1,23 +1,25 @@ {% load common %} {# Upload new preview images #} {% load i18n %} -
- {{ add_preview_formset.management_form }} - {{ add_preview_formset.non_form_errors }} - {% for newform in add_preview_formset %} - {% with inlineform=newform|add_form_classes %} -
-
- {% include "common/components/field.html" with field=inlineform.source label='File' %} - +
+
+ {{ add_preview_formset.management_form }} + {{ add_preview_formset.non_form_errors }} + {% for newform in add_preview_formset %} + {% with inlineform=newform|add_form_classes %} +
+
+ {% include "common/components/field.html" with field=inlineform.source label='File' %} + +
+
+ {% include "common/components/field.html" with field=inlineform.caption label='Caption' %} +
-
- {% include "common/components/field.html" with field=inlineform.caption label='Caption' %} -
-
- {{ inlineform.non_form_errors }} - {% endwith %} - {% endfor %} + {{ inlineform.non_form_errors }} + {% endwith %} + {% endfor %} +
-- 2.30.2 From c8d88b92ecf27ca995d2a0f5ffba5dcf974cf531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 19:09:26 +0100 Subject: [PATCH 09/14] UI: Add js manage function setImgUploadFormThumbnail base Part of #40 --- .../static/extensions/scripts/manage.js | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 686d4bca..30753aa2 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -1,3 +1,5 @@ +// TODO: improve and refactor variable namings + const formsetContainer = document.getElementById('add-image-container'); const form = document.getElementById('update-extension-form'); const btnAddImage = document.getElementById('btn-add-image'); @@ -11,7 +13,7 @@ function appendImageUploadForm() { const newFormHTML = `
-
+
@@ -48,6 +50,9 @@ btnAddImage.addEventListener('click', function(ev) { // Init function resetImgUploadForm resetImgUploadForm(); + // Init function setImgUploadFormThumbnail + setImgUploadFormThumbnail(); + return false; }); @@ -82,8 +87,37 @@ function resetImgUploadForm() { // Find the input image const inputImg = rowParent.querySelector('.js-input-img'); + // Find the input image thumbnail + const inputImgThumbnail = rowParent.querySelector('.js-input-img-thumbnail'); + // Reset the selected image (if any) inputImg.value = ''; // Clear the input value + + // Reset the selected image thumbnail + inputImgThumbnail.removeAttribute('style'); + }); + }); +} + +// Create function setImgUploadFormThumbnail +function setImgUploadFormThumbnail() { + const inputImg = document.querySelectorAll('.js-input-img'); + + inputImg.forEach(function(item) { + item.addEventListener('change', function(e) { + // Init file image + const file = event.target.files[0]; + + // Find the row parent + const rowParent = this.closest('.js-ext-edit-field-row'); + + // Find the thumbnail image + const inputImgThumbnail = rowParent.querySelector('.js-input-img-thumbnail'); + + // Set thumbnail img + if (file) { + inputImgThumbnail.style.backgroundImage = `url('${URL.createObjectURL(file)}')`; + } }); }); } -- 2.30.2 From bcef0f3b35f9ddaf44bec7cf72e008e76bf71240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 20:09:59 +0100 Subject: [PATCH 10/14] UI: Improce js manage function removeImgUploadForm display and layout Part of #40 --- .../static/extensions/scripts/manage.js | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 30753aa2..d70b0865 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -12,15 +12,19 @@ function appendImageUploadForm() { const formRow = document.createElement('div'); const newFormHTML = `
-
-
+
+
+
+ +
+
-
+
  • @@ -90,11 +94,18 @@ function resetImgUploadForm() { // Find the input image thumbnail const inputImgThumbnail = rowParent.querySelector('.js-input-img-thumbnail'); + // Find the input image thumbnail icon + const inputImgThumbnailIcon = rowParent.querySelector('.js-input-img-thumbnail-icon'); + // Reset the selected image (if any) inputImg.value = ''; // Clear the input value // Reset the selected image thumbnail inputImgThumbnail.removeAttribute('style'); + + // Hide the selected image thumbnail icon + inputImgThumbnailIcon.classList.add('d-flex'); + inputImgThumbnailIcon.classList.remove('d-none'); }); }); } @@ -114,10 +125,17 @@ function setImgUploadFormThumbnail() { // Find the thumbnail image const inputImgThumbnail = rowParent.querySelector('.js-input-img-thumbnail'); + // Find the input image thumbnail icon + const inputImgThumbnailIcon = rowParent.querySelector('.js-input-img-thumbnail-icon'); + // Set thumbnail img if (file) { inputImgThumbnail.style.backgroundImage = `url('${URL.createObjectURL(file)}')`; } + + // Hide the selected image thumbnail icon + inputImgThumbnailIcon.classList.add('d-none'); + inputImgThumbnailIcon.classList.remove('d-flex'); }); }); } -- 2.30.2 From 0c29a23f421cc9d6ca3135b215697119f6edde83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Mon, 26 Feb 2024 20:29:04 +0100 Subject: [PATCH 11/14] UI: Add js manage function appendImageUploadForm transition Part of #40 --- extensions/static/extensions/scripts/manage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index d70b0865..c1e610ec 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -38,10 +38,15 @@ function appendImageUploadForm() {
`; - formRow.classList.add('ext-edit-field-row', 'js-ext-edit-field-row'); + formRow.classList.add('ext-edit-field-row', 'fade', 'js-ext-edit-field-row'); formRow.innerHTML = newFormHTML; formsetContainer.appendChild(formRow); inputTotalForms.value = parseInt(inputTotalForms.value) + 1; + + setTimeout(function() { + // TODO: fix jump coming from grid gap on parent + formRow.classList.add('show'); + }, 20); } btnAddImage.addEventListener('click', function(ev) { -- 2.30.2 From 6659ec35cefd7c05974932815f13df1348aeb774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Tue, 27 Feb 2024 10:32:16 +0100 Subject: [PATCH 12/14] UI: Add js manage function resetImgUploadForm to clear input img captio Part of #40 --- extensions/static/extensions/scripts/manage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index c1e610ec..50efe9fc 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -22,7 +22,7 @@ function appendImageUploadForm() {
- +
@@ -96,6 +96,9 @@ function resetImgUploadForm() { // Find the input image const inputImg = rowParent.querySelector('.js-input-img'); + // Find the input image caption + const inputImgCaption = rowParent.querySelector('.js-input-img-caption'); + // Find the input image thumbnail const inputImgThumbnail = rowParent.querySelector('.js-input-img-thumbnail'); @@ -105,6 +108,9 @@ function resetImgUploadForm() { // Reset the selected image (if any) inputImg.value = ''; // Clear the input value + // Reset the selected image caption + inputImgCaption.value=''; + // Reset the selected image thumbnail inputImgThumbnail.removeAttribute('style'); -- 2.30.2 From 235874265cffe37ae3ec9d974379454d41578190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Tue, 27 Feb 2024 11:02:26 +0100 Subject: [PATCH 13/14] UI: Add js manage img upload functions to template add_previews Part of #40 --- .../static/extensions/scripts/manage.js | 20 ++++++++++++- .../manage/components/add_previews.html | 29 ++++++++++++++----- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 50efe9fc..8ff9908e 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -7,13 +7,29 @@ const formsetPrefix = 'form'; const inputTotalForms = document.getElementById(`id_${formsetPrefix}-TOTAL_FORMS`); const tagInput = document.getElementById('id_tags'); +// Create function addImgUploadFormClasses +function addImgUploadFormClasses() { + // Function intializes img upload widgets' custom classes for js manage + const inputImgHelper = document.querySelector('.js-input-img-helper'); + const inputImgCaptionHelper = document.querySelector('.js-input-img-caption-helper'); + + inputImgHelper.querySelector('input') + .classList.add('js-input-img'); + + inputImgHelper.querySelector('label') + .classList.add('d-none'); + + inputImgCaptionHelper.querySelector('input') + .classList.add('js-input-img-caption'); +} + function appendImageUploadForm() { const i = inputTotalForms.value; const formRow = document.createElement('div'); const newFormHTML = `
-
+
@@ -83,6 +99,7 @@ function removeImgUploadForm() { } // Create function resetImgUploadForm +// TODO: fix function resetImgUploadForm on pageload function resetImgUploadForm() { const btnResetImgUploadForm = document.querySelectorAll('.js-btn-reset-img-upload-form'); @@ -153,6 +170,7 @@ function setImgUploadFormThumbnail() { // Create function init function init() { + addImgUploadFormClasses(); resetImgUploadForm(); } diff --git a/extensions/templates/extensions/manage/components/add_previews.html b/extensions/templates/extensions/manage/components/add_previews.html index 0bc5607e..c4bf3809 100644 --- a/extensions/templates/extensions/manage/components/add_previews.html +++ b/extensions/templates/extensions/manage/components/add_previews.html @@ -7,13 +7,28 @@ {{ add_preview_formset.non_form_errors }} {% for newform in add_preview_formset %} {% with inlineform=newform|add_form_classes %} -
-
- {% include "common/components/field.html" with field=inlineform.source label='File' %} - -
-
- {% include "common/components/field.html" with field=inlineform.caption label='Caption' %} +
+
+
+
+
+ +
+
+
+
+
+ {% include "common/components/field.html" with field=inlineform.caption label='Caption' %} +
+
+ {% include "common/components/field.html" with field=inlineform.source label='File' %} +
    +
  • + +
  • +
+
+
{{ inlineform.non_form_errors }} -- 2.30.2 From 8c7749bb0e95140564059045717e97c49524f004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Lente?= Date: Tue, 27 Feb 2024 11:07:45 +0100 Subject: [PATCH 14/14] Fix: Fix js manage function resetImgUploadForm on pageload Part of #40 --- extensions/static/extensions/scripts/manage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/static/extensions/scripts/manage.js b/extensions/static/extensions/scripts/manage.js index 8ff9908e..1239c408 100644 --- a/extensions/static/extensions/scripts/manage.js +++ b/extensions/static/extensions/scripts/manage.js @@ -99,7 +99,6 @@ function removeImgUploadForm() { } // Create function resetImgUploadForm -// TODO: fix function resetImgUploadForm on pageload function resetImgUploadForm() { const btnResetImgUploadForm = document.querySelectorAll('.js-btn-reset-img-upload-form'); @@ -172,6 +171,7 @@ function setImgUploadFormThumbnail() { function init() { addImgUploadFormClasses(); resetImgUploadForm(); + setImgUploadFormThumbnail(); } // Configure tag selection, if present on the page -- 2.30.2