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 class="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Static Message (confirm_modal):</p>
|
<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(
|
{{ confirm_modal(
|
||||||
'deleteConfirm',
|
'deleteConfirm',
|
||||||
@@ -2638,25 +2638,25 @@ goToPage(n) { if (n !== '...' && n >= 1 && n <= this.totalPages) { this.paginati
|
|||||||
'Delete',
|
'Delete',
|
||||||
'Cancel',
|
'Cancel',
|
||||||
'danger'
|
'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>
|
<span x-html="$icon('duplicate', 'w-4 h-4 mr-1')"></span>
|
||||||
Copy Code
|
Copy Code
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Dynamic Message (confirm_modal_dynamic):</p>
|
<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(
|
{{ confirm_modal_dynamic(
|
||||||
'removePlatformModal',
|
'removePlatformModal',
|
||||||
'Remove Platform',
|
'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()',
|
'confirmRemovePlatform()',
|
||||||
'showRemovePlatformModal',
|
'showRemovePlatformModal',
|
||||||
'Remove',
|
'Remove',
|
||||||
'Cancel',
|
'Cancel',
|
||||||
'warning'
|
'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>
|
<span x-html="$icon('duplicate', 'w-4 h-4 mr-1')"></span>
|
||||||
Copy Code
|
Copy Code
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user