fix: replace all native confirm() dialogs with styled modal macros
Some checks failed
Some checks failed
Migrated ~68 native browser confirm() calls across 74 files to use the project's confirm_modal/confirm_modal_dynamic Jinja2 macros, providing consistent styled confirmation dialogs instead of plain browser popups. Modules updated: core, tenancy, cms, marketplace, messaging, billing, customers, orders, cart. Uses danger/warning/info variants and double-confirm pattern for destructive delete operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
{% from 'shared/macros/headers.html' import page_header %}
|
||||
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
||||
{% from 'shared/macros/tabs.html' import tabs_inline, tab_button %}
|
||||
{% from 'shared/macros/modals.html' import confirm_modal_dynamic %}
|
||||
|
||||
{% block title %}Content Pages{% endblock %}
|
||||
|
||||
@@ -142,7 +143,7 @@
|
||||
<span x-html="$icon('edit', 'w-5 h-5')"></span>
|
||||
</a>
|
||||
<button
|
||||
@click="deletePage(page)"
|
||||
@click="promptDeletePage(page)"
|
||||
class="flex items-center justify-center p-2 text-red-600 rounded-lg hover:bg-red-50 dark:text-red-400 dark:hover:bg-gray-700 focus:outline-none transition-colors"
|
||||
title="Delete"
|
||||
>
|
||||
@@ -175,6 +176,28 @@
|
||||
Create First Page
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{ confirm_modal_dynamic(
|
||||
'createHomepageModal',
|
||||
'Create Homepage',
|
||||
"'No homepage found for ' + (pendingHomepagePlatform || '') + '. Would you like to create one?'",
|
||||
'createHomepage()',
|
||||
'showCreateHomepageConfirm',
|
||||
'Create',
|
||||
'Cancel',
|
||||
'info'
|
||||
) }}
|
||||
|
||||
{{ confirm_modal_dynamic(
|
||||
'deletePageModal',
|
||||
'Delete Page',
|
||||
"'Are you sure you want to delete \"' + (pageToDelete?.title || '') + '\"?'",
|
||||
'deletePage(pageToDelete)',
|
||||
'showDeletePageConfirm',
|
||||
'Delete',
|
||||
'Cancel',
|
||||
'danger'
|
||||
) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_scripts %}
|
||||
|
||||
Reference in New Issue
Block a user