fix: escape Jinja2 syntax in components page code snippets
Added {% raw %}{% endraw %} tags around the confirm_modal code snippets
to prevent Jinja2 from interpreting the {{ }} as template tags.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2627,7 +2627,7 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Static Message (confirm_modal):</p>
|
||||
<button @click="copyCode(`{% from 'shared/macros/modals.html' import confirm_modal %}
|
||||
<button @click="copyCode(`{% raw %}{% from 'shared/macros/modals.html' import confirm_modal %}
|
||||
|
||||
{{ confirm_modal(
|
||||
'deleteConfirm',
|
||||
@@ -2638,25 +2638,25 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati
|
||||
'Delete',
|
||||
'Cancel',
|
||||
'danger'
|
||||
) }}`)" class="text-sm text-purple-600 hover:text-purple-700 dark:text-purple-400 flex items-center">
|
||||
) }}{% endraw %}`)" class="text-sm text-purple-600 hover:text-purple-700 dark:text-purple-400 flex items-center">
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4 mr-1')"></span>
|
||||
Copy Code
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Dynamic Message (confirm_modal_dynamic):</p>
|
||||
<button @click="copyCode(`{% from 'shared/macros/modals.html' import confirm_modal_dynamic %}
|
||||
<button @click="copyCode(`{% raw %}{% from 'shared/macros/modals.html' import confirm_modal_dynamic %}
|
||||
|
||||
{{ confirm_modal_dynamic(
|
||||
'removePlatformModal',
|
||||
'Remove Platform',
|
||||
\"'Are you sure you want to remove \\\"' + (platformToRemove?.name || '') + '\\\" from this admin?'\",
|
||||
\"'Are you sure you want to remove \"' + (platformToRemove?.name || '') + '\" from this admin?'\",
|
||||
'confirmRemovePlatform()',
|
||||
'showRemovePlatformModal',
|
||||
'Remove',
|
||||
'Cancel',
|
||||
'warning'
|
||||
) }}`)" class="text-sm text-purple-600 hover:text-purple-700 dark:text-purple-400 flex items-center">
|
||||
) }}{% endraw %}`)" class="text-sm text-purple-600 hover:text-purple-700 dark:text-purple-400 flex items-center">
|
||||
<span x-html="$icon('duplicate', 'w-4 h-4 mr-1')"></span>
|
||||
Copy Code
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user