fix: forum delete button JS error when title contains apostrophe
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions
Title with '26 broke inline onclick string. Now reads title from DOM. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8481ffd70a
commit
155577b985
@ -1047,7 +1047,7 @@
|
||||
</svg>
|
||||
{% if topic.is_locked %}Odblokuj{% else %}Zablokuj{% endif %}
|
||||
</button>
|
||||
<button type="button" class="admin-btn admin-btn-delete" onclick="deleteTopic({{ topic.id }}, '{{ topic.title|e }}')" title="Usuń wątek">
|
||||
<button type="button" class="admin-btn admin-btn-delete" onclick="deleteTopic({{ topic.id }})" title="Usuń wątek">
|
||||
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||
<path d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
|
||||
</svg>
|
||||
@ -1680,10 +1680,11 @@
|
||||
});
|
||||
|
||||
// Admin functions
|
||||
function deleteTopic(topicId, topicTitle) {
|
||||
function deleteTopic(topicId) {
|
||||
var topicTitle = document.querySelector('.topic-title')?.textContent?.trim() || '';
|
||||
showConfirmModal(
|
||||
'Usuń wątek',
|
||||
`Czy na pewno chcesz usunąć wątek "${topicTitle}"?`,
|
||||
'Czy na pewno chcesz usunąć wątek "' + topicTitle + '"?',
|
||||
'Ta operacja usunie również wszystkie odpowiedzi i jest nieodwracalna.',
|
||||
function() {
|
||||
fetch(`/admin/forum/topic/${topicId}/delete`, {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user