Skip to content

Commit

Permalink
Add release note
Browse files Browse the repository at this point in the history
  • Loading branch information
lunars97 committed Jul 1, 2024
1 parent a160faf commit 5750540
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integreat_cms/cms/templates/pages/page_sbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h1 class="heading">
{% translate "Not saved yet" %}
{% endif %}
<label for="{{ page_translation_form.slug.id_for_label }}"
data-slugify-url="{% url 'slugify_ajax' region_slug=request.region.slug language_slug=target_language.slug model_type='page' %}{% if page_translation_form.instance.id %}?model_id={{ page_translation_form.instance.id }}{% endif %}">
data-slugify-url="{% url 'slugify_ajax' region_slug=request.region.slug language_slug=target_language.slug model_type='page' %}{% if page_translation_form.instance.id %}?data-model-id={{ page_translation_form.instance.id }}{% endif %}">
{{ page_translation_form.slug.label }}
</label>
<div class="slug-field">
Expand Down
2 changes: 2 additions & 0 deletions integreat_cms/release_notes/2024/2024.6.1/2797.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
en: Fix automatic url update after changing a title of the page on side by side view
de: Behebe der automatischen URL-Aktualisierung nach Änderung eines Seitentitels in der Seitenansicht
7 changes: 4 additions & 3 deletions integreat_cms/static/src/js/forms/update-permalink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ window.addEventListener("load", () => {

// This is used to slugify the title of the slug in target language in the page_sbs template
document.getElementById("target_translation_title")?.addEventListener("focusout", () => {
const submissionLock = new SubmissionPrevention(".no-premature-submission");
const targetTitleElement = (document.getElementById("target_translation_title") as HTMLInputElement).value;
const targetLinkElement = document.getElementById("target_slug-link") as HTMLInputElement;
const url = (document.querySelector('[for="id_slug"]') as HTMLElement).dataset.slugifyUrl;
slugify(url, { title: targetTitleElement }).then((response) => {
const dataset = (document.querySelector('[for="id_slug"]') as HTMLElement).dataset;
slugify(dataset.slugifyUrl, { title: targetTitleElement, model_id: dataset.modelId }).then((response) => {
/* on success write response to both slug field and permalink */
targetLinkElement.value = response.unique_slug;
updatePermalink(response.unique_slug);
});
}).finally(() => submissionLock.release());
});
});

0 comments on commit 5750540

Please sign in to comment.