Skip to content

Commit 685dcda

Browse files
cantisCopilot
andauthored
Update app/templates/miniatures/add.html
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 42a3e0f commit 685dcda

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

app/templates/miniatures/add.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,20 @@ <h2>Add Miniature{% if duplicate_of %} (Duplicated from ID {{ duplicate_of.id }}
111111
const uniqueIdInput = document.querySelector('input[name="unique_id"]');
112112

113113
// Only update if not prefilled (no duplicate scenario)
114-
const isPrefilled = {{ 'true' if prefill is defined else 'false' }
115-
};
114+
const isPrefilled = {{ (prefill is defined)|tojson }};
116115

117-
if (seriesSelect && uniqueIdInput && !isPrefilled) {
118-
seriesSelect.addEventListener('change', function () {
119-
const series = this.value;
116+
if (seriesSelect && uniqueIdInput && !isPrefilled) {
117+
seriesSelect.addEventListener('change', function () {
118+
const series = this.value;
120119

121-
fetch('/miniatures/next-id/' + series)
122-
.then(response => response.json())
123-
.then(data => {
124-
uniqueIdInput.value = data.next_id;
125-
})
126-
.catch(error => console.error('Error fetching next ID:', error));
127-
});
128-
}
120+
fetch('/miniatures/next-id/' + series)
121+
.then(response => response.json())
122+
.then(data => {
123+
uniqueIdInput.value = data.next_id;
124+
})
125+
.catch(error => console.error('Error fetching next ID:', error));
126+
});
127+
}
129128
});
130129
</script>
131130
{% endblock %}

0 commit comments

Comments
 (0)